[Scummvm-git-logs] scummvm master -> 9c8a89bd9e7e1ac20b6d7cd11ce95f2bcecee251

dreammaster dreammaster at scummvm.org
Wed Mar 24 02:12:14 UTC 2021


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:
9c8a89bd9e GLK: Fix Clang warning


Commit: 9c8a89bd9e7e1ac20b6d7cd11ce95f2bcecee251
    https://github.com/scummvm/scummvm/commit/9c8a89bd9e7e1ac20b6d7cd11ce95f2bcecee251
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-03-23T19:12:12-07:00

Commit Message:
GLK: Fix Clang warning

../scummvm/engines/glk/tads/tads2/debug.cpp:227:30: warning: cast from 'const char *' to 'unsigned char *' drops const qualifier [-Wcast-qual]
            lstadv((uchar **)&p, &len);
                             ^

Notice that lstadv doesn't modify the pointer contents, only the pointer itself,
so it really should have been const uchar ** in the first place, but changing that
requires too many changes in calling functions, so I took the easy path.

Changed paths:
    engines/glk/tads/tads2/debug.cpp


diff --git a/engines/glk/tads/tads2/debug.cpp b/engines/glk/tads/tads2/debug.cpp
index 726cbe2c70..10418dccec 100644
--- a/engines/glk/tads/tads2/debug.cpp
+++ b/engines/glk/tads/tads2/debug.cpp
@@ -224,7 +224,7 @@ static void dbgpbval(dbgcxdef *ctx, dattyp typ, const uchar *val,
         while (len)
         {
             dbgpbval(ctx, (dattyp)*p, (const uchar *)(p + 1), dispfn, dispctx);
-            lstadv((uchar **)&p, &len);
+            lstadv((uchar **)const_cast<char **>(&p), &len);
             if (len) (*dispfn)(dispctx, " ", 1);
         }
         (*dispfn)(dispctx, "]", 1);




More information about the Scummvm-git-logs mailing list