diff options
Diffstat (limited to 'src/compat.cpp')
-rw-r--r-- | src/compat.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compat.cpp b/src/compat.cpp index 8acab25..9807390 100644 --- a/src/compat.cpp +++ b/src/compat.cpp | |||
@@ -15,7 +15,7 @@ | |||
15 | // ################################################################################################ | 15 | // ################################################################################################ |
16 | // ################################################################################################ | 16 | // ################################################################################################ |
17 | 17 | ||
18 | static int luaL_getsubtable (lua_State *L, int idx, const char *fname) | 18 | [[nodiscard]] static int luaL_getsubtable(lua_State* L, int idx, const char* fname) |
19 | { | 19 | { |
20 | lua_getfield(L, idx, fname); | 20 | lua_getfield(L, idx, fname); |
21 | if (lua_istable(L, -1)) | 21 | if (lua_istable(L, -1)) |
@@ -33,12 +33,12 @@ static int luaL_getsubtable (lua_State *L, int idx, const char *fname) | |||
33 | 33 | ||
34 | // ################################################################################################ | 34 | // ################################################################################################ |
35 | 35 | ||
36 | void luaL_requiref (lua_State *L, const char *modname, lua_CFunction openf, int glb) | 36 | void luaL_requiref(lua_State *L, const char *modname, lua_CFunction openf, int glb) |
37 | { | 37 | { |
38 | lua_pushcfunction(L, openf); | 38 | lua_pushcfunction(L, openf); |
39 | lua_pushstring(L, modname); /* argument to open function */ | 39 | lua_pushstring(L, modname); /* argument to open function */ |
40 | lua_call(L, 1, 1); /* open module */ | 40 | lua_call(L, 1, 1); /* open module */ |
41 | luaL_getsubtable(L, LUA_REGISTRYINDEX, LUA_LOADED_TABLE); | 41 | std::ignore = luaL_getsubtable(L, LUA_REGISTRYINDEX, LUA_LOADED_TABLE); |
42 | lua_pushvalue(L, -2); /* make copy of module (call result) */ | 42 | lua_pushvalue(L, -2); /* make copy of module (call result) */ |
43 | lua_setfield(L, -2, modname); /* _LOADED[modname] = module */ | 43 | lua_setfield(L, -2, modname); /* _LOADED[modname] = module */ |
44 | lua_pop(L, 1); /* remove _LOADED table */ | 44 | lua_pop(L, 1); /* remove _LOADED table */ |