diff options
Diffstat (limited to 'src/tools.cpp')
-rw-r--r-- | src/tools.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tools.cpp b/src/tools.cpp index e9114e0..94e941d 100644 --- a/src/tools.cpp +++ b/src/tools.cpp | |||
@@ -133,7 +133,7 @@ static void update_lookup_entry(lua_State* L_, int ctxBase_, int depth_) | |||
133 | // slot 2 contains a table that, when concatenated, produces the fully qualified name of scanned elements in the table provided at slot _i | 133 | // slot 2 contains a table that, when concatenated, produces the fully qualified name of scanned elements in the table provided at slot _i |
134 | int const _fqn{ ctxBase_ + 1 }; | 134 | int const _fqn{ ctxBase_ + 1 }; |
135 | 135 | ||
136 | DEBUGSPEW_CODE(Universe* const _U{ universe_get(L_) }); | 136 | DEBUGSPEW_CODE(Universe* const _U{ Universe::Get(L_) }); |
137 | DEBUGSPEW_CODE(DebugSpew(_U) << "update_lookup_entry()" << std::endl); | 137 | DEBUGSPEW_CODE(DebugSpew(_U) << "update_lookup_entry()" << std::endl); |
138 | DEBUGSPEW_CODE(DebugSpewIndentScope _scope{ _U }); | 138 | DEBUGSPEW_CODE(DebugSpewIndentScope _scope{ _U }); |
139 | 139 | ||
@@ -200,7 +200,7 @@ static void populate_func_lookup_table_recur(lua_State* L_, int dbIdx_, int i_, | |||
200 | int const _fqn{ dbIdx_ + 1 }; | 200 | int const _fqn{ dbIdx_ + 1 }; |
201 | // slot dbIdx_ + 2 contains a cache that stores all already visited tables to avoid infinite recursion loops | 201 | // slot dbIdx_ + 2 contains a cache that stores all already visited tables to avoid infinite recursion loops |
202 | int const _cache{ dbIdx_ + 2 }; | 202 | int const _cache{ dbIdx_ + 2 }; |
203 | DEBUGSPEW_CODE(Universe* const _U{ universe_get(L_) }); | 203 | DEBUGSPEW_CODE(Universe* const _U{ Universe::Get(L_) }); |
204 | DEBUGSPEW_CODE(DebugSpew(_U) << "populate_func_lookup_table_recur()" << std::endl); | 204 | DEBUGSPEW_CODE(DebugSpew(_U) << "populate_func_lookup_table_recur()" << std::endl); |
205 | DEBUGSPEW_CODE(DebugSpewIndentScope _scope{ _U }); | 205 | DEBUGSPEW_CODE(DebugSpewIndentScope _scope{ _U }); |
206 | 206 | ||
@@ -309,7 +309,7 @@ namespace tools { | |||
309 | void PopulateFuncLookupTable(lua_State* const L_, int const i_, std::string_view const& name_) | 309 | void PopulateFuncLookupTable(lua_State* const L_, int const i_, std::string_view const& name_) |
310 | { | 310 | { |
311 | int const _in_base{ lua_absindex(L_, i_) }; | 311 | int const _in_base{ lua_absindex(L_, i_) }; |
312 | DEBUGSPEW_CODE(Universe* _U = universe_get(L_)); | 312 | DEBUGSPEW_CODE(Universe* _U = Universe::Get(L_)); |
313 | std::string_view _name{ name_.empty() ? std::string_view{} : name_ }; | 313 | std::string_view _name{ name_.empty() ? std::string_view{} : name_ }; |
314 | DEBUGSPEW_CODE(DebugSpew(_U) << L_ << ": PopulateFuncLookupTable('" << _name << "')" << std::endl); | 314 | DEBUGSPEW_CODE(DebugSpew(_U) << L_ << ": PopulateFuncLookupTable('" << _name << "')" << std::endl); |
315 | DEBUGSPEW_CODE(DebugSpewIndentScope _scope{ _U }); | 315 | DEBUGSPEW_CODE(DebugSpewIndentScope _scope{ _U }); |
@@ -380,7 +380,7 @@ namespace tools { | |||
380 | LuaError const _rc{ std::invoke( | 380 | LuaError const _rc{ std::invoke( |
381 | [L = L_, args = _args]() | 381 | [L = L_, args = _args]() |
382 | { | 382 | { |
383 | std::lock_guard _guard{ universe_get(L)->requireMutex }; | 383 | std::lock_guard _guard{ Universe::Get(L)->requireMutex }; |
384 | // starting with Lua 5.4, require may return a second optional value, so we need LUA_MULTRET | 384 | // starting with Lua 5.4, require may return a second optional value, so we need LUA_MULTRET |
385 | return lua_pcall(L, args, LUA_MULTRET, 0 /*errfunc*/); // L_: err|result(s) | 385 | return lua_pcall(L, args, LUA_MULTRET, 0 /*errfunc*/); // L_: err|result(s) |
386 | }) | 386 | }) |
@@ -398,7 +398,7 @@ namespace tools { | |||
398 | 398 | ||
399 | STACK_GROW(L_, 1); | 399 | STACK_GROW(L_, 1); |
400 | STACK_CHECK_START_REL(L_, 0); | 400 | STACK_CHECK_START_REL(L_, 0); |
401 | DEBUGSPEW_CODE(DebugSpew(universe_get(L_)) << "serializing require()" << std::endl); | 401 | DEBUGSPEW_CODE(DebugSpew(Universe::Get(L_)) << "serializing require()" << std::endl); |
402 | 402 | ||
403 | // Check 'require' is there and not already wrapped; if not, do nothing | 403 | // Check 'require' is there and not already wrapped; if not, do nothing |
404 | lua_getglobal(L_, "require"); // L_: _G.require()|nil | 404 | lua_getglobal(L_, "require"); // L_: _G.require()|nil |