diff options
Diffstat (limited to 'engines/sword25/util/lua/lapi.cpp')
-rw-r--r-- | engines/sword25/util/lua/lapi.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/sword25/util/lua/lapi.cpp b/engines/sword25/util/lua/lapi.cpp index e4a3d86dc3..a38733e1f7 100644 --- a/engines/sword25/util/lua/lapi.cpp +++ b/engines/sword25/util/lua/lapi.cpp @@ -50,7 +50,8 @@ static TValue *index2adr (lua_State *L, int idx) { if (idx > 0) { TValue *o = L->base + (idx - 1); api_check(L, idx <= L->ci->top - L->base); - if (o >= L->top) return cast(TValue *, luaO_nilobject); + // FIXME: Get rid of const_cast + if (o >= L->top) return const_cast<TValue *>(luaO_nilobject); else return o; } else if (idx > LUA_REGISTRYINDEX) { @@ -70,7 +71,8 @@ static TValue *index2adr (lua_State *L, int idx) { idx = LUA_GLOBALSINDEX - idx; return (idx <= func->c.nupvalues) ? &func->c.upvalue[idx-1] - : cast(TValue *, luaO_nilobject); + // FIXME: Get rid of const_cast + : const_cast<TValue *>(luaO_nilobject); } } } |