diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-04-09 17:08:13 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-04-09 17:08:13 +0200 |
commit | aa9b3594e11498ca0977d87a9d0875d7fc107253 (patch) | |
tree | 8e4e3152088a56611822c6e881179e89e69bef13 /src/compat.cpp | |
parent | 95932749a53f46ae5901798a17e1f0c4c33ac6b2 (diff) | |
download | lanes-aa9b3594e11498ca0977d87a9d0875d7fc107253.tar.gz lanes-aa9b3594e11498ca0977d87a9d0875d7fc107253.tar.bz2 lanes-aa9b3594e11498ca0977d87a9d0875d7fc107253.zip |
C++ migration: [[nodiscard]] everywhere. still have to check all std::ignore
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 */ |