aboutsummaryrefslogtreecommitdiff
path: root/common/lua
diff options
context:
space:
mode:
authorD G Turner2019-10-06 07:58:40 +0100
committerD G Turner2019-10-06 07:58:40 +0100
commit70582daf46efdc7353100c7d9405df9e6f9b7fa2 (patch)
tree1046011bbccb7c4449aa66fee9dcd271fe382d79 /common/lua
parent6f8105264e6465c4061ca6fd04c7ea4340c78915 (diff)
downloadscummvm-rg350-70582daf46efdc7353100c7d9405df9e6f9b7fa2.tar.gz
scummvm-rg350-70582daf46efdc7353100c7d9405df9e6f9b7fa2.tar.bz2
scummvm-rg350-70582daf46efdc7353100c7d9405df9e6f9b7fa2.zip
COMMON: Fix Missing Default Switch Cases in Lua Interpreter
These are flagged by GCC if -Wswitch-default is enabled.
Diffstat (limited to 'common/lua')
-rw-r--r--common/lua/ldebug.cpp4
-rw-r--r--common/lua/ldo.cpp2
-rw-r--r--common/lua/lstrlib.cpp2
-rw-r--r--common/lua/lvm.cpp2
4 files changed, 10 insertions, 0 deletions
diff --git a/common/lua/ldebug.cpp b/common/lua/ldebug.cpp
index 96607d8e2a..91a8c3f9a4 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 f4139cb9fc..e1de0cfbaf 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 719ab4d8b2..cad9c841d4 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 d538d0b349..5c42628325 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;
}
}
}