diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-08 18:42:39 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-08 18:42:39 +0200 |
commit | 16b5070c0cd56e10c5074eb9903dbc3ae4e15a61 (patch) | |
tree | f6d5cdb74b505e13aa3261f7ab6192da0133b7b9 /src/state.cpp | |
parent | e939e5e6a894a042d3301e47faa05264445f27f6 (diff) | |
download | lanes-16b5070c0cd56e10c5074eb9903dbc3ae4e15a61.tar.gz lanes-16b5070c0cd56e10c5074eb9903dbc3ae4e15a61.tar.bz2 lanes-16b5070c0cd56e10c5074eb9903dbc3ae4e15a61.zip |
Sprinkling StackIndex all over the place
Diffstat (limited to 'src/state.cpp')
-rw-r--r-- | src/state.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state.cpp b/src/state.cpp index aa6e6a9..4664486 100644 --- a/src/state.cpp +++ b/src/state.cpp | |||
@@ -103,7 +103,7 @@ namespace { | |||
103 | luaL_requiref(L_, _name.data(), _libfunc, !_isLanesCore); // L_: {lib} | 103 | luaL_requiref(L_, _name.data(), _libfunc, !_isLanesCore); // L_: {lib} |
104 | // lanes.core doesn't declare a global, so scan it here and now | 104 | // lanes.core doesn't declare a global, so scan it here and now |
105 | if (_isLanesCore) { | 105 | if (_isLanesCore) { |
106 | tools::PopulateFuncLookupTable(L_, -1, _name); | 106 | tools::PopulateFuncLookupTable(L_, kIdxTop, _name); |
107 | } | 107 | } |
108 | lua_pop(L_, 1); // L_: | 108 | lua_pop(L_, 1); // L_: |
109 | STACK_CHECK(L_, 0); | 109 | STACK_CHECK(L_, 0); |
@@ -282,7 +282,7 @@ namespace state { | |||
282 | STACK_CHECK(_L, 0); | 282 | STACK_CHECK(_L, 0); |
283 | // after all this, register everything we find in our name<->function database | 283 | // after all this, register everything we find in our name<->function database |
284 | luaG_pushglobaltable(_L); // L: _G | 284 | luaG_pushglobaltable(_L); // L: _G |
285 | tools::PopulateFuncLookupTable(_L, -1, {}); | 285 | tools::PopulateFuncLookupTable(_L, kIdxTop, {}); |
286 | lua_pop(_L, 1); // L: | 286 | lua_pop(_L, 1); // L: |
287 | STACK_CHECK(_L, 0); | 287 | STACK_CHECK(_L, 0); |
288 | 288 | ||
@@ -324,7 +324,7 @@ namespace state { | |||
324 | lua_newtable(L_); // L_: out | 324 | lua_newtable(L_); // L_: out |
325 | for (luaL_Reg const& _entry : local::sLibs) { | 325 | for (luaL_Reg const& _entry : local::sLibs) { |
326 | lua_pushboolean(L_, 1); // L_: out true | 326 | lua_pushboolean(L_, 1); // L_: out true |
327 | luaG_setfield(L_, -2, std::string_view{ _entry.name }); // out[name] = true // L_: out | 327 | luaG_setfield(L_, StackIndex{ -2 }, std::string_view{ _entry.name }); // out[name] = true // L_: out |
328 | } | 328 | } |
329 | STACK_CHECK(L_, 1); | 329 | STACK_CHECK(L_, 1); |
330 | return 1; | 330 | return 1; |