diff options
Diffstat (limited to 'src/nameof.cpp')
-rw-r--r-- | src/nameof.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nameof.cpp b/src/nameof.cpp index 2ae315a..027c703 100644 --- a/src/nameof.cpp +++ b/src/nameof.cpp | |||
@@ -33,7 +33,7 @@ THE SOFTWARE. | |||
33 | 33 | ||
34 | // Return some name helping to identify an object | 34 | // Return some name helping to identify an object |
35 | [[nodiscard]] | 35 | [[nodiscard]] |
36 | static int DiscoverObjectNameRecur(lua_State* L_, int shortest_, int depth_) | 36 | static int DiscoverObjectNameRecur(lua_State* const L_, int shortest_, TableIndex depth_) |
37 | { | 37 | { |
38 | static constexpr StackIndex kWhat{ 1 }; // the object to investigate // L_: o "r" {c} {fqn} ... {?} | 38 | static constexpr StackIndex kWhat{ 1 }; // the object to investigate // L_: o "r" {c} {fqn} ... {?} |
39 | static constexpr StackIndex kResult{ 2 }; // where the result string is stored | 39 | static constexpr StackIndex kResult{ 2 }; // where the result string is stored |
@@ -193,13 +193,13 @@ LUAG_FUNC(nameof) | |||
193 | lua_rawseti(L_, -2, 1); // L_: o nil {c} {fqn} | 193 | lua_rawseti(L_, -2, 1); // L_: o nil {c} {fqn} |
194 | // this is where we start the search | 194 | // this is where we start the search |
195 | luaG_pushglobaltable(L_); // L_: o nil {c} {fqn} _G | 195 | luaG_pushglobaltable(L_); // L_: o nil {c} {fqn} _G |
196 | std::ignore = DiscoverObjectNameRecur(L_, std::numeric_limits<int>::max(), 1); | 196 | std::ignore = DiscoverObjectNameRecur(L_, std::numeric_limits<int>::max(), TableIndex{ 1 }); |
197 | if (lua_isnil(L_, 2)) { // try again with registry, just in case... | 197 | if (lua_isnil(L_, 2)) { // try again with registry, just in case... |
198 | lua_pop(L_, 1); // L_: o nil {c} {fqn} | 198 | lua_pop(L_, 1); // L_: o nil {c} {fqn} |
199 | luaG_pushstring(L_, "_R"); // L_: o nil {c} {fqn} "_R" | 199 | luaG_pushstring(L_, "_R"); // L_: o nil {c} {fqn} "_R" |
200 | lua_rawseti(L_, -2, 1); // L_: o nil {c} {fqn} | 200 | lua_rawseti(L_, -2, 1); // L_: o nil {c} {fqn} |
201 | lua_pushvalue(L_, kIdxRegistry); // L_: o nil {c} {fqn} _R | 201 | lua_pushvalue(L_, kIdxRegistry); // L_: o nil {c} {fqn} _R |
202 | std::ignore = DiscoverObjectNameRecur(L_, std::numeric_limits<int>::max(), 1); | 202 | std::ignore = DiscoverObjectNameRecur(L_, std::numeric_limits<int>::max(), TableIndex{ 1 }); |
203 | } | 203 | } |
204 | lua_pop(L_, 3); // L_: o "result" | 204 | lua_pop(L_, 3); // L_: o "result" |
205 | STACK_CHECK(L_, 1); | 205 | STACK_CHECK(L_, 1); |