aboutsummaryrefslogtreecommitdiff
path: root/src/state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.cpp')
-rw-r--r--src/state.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/state.cpp b/src/state.cpp
index 512009a..6a9ada7 100644
--- a/src/state.cpp
+++ b/src/state.cpp
@@ -1,5 +1,5 @@
1/* 1/*
2* STATE.C 2* STATE.CPP
3* 3*
4* Lua tools to support Lanes. 4* Lua tools to support Lanes.
5*/ 5*/
@@ -31,20 +31,11 @@ THE SOFTWARE.
31=============================================================================== 31===============================================================================
32*/ 32*/
33 33
34#include <stdio.h> 34#include "state.h"
35#include <assert.h> 35
36#include <string.h>
37#include <ctype.h>
38#include <stdlib.h>
39#if !defined(__APPLE__)
40#include <malloc.h>
41#endif // __APPLE__
42
43#include "compat.h"
44#include "macros_and_utils.h"
45#include "universe.h"
46#include "tools.h"
47#include "lanes.h" 36#include "lanes.h"
37#include "tools.h"
38#include "universe.h"
48 39
49// ################################################################################################ 40// ################################################################################################
50 41
@@ -194,9 +185,9 @@ static void open1lib( DEBUGSPEW_PARAM_COMMA( Universe* U) lua_State* L, char con
194 185
195 186
196// just like lua_xmove, args are (from, to) 187// just like lua_xmove, args are (from, to)
197static void copy_one_time_settings( Universe* U, lua_State* L, lua_State* L2) 188static void copy_one_time_settings(Universe* U, Source L, Dest L2)
198{ 189{
199 STACK_GROW( L, 2); 190 STACK_GROW(L, 2);
200 STACK_CHECK_START_REL(L, 0); 191 STACK_CHECK_START_REL(L, 0);
201 STACK_CHECK_START_REL(L2, 0); 192 STACK_CHECK_START_REL(L2, 0);
202 193
@@ -326,11 +317,11 @@ void call_on_state_create(Universe* U, lua_State* L, lua_State* from_, LookupMod
326* *NOT* called for keeper states! 317* *NOT* called for keeper states!
327* 318*
328*/ 319*/
329lua_State* luaG_newstate( Universe* U, lua_State* from_, char const* libs_) 320lua_State* luaG_newstate(Universe* U, Source from_, char const* libs_)
330{ 321{
331 lua_State* L = create_state( U, from_); 322 Dest const L{ create_state(U, from_) };
332 323
333 STACK_GROW( L, 2); 324 STACK_GROW(L, 2);
334 STACK_CHECK_START_ABS(L, 0); 325 STACK_CHECK_START_ABS(L, 0);
335 326
336 // copy the universe as a light userdata (only the master state holds the full userdata) 327 // copy the universe as a light userdata (only the master state holds the full userdata)