[Scummvm-git-logs] scummvm master -> 31127247b509f0c78f280186cdc2042611f9ec06
digitall
noreply at scummvm.org
Wed Mar 30 21:28:19 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
31127247b5 TINSEL: Fix for Cast Qualifier GCC Compiler Warnings
Commit: 31127247b509f0c78f280186cdc2042611f9ec06
https://github.com/scummvm/scummvm/commit/31127247b509f0c78f280186cdc2042611f9ec06
Author: D G Turner (digitall at scummvm.org)
Date: 2022-03-30T22:26:03+01:00
Commit Message:
TINSEL: Fix for Cast Qualifier GCC Compiler Warnings
These are emitted by GCC when -Wcast-qual is passed.
These warnings were introduced by e90b45b and should be fixed in
a better way if possible.
Changed paths:
engines/tinsel/movers.cpp
engines/tinsel/sched.cpp
diff --git a/engines/tinsel/movers.cpp b/engines/tinsel/movers.cpp
index ed7d452e994..2a4021abd39 100644
--- a/engines/tinsel/movers.cpp
+++ b/engines/tinsel/movers.cpp
@@ -769,7 +769,16 @@ void T1MoverProcess(CORO_PARAM, const void *param) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
+ // FIXME: Code without typedef emits -Wcast-qual GCC warning.
+ // However, adding const casts break compilation with -fpermissive.
+ // Reverted to local typedef for now until this can be avoided.
+#if 0
MOVER *pActor = *(MOVER **)param;
+ //const MOVER *pActor = *(const MOVER **)param;
+#else
+ typedef MOVER *PMOVER;
+ const PMOVER pActor = *(const PMOVER *)param;
+#endif
CORO_BEGIN_CODE(_ctx);
diff --git a/engines/tinsel/sched.cpp b/engines/tinsel/sched.cpp
index a0b8a2a5eba..101ab15ced4 100644
--- a/engines/tinsel/sched.cpp
+++ b/engines/tinsel/sched.cpp
@@ -74,7 +74,16 @@ static void RestoredProcessProcess(CORO_PARAM, const void *param) {
CORO_BEGIN_CODE(_ctx);
// get the stuff copied to process when it was created
+ // FIXME: Code without typedef emits -Wcast-qual GCC warning.
+ // However, adding const casts break compilation with -fpermissive.
+ // Reverted to local typedef for now until this can be avoided.
+#if 0
_ctx->pic = *(INT_CONTEXT **)param;
+ //_ctx->pic = *(const INT_CONTEXT **)param;
+#else
+ typedef INT_CONTEXT *PINT_CONTEXT;
+ _ctx->pic = *(const PINT_CONTEXT *)param;
+#endif
_ctx->pic = RestoreInterpretContext(_ctx->pic);
AttachInterpret(_ctx->pic, CoroScheduler.getCurrentProcess());
@@ -88,7 +97,16 @@ static void RestoredProcessProcess(CORO_PARAM, const void *param) {
* Process Tinsel Process
*/
static void ProcessTinselProcess(CORO_PARAM, const void *param) {
- INT_CONTEXT **pPic = (INT_CONTEXT **)param;
+ // FIXME: Code without typedef emits -Wcast-qual GCC warning.
+ // However, adding const casts break compilation with -fpermissive.
+ // Reverted to local typedef for now until this can be avoided.
+#if 0
+ //INT_CONTEXT **pPic = (INT_CONTEXT **)param;
+ const INT_CONTEXT **pPic = (const INT_CONTEXT **)param;
+#else
+ typedef INT_CONTEXT *PINT_CONTEXT;
+ const PINT_CONTEXT *pPic = (const PINT_CONTEXT *)param;
+#endif
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
More information about the Scummvm-git-logs
mailing list