diff options
Diffstat (limited to 'src/tools.cpp')
-rw-r--r-- | src/tools.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tools.cpp b/src/tools.cpp index e11cad5..7b2d153 100644 --- a/src/tools.cpp +++ b/src/tools.cpp | |||
@@ -305,7 +305,7 @@ static void update_lookup_entry(DEBUGSPEW_PARAM_COMMA(Universe* U) lua_State* L_ | |||
305 | // based on some sorting order so that we end up with the same name in all databases whatever order the table walk yielded | 305 | // based on some sorting order so that we end up with the same name in all databases whatever order the table walk yielded |
306 | if (prevName != nullptr && (prevNameLength < newNameLength || lua_lessthan(L_, -2, -1))) | 306 | if (prevName != nullptr && (prevNameLength < newNameLength || lua_lessthan(L_, -2, -1))) |
307 | { | 307 | { |
308 | DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "%s '%s' remained named '%s'\n" INDENT_END, lua_typename( L, lua_type( L, -3)), newName, prevName)); | 308 | DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "%s '%s' remained named '%s'\n" INDENT_END, lua_typename(L_, lua_type(L_, -3)), newName, prevName)); |
309 | // the previous name is 'smaller' than the one we just generated: keep it! | 309 | // the previous name is 'smaller' than the one we just generated: keep it! |
310 | lua_pop(L_, 3); // ... {bfc} k | 310 | lua_pop(L_, 3); // ... {bfc} k |
311 | } | 311 | } |
@@ -324,7 +324,7 @@ static void update_lookup_entry(DEBUGSPEW_PARAM_COMMA(Universe* U) lua_State* L_ | |||
324 | { | 324 | { |
325 | lua_remove(L_, -2); // ... {bfc} k o "f.q.n" | 325 | lua_remove(L_, -2); // ... {bfc} k o "f.q.n" |
326 | } | 326 | } |
327 | DEBUGSPEW_CODE(fprintf( stderr, INDENT_BEGIN "%s '%s'\n" INDENT_END, lua_typename(L, lua_type( L, -2)), newName)); | 327 | DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "%s '%s'\n" INDENT_END, lua_typename(L_, lua_type(L_, -2)), newName)); |
328 | // prepare the stack for database feed | 328 | // prepare the stack for database feed |
329 | lua_pushvalue(L_, -1); // ... {bfc} k o "f.q.n" "f.q.n" | 329 | lua_pushvalue(L_, -1); // ... {bfc} k o "f.q.n" "f.q.n" |
330 | lua_pushvalue(L_, -3); // ... {bfc} k o "f.q.n" "f.q.n" o | 330 | lua_pushvalue(L_, -3); // ... {bfc} k o "f.q.n" "f.q.n" o |
@@ -428,7 +428,7 @@ static void populate_func_lookup_table_recur(DEBUGSPEW_PARAM_COMMA(Universe* U) | |||
428 | lua_pushnil(L_); // ... {_i} {bfc} nil | 428 | lua_pushnil(L_); // ... {_i} {bfc} nil |
429 | while (lua_next(L_, breadth_first_cache) != 0) // ... {_i} {bfc} k {} | 429 | while (lua_next(L_, breadth_first_cache) != 0) // ... {_i} {bfc} k {} |
430 | { | 430 | { |
431 | DEBUGSPEW_CODE(char const* key = (lua_type(L, -2) == LUA_TSTRING) ? lua_tostring(L, -2) : "not a string"); | 431 | DEBUGSPEW_CODE(char const* key = (lua_type(L_, -2) == LUA_TSTRING) ? lua_tostring(L_, -2) : "not a string"); |
432 | DEBUGSPEW_CODE(fprintf( stderr, INDENT_BEGIN "table '%s'\n" INDENT_END, key)); | 432 | DEBUGSPEW_CODE(fprintf( stderr, INDENT_BEGIN "table '%s'\n" INDENT_END, key)); |
433 | DEBUGSPEW_CODE(DebugSpewIndentScope scope{ U }); | 433 | DEBUGSPEW_CODE(DebugSpewIndentScope scope{ U }); |
434 | // un-visit this table in case we do need to process it | 434 | // un-visit this table in case we do need to process it |
@@ -474,8 +474,8 @@ void populate_func_lookup_table(lua_State* L_, int i_, char const* name_) | |||
474 | int const ctx_base = lua_gettop(L_) + 1; | 474 | int const ctx_base = lua_gettop(L_) + 1; |
475 | int const in_base = lua_absindex(L_, i_); | 475 | int const in_base = lua_absindex(L_, i_); |
476 | int start_depth = 0; | 476 | int start_depth = 0; |
477 | DEBUGSPEW_CODE(Universe* U = universe_get(L)); | 477 | DEBUGSPEW_CODE(Universe* U = universe_get(L_)); |
478 | DEBUGSPEW_CODE(fprintf( stderr, INDENT_BEGIN "%p: populate_func_lookup_table('%s')\n" INDENT_END, L, name_ ? name_ : "nullptr")); | 478 | DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "%p: populate_func_lookup_table('%s')\n" INDENT_END, L_, name_ ? name_ : "nullptr")); |
479 | DEBUGSPEW_CODE(DebugSpewIndentScope scope{ U }); | 479 | DEBUGSPEW_CODE(DebugSpewIndentScope scope{ U }); |
480 | STACK_GROW(L_, 3); | 480 | STACK_GROW(L_, 3); |
481 | STACK_CHECK_START_REL(L_, 0); | 481 | STACK_CHECK_START_REL(L_, 0); |
@@ -1723,7 +1723,7 @@ void InterCopyContext::inter_copy_keyvaluepair() const | |||
1723 | return true; | 1723 | return true; |
1724 | } | 1724 | } |
1725 | 1725 | ||
1726 | /* Check if we've already copied the same table from 'L' (during this transmission), and | 1726 | /* Check if we've already copied the same table from 'L1' (during this transmission), and |
1727 | * reuse the old copy. This allows table upvalues shared by multiple | 1727 | * reuse the old copy. This allows table upvalues shared by multiple |
1728 | * local functions to point to the same table, also in the target. | 1728 | * local functions to point to the same table, also in the target. |
1729 | * Also, this takes care of cyclic tables and multiple references | 1729 | * Also, this takes care of cyclic tables and multiple references |