diff options
| author | Benoit Germain <benoit.germain@ubisoft.com> | 2025-07-04 13:50:53 +0200 |
|---|---|---|
| committer | Benoit Germain <benoit.germain@ubisoft.com> | 2025-07-04 13:50:53 +0200 |
| commit | 042055968ab0c48faec607889814e38c50c09efa (patch) | |
| tree | 4ec067a03ffcb720d8bf38968d5f84ccec8230d0 /src/compat.cpp | |
| parent | 963afcbb3d9dac47b84552ed11e53a0641ad924d (diff) | |
| download | lanes-042055968ab0c48faec607889814e38c50c09efa.tar.gz lanes-042055968ab0c48faec607889814e38c50c09efa.tar.bz2 lanes-042055968ab0c48faec607889814e38c50c09efa.zip | |
Changed lua wrapper prefixes from luaG_ to luaW_ (w as in wrapper!)
Diffstat (limited to 'src/compat.cpp')
| -rw-r--r-- | src/compat.cpp | 12 |
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 | ||
| 8 | UserValueCount luaG_getalluservalues(lua_State* const L_, StackIndex const idx_) | 8 | UserValueCount 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>"] |
| 27 | LuaType luaG_getmodule(lua_State* const L_, std::string_view const& name_) | 27 | LuaType 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 */ |
