aboutsummaryrefslogtreecommitdiff
path: root/src/tools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools.cpp')
-rw-r--r--src/tools.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tools.cpp b/src/tools.cpp
index 0cfe1ab..a70fdc9 100644
--- a/src/tools.cpp
+++ b/src/tools.cpp
@@ -130,7 +130,7 @@ static void update_lookup_entry(DEBUGSPEW_PARAM_COMMA(Universe* U_) lua_State* L
130 130
131 DEBUGSPEW_CODE(char const* _newName); 131 DEBUGSPEW_CODE(char const* _newName);
132 DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "update_lookup_entry()\n" INDENT_END(U_))); 132 DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "update_lookup_entry()\n" INDENT_END(U_)));
133 DEBUGSPEW_CODE(DebugSpewIndentScope scope{ U_ }); 133 DEBUGSPEW_CODE(DebugSpewIndentScope _scope{ U_ });
134 134
135 STACK_CHECK_START_REL(L_, 0); 135 STACK_CHECK_START_REL(L_, 0);
136 // first, raise an error if the function is already known 136 // first, raise an error if the function is already known
@@ -198,7 +198,7 @@ static void populate_func_lookup_table_recur(DEBUGSPEW_PARAM_COMMA(Universe* U_)
198 // slot dbIdx_ + 2 contains a cache that stores all already visited tables to avoid infinite recursion loops 198 // slot dbIdx_ + 2 contains a cache that stores all already visited tables to avoid infinite recursion loops
199 int const _cache{ dbIdx_ + 2 }; 199 int const _cache{ dbIdx_ + 2 };
200 DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "populate_func_lookup_table_recur()\n" INDENT_END(U_))); 200 DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "populate_func_lookup_table_recur()\n" INDENT_END(U_)));
201 DEBUGSPEW_CODE(DebugSpewIndentScope scope{ U_ }); 201 DEBUGSPEW_CODE(DebugSpewIndentScope _scope{ U_ });
202 202
203 STACK_GROW(L_, 6); 203 STACK_GROW(L_, 6);
204 // slot i_ contains a table where we search for functions (or a full userdata with a metatable) 204 // slot i_ contains a table where we search for functions (or a full userdata with a metatable)
@@ -264,9 +264,9 @@ static void populate_func_lookup_table_recur(DEBUGSPEW_PARAM_COMMA(Universe* U_)
264 ++depth_; 264 ++depth_;
265 lua_pushnil(L_); // L_: ... {i_} {bfc} nil 265 lua_pushnil(L_); // L_: ... {i_} {bfc} nil
266 while (lua_next(L_, breadthFirstCache) != 0) { // L_: ... {i_} {bfc} k {} 266 while (lua_next(L_, breadthFirstCache) != 0) { // L_: ... {i_} {bfc} k {}
267 DEBUGSPEW_CODE(char const* key = (lua_type(L_, -2) == LUA_TSTRING) ? lua_tostring(L_, -2) : "not a string"); 267 DEBUGSPEW_CODE(char const* _key = (lua_type(L_, -2) == LUA_TSTRING) ? lua_tostring(L_, -2) : "not a string");
268 DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "table '%s'\n" INDENT_END(U_), key)); 268 DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "table '%s'\n" INDENT_END(U_), _key));
269 DEBUGSPEW_CODE(DebugSpewIndentScope scope2{ U_ }); 269 DEBUGSPEW_CODE(DebugSpewIndentScope _scope2{ U_ });
270 // un-visit this table in case we do need to process it 270 // un-visit this table in case we do need to process it
271 lua_pushvalue(L_, -1); // L_: ... {i_} {bfc} k {} {} 271 lua_pushvalue(L_, -1); // L_: ... {i_} {bfc} k {} {}
272 lua_rawget(L_, _cache); // L_: ... {i_} {bfc} k {} n 272 lua_rawget(L_, _cache); // L_: ... {i_} {bfc} k {} n
@@ -505,7 +505,7 @@ int luaG_nameof(lua_State* L_)
505 // push a table whose contents are strings that, when concatenated, produce unique name 505 // push a table whose contents are strings that, when concatenated, produce unique name
506 lua_newtable(L_); // L_: o nil {c} {fqn} 506 lua_newtable(L_); // L_: o nil {c} {fqn}
507 // {fqn}[1] = "_G" 507 // {fqn}[1] = "_G"
508 lua_pushliteral(L_, "_G"); // L_: o nil {c} {fqn} "_G" 508 lua_pushliteral(L_, LUA_GNAME); // L_: o nil {c} {fqn} "_G"
509 lua_rawseti(L_, -2, 1); // L_: o nil {c} {fqn} 509 lua_rawseti(L_, -2, 1); // L_: o nil {c} {fqn}
510 // this is where we start the search 510 // this is where we start the search
511 lua_pushglobaltable(L_); // L_: o nil {c} {fqn} _G 511 lua_pushglobaltable(L_); // L_: o nil {c} {fqn} _G