[Scummvm-git-logs] scummvm master -> 70582daf46efdc7353100c7d9405df9e6f9b7fa2

digitall 547637+digitall at users.noreply.github.com
Sun Oct 6 09:02:02 CEST 2019


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:
70582daf46 COMMON: Fix Missing Default Switch Cases in Lua Interpreter


Commit: 70582daf46efdc7353100c7d9405df9e6f9b7fa2
    https://github.com/scummvm/scummvm/commit/70582daf46efdc7353100c7d9405df9e6f9b7fa2
Author: D G Turner (digitall at scummvm.org)
Date: 2019-10-06T07:58:40+01:00

Commit Message:
COMMON: Fix Missing Default Switch Cases in Lua Interpreter

These are flagged by GCC if -Wswitch-default is enabled.

Changed paths:
    common/lua/ldebug.cpp
    common/lua/ldo.cpp
    common/lua/lstrlib.cpp
    common/lua/lvm.cpp


diff --git a/common/lua/ldebug.cpp b/common/lua/ldebug.cpp
index 96607d8..91a8c3f 100644
--- a/common/lua/ldebug.cpp
+++ b/common/lua/ldebug.cpp
@@ -304,6 +304,8 @@ static int checkArgMode (const Proto *pt, int r, enum OpArgMask mode) {
     case OpArgK:
       check(ISK(r) ? INDEXK(r) < pt->sizek : r < pt->maxstacksize);
       break;
+    default:
+      break;
   }
   return 1;
 }
@@ -348,6 +350,8 @@ static Instruction symbexec (const Proto *pt, int lastpc, int reg) {
         }
         break;
       }
+      default:
+        break;
     }
     if (testAMode(op)) {
       if (a == reg) last = pc;  /* change register `a' */
diff --git a/common/lua/ldo.cpp b/common/lua/ldo.cpp
index f4139cb..e1de0cf 100644
--- a/common/lua/ldo.cpp
+++ b/common/lua/ldo.cpp
@@ -61,6 +61,8 @@ void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) {
       setsvalue2s(L, oldtop, luaS_newliteral(L, MEMERRMSG));
       break;
     }
+    default:
+      // fallthrough intended
     case LUA_ERRERR: {
       setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling"));
       break;
diff --git a/common/lua/lstrlib.cpp b/common/lua/lstrlib.cpp
index 719ab4d..cad9c84 100644
--- a/common/lua/lstrlib.cpp
+++ b/common/lua/lstrlib.cpp
@@ -624,6 +624,8 @@ static void add_value (MatchState *ms, luaL_Buffer *b, const char *s,
       lua_gettable(L, 3);
       break;
     }
+    default:
+      break;
   }
   if (!lua_toboolean(L, -1)) {  /* nil or false? */
     lua_pop(L, 1);
diff --git a/common/lua/lvm.cpp b/common/lua/lvm.cpp
index d538d0b..5c42628 100644
--- a/common/lua/lvm.cpp
+++ b/common/lua/lvm.cpp
@@ -757,6 +757,8 @@ void luaV_execute (lua_State *L, int nexeccalls) {
         }
         continue;
       }
+      default:
+        continue;
     }
   }
 }





More information about the Scummvm-git-logs mailing list