diff options
Diffstat (limited to 'src/state.cpp')
-rw-r--r-- | src/state.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/state.cpp b/src/state.cpp index 56ac74b..a6c9859 100644 --- a/src/state.cpp +++ b/src/state.cpp | |||
@@ -215,7 +215,7 @@ static void copy_one_time_settings(Universe* U_, SourceState L1_, DestState L2_) | |||
215 | 215 | ||
216 | // ################################################################################################# | 216 | // ################################################################################################# |
217 | 217 | ||
218 | void initializeOnStateCreate(Universe* U_, lua_State* L_) | 218 | void InitializeOnStateCreate(Universe* U_, lua_State* L_) |
219 | { | 219 | { |
220 | STACK_CHECK_START_REL(L_, 1); // L_: settings | 220 | STACK_CHECK_START_REL(L_, 1); // L_: settings |
221 | lua_getfield(L_, -1, "on_state_create"); // L_: settings on_state_create|nil | 221 | lua_getfield(L_, -1, "on_state_create"); // L_: settings on_state_create|nil |
@@ -234,7 +234,7 @@ void initializeOnStateCreate(Universe* U_, lua_State* L_) | |||
234 | lua_setfield(L_, -3, "on_state_create"); // L_: settings on_state_create | 234 | lua_setfield(L_, -3, "on_state_create"); // L_: settings on_state_create |
235 | } else { | 235 | } else { |
236 | // optim: store marker saying we have such a function in the config table | 236 | // optim: store marker saying we have such a function in the config table |
237 | U_->onStateCreateFunc = reinterpret_cast<lua_CFunction>(initializeOnStateCreate); | 237 | U_->onStateCreateFunc = reinterpret_cast<lua_CFunction>(InitializeOnStateCreate); |
238 | } | 238 | } |
239 | } | 239 | } |
240 | lua_pop(L_, 1); // L_: settings | 240 | lua_pop(L_, 1); // L_: settings |
@@ -272,12 +272,12 @@ lua_State* create_state([[maybe_unused]] Universe* U_, lua_State* from_) | |||
272 | 272 | ||
273 | // ################################################################################################# | 273 | // ################################################################################################# |
274 | 274 | ||
275 | void callOnStateCreate(Universe* U_, lua_State* L_, lua_State* from_, LookupMode mode_) | 275 | void CallOnStateCreate(Universe* U_, lua_State* L_, lua_State* from_, LookupMode mode_) |
276 | { | 276 | { |
277 | if (U_->onStateCreateFunc != nullptr) { | 277 | if (U_->onStateCreateFunc != nullptr) { |
278 | STACK_CHECK_START_REL(L_, 0); | 278 | STACK_CHECK_START_REL(L_, 0); |
279 | DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "calling on_state_create()\n" INDENT_END(U_))); | 279 | DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "calling on_state_create()\n" INDENT_END(U_))); |
280 | if (U_->onStateCreateFunc != reinterpret_cast<lua_CFunction>(initializeOnStateCreate)) { | 280 | if (U_->onStateCreateFunc != reinterpret_cast<lua_CFunction>(InitializeOnStateCreate)) { |
281 | // C function: recreate a closure in the new state, bypassing the lookup scheme | 281 | // C function: recreate a closure in the new state, bypassing the lookup scheme |
282 | lua_pushcfunction(L_, U_->onStateCreateFunc); // on_state_create() | 282 | lua_pushcfunction(L_, U_->onStateCreateFunc); // on_state_create() |
283 | } else { // Lua function located in the config table, copied when we opened "lanes.core" | 283 | } else { // Lua function located in the config table, copied when we opened "lanes.core" |
@@ -393,7 +393,7 @@ lua_State* luaG_newstate(Universe* U_, SourceState from_, char const* libs_) | |||
393 | 393 | ||
394 | // call this after the base libraries are loaded and GC is restarted | 394 | // call this after the base libraries are loaded and GC is restarted |
395 | // will raise an error in from_ in case of problem | 395 | // will raise an error in from_ in case of problem |
396 | callOnStateCreate(U_, _L, from_, LookupMode::LaneBody); | 396 | CallOnStateCreate(U_, _L, from_, LookupMode::LaneBody); |
397 | 397 | ||
398 | STACK_CHECK(_L, 0); | 398 | STACK_CHECK(_L, 0); |
399 | // after all this, register everything we find in our name<->function database | 399 | // after all this, register everything we find in our name<->function database |