aboutsummaryrefslogtreecommitdiff
path: root/src/compat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compat.cpp')
-rw-r--r--src/compat.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compat.cpp b/src/compat.cpp
index 7e90142..08f22ca 100644
--- a/src/compat.cpp
+++ b/src/compat.cpp
@@ -5,10 +5,10 @@
5 5
6// ################################################################################################# 6// #################################################################################################
7 7
8UserValueCount luaG_getalluservalues(lua_State* const L_, StackIndex const idx_) 8UserValueCount luaW_getalluservalues(lua_State* const L_, StackIndex const idx_)
9{ 9{
10 STACK_CHECK_START_REL(L_, 0); 10 STACK_CHECK_START_REL(L_, 0);
11 StackIndex const _idx{ luaG_absindex(L_, idx_) }; 11 StackIndex const _idx{ luaW_absindex(L_, idx_) };
12 UserValueIndex _nuv{ 0 }; 12 UserValueIndex _nuv{ 0 };
13 do { 13 do {
14 // we don't know how many uservalues we are going to extract, there might be a lot... 14 // we don't know how many uservalues we are going to extract, there might be a lot...
@@ -24,15 +24,15 @@ UserValueCount luaG_getalluservalues(lua_State* const L_, StackIndex const idx_)
24// ################################################################################################# 24// #################################################################################################
25 25
26// a small helper to obtain a module's table from the registry instead of relying on the presence of _G["<name>"] 26// a small helper to obtain a module's table from the registry instead of relying on the presence of _G["<name>"]
27LuaType luaG_getmodule(lua_State* const L_, std::string_view const& name_) 27LuaType luaW_getmodule(lua_State* const L_, std::string_view const& name_)
28{ 28{
29 STACK_CHECK_START_REL(L_, 0); 29 STACK_CHECK_START_REL(L_, 0);
30 LuaType _type{ luaG_getfield(L_, kIdxRegistry, LUA_LOADED_TABLE) }; // L_: _R._LOADED|nil 30 LuaType _type{ luaW_getfield(L_, kIdxRegistry, LUA_LOADED_TABLE) }; // L_: _R._LOADED|nil
31 if (_type != LuaType::TABLE) { // L_: _R._LOADED|nil 31 if (_type != LuaType::TABLE) { // L_: _R._LOADED|nil
32 STACK_CHECK(L_, 1); 32 STACK_CHECK(L_, 1);
33 return _type; 33 return _type;
34 } 34 }
35 _type = luaG_getfield(L_, kIdxTop, name_); // L_: _R._LOADED {module}|nil 35 _type = luaW_getfield(L_, kIdxTop, name_); // L_: _R._LOADED {module}|nil
36 lua_remove(L_, -2); // L_: {module}|nil 36 lua_remove(L_, -2); // L_: {module}|nil
37 STACK_CHECK(L_, 1); 37 STACK_CHECK(L_, 1);
38 return _type; 38 return _type;
@@ -52,7 +52,7 @@ int luaL_getsubtable(lua_State* const L_, StackIndex const idx_, char const* fna
52 return 1; /* table already there */ 52 return 1; /* table already there */
53 } else { 53 } else {
54 lua_pop(L_, 1); /* remove previous result */ 54 lua_pop(L_, 1); /* remove previous result */
55 StackIndex const _absidx{ luaG_absindex(L_, idx_) }; 55 StackIndex const _absidx{ luaW_absindex(L_, idx_) };
56 lua_newtable(L_); 56 lua_newtable(L_);
57 lua_pushvalue(L_, -1); /* copy to be left at top */ 57 lua_pushvalue(L_, -1); /* copy to be left at top */
58 lua_setfield(L_, _absidx, fname_); /* assign new table to field */ 58 lua_setfield(L_, _absidx, fname_); /* assign new table to field */