aboutsummaryrefslogtreecommitdiff
path: root/src/universe.c
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2018-10-25 14:03:32 +0200
committerBenoit Germain <bnt.germain@gmail.com>2018-10-25 14:03:32 +0200
commit9645a86fbcb16ca83c5f4ff0dae0925ac71bb46b (patch)
treec47a5f4ea54490ed969b5ebdf1a2174c29e49ff5 /src/universe.c
parent1ec3f220f345f1c090a18adbaa90c0ead61e8ed3 (diff)
downloadlanes-9645a86fbcb16ca83c5f4ff0dae0925ac71bb46b.tar.gz
lanes-9645a86fbcb16ca83c5f4ff0dae0925ac71bb46b.tar.bz2
lanes-9645a86fbcb16ca83c5f4ff0dae0925ac71bb46b.zip
Fix Lanes build by reorganizing types around a bit
Diffstat (limited to 'src/universe.c')
-rw-r--r--src/universe.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/universe.c b/src/universe.c
index ba78396..8bcdcfe 100644
--- a/src/universe.c
+++ b/src/universe.c
@@ -28,19 +28,19 @@ THE SOFTWARE.
28=============================================================================== 28===============================================================================
29*/ 29*/
30 30
31#include "universe.h"
31#include "compat.h" 32#include "compat.h"
32#include "macros_and_utils.h" 33#include "macros_and_utils.h"
33#include "universe.h"
34 34
35// crc64/we of string "UNIVERSE_REGKEY" generated at https://www.nitrxgen.net/hashgen/ 35// crc64/we of string "UNIVERSE_REGKEY" generated at https://www.nitrxgen.net/hashgen/
36static void* const UNIVERSE_REGKEY = ((void*)0x9f877b2cf078f17f); 36static void* const UNIVERSE_REGKEY = ((void*)0x9f877b2cf078f17f);
37 37
38// ################################################################################################ 38// ################################################################################################
39 39
40struct s_Universe* universe_create( lua_State* L) 40Universe* universe_create( lua_State* L)
41{ 41{
42 struct s_Universe* U = (struct s_Universe*) lua_newuserdata( L, sizeof(struct s_Universe)); // universe 42 Universe* U = (Universe*) lua_newuserdata( L, sizeof(Universe)); // universe
43 memset( U, 0, sizeof( struct s_Universe)); 43 memset( U, 0, sizeof( Universe));
44 lua_pushlightuserdata( L, UNIVERSE_REGKEY); // universe UNIVERSE_REGKEY 44 lua_pushlightuserdata( L, UNIVERSE_REGKEY); // universe UNIVERSE_REGKEY
45 lua_pushvalue( L, -2); // universe UNIVERSE_REGKEY universe 45 lua_pushvalue( L, -2); // universe UNIVERSE_REGKEY universe
46 lua_rawset( L, LUA_REGISTRYINDEX); // universe 46 lua_rawset( L, LUA_REGISTRYINDEX); // universe
@@ -49,7 +49,7 @@ struct s_Universe* universe_create( lua_State* L)
49 49
50// ################################################################################################ 50// ################################################################################################
51 51
52void universe_store( lua_State* L, struct s_Universe* U) 52void universe_store( lua_State* L, Universe* U)
53{ 53{
54 STACK_CHECK( L); 54 STACK_CHECK( L);
55 lua_pushlightuserdata( L, UNIVERSE_REGKEY); 55 lua_pushlightuserdata( L, UNIVERSE_REGKEY);
@@ -60,9 +60,9 @@ void universe_store( lua_State* L, struct s_Universe* U)
60 60
61// ################################################################################################ 61// ################################################################################################
62 62
63struct s_Universe* universe_get( lua_State* L) 63Universe* universe_get( lua_State* L)
64{ 64{
65 struct s_Universe* universe; 65 Universe* universe;
66 STACK_GROW( L, 2); 66 STACK_GROW( L, 2);
67 STACK_CHECK( L); 67 STACK_CHECK( L);
68 lua_pushlightuserdata( L, UNIVERSE_REGKEY); 68 lua_pushlightuserdata( L, UNIVERSE_REGKEY);