aboutsummaryrefslogtreecommitdiff
path: root/src/macros_and_utils.h
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2022-02-07 08:56:39 +0100
committerBenoit Germain <bnt.germain@gmail.com>2022-02-07 08:56:39 +0100
commit621fb024b5f887ef9e81e2f28bf087386f5300e1 (patch)
tree3ed681e2db07a0516904b2cda4e7144c714d19e0 /src/macros_and_utils.h
parent00c84df3adc0b295ef20bc35bc8df9632e3b93e7 (diff)
downloadlanes-621fb024b5f887ef9e81e2f28bf087386f5300e1.tar.gz
lanes-621fb024b5f887ef9e81e2f28bf087386f5300e1.tar.bz2
lanes-621fb024b5f887ef9e81e2f28bf087386f5300e1.zip
Changed all indentations to all whitespaces
Tabs mess up alignment of stack contents comments, so I'm done with them.
Diffstat (limited to 'src/macros_and_utils.h')
-rw-r--r--src/macros_and_utils.h66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/macros_and_utils.h b/src/macros_and_utils.h
index dba0010..b67a7c4 100644
--- a/src/macros_and_utils.h
+++ b/src/macros_and_utils.h
@@ -40,40 +40,40 @@ extern char const* debugspew_indent;
40#define _ASSERT_L( L, cond_) if( (cond_) == 0) { (void) luaL_error( L, "ASSERT failed: %s:%d '%s'", __FILE__, __LINE__, #cond_);} 40#define _ASSERT_L( L, cond_) if( (cond_) == 0) { (void) luaL_error( L, "ASSERT failed: %s:%d '%s'", __FILE__, __LINE__, #cond_);}
41 41
42#define STACK_CHECK( L, offset_) \ 42#define STACK_CHECK( L, offset_) \
43 { \ 43 { \
44 int const L##_delta = offset_; \ 44 int const L##_delta = offset_; \
45 if( (L##_delta < 0) || (lua_gettop( L) < L##_delta)) \ 45 if( (L##_delta < 0) || (lua_gettop( L) < L##_delta)) \
46 { \ 46 { \
47 assert( FALSE); \ 47 assert( FALSE); \
48 (void) luaL_error( L, "STACK INIT ASSERT failed (%d not %d): %s:%d", lua_gettop( L), L##_delta, __FILE__, __LINE__); \ 48 (void) luaL_error( L, "STACK INIT ASSERT failed (%d not %d): %s:%d", lua_gettop( L), L##_delta, __FILE__, __LINE__); \
49 } \ 49 } \
50 int const L##_oldtop = lua_gettop( L) - L##_delta 50 int const L##_oldtop = lua_gettop( L) - L##_delta
51 51
52#define STACK_CHECK_ABS( L, offset_) \ 52#define STACK_CHECK_ABS( L, offset_) \
53 { \ 53 { \
54 int const L##_pos = offset_; \ 54 int const L##_pos = offset_; \
55 if( lua_gettop( L) < L##_pos) \ 55 if( lua_gettop( L) < L##_pos) \
56 { \ 56 { \
57 assert( FALSE); \ 57 assert( FALSE); \
58 (void) luaL_error( L, "STACK INIT ASSERT failed (%d not %d): %s:%d", lua_gettop( L), L##_pos, __FILE__, __LINE__); \ 58 (void) luaL_error( L, "STACK INIT ASSERT failed (%d not %d): %s:%d", lua_gettop( L), L##_pos, __FILE__, __LINE__); \
59 } \ 59 } \
60 int const L##_oldtop = 0 60 int const L##_oldtop = 0
61 61
62#define STACK_MID( L, change) \ 62#define STACK_MID( L, change) \
63 do if( change != LUA_MULTRET) \ 63 do if( change != LUA_MULTRET) \
64 { \ 64 { \
65 int stack_check_a = lua_gettop( L) - L##_oldtop; \ 65 int stack_check_a = lua_gettop( L) - L##_oldtop; \
66 int stack_check_b = (change); \ 66 int stack_check_b = (change); \
67 if( stack_check_a != stack_check_b) \ 67 if( stack_check_a != stack_check_b) \
68 { \ 68 { \
69 assert( FALSE); \ 69 assert( FALSE); \
70 luaL_error( L, "STACK ASSERT failed (%d not %d): %s:%d", stack_check_a, stack_check_b, __FILE__, __LINE__); \ 70 luaL_error( L, "STACK ASSERT failed (%d not %d): %s:%d", stack_check_a, stack_check_b, __FILE__, __LINE__); \
71 } \ 71 } \
72 } while( 0) 72 } while( 0)
73 73
74#define STACK_END( L, change) \ 74#define STACK_END( L, change) \
75 STACK_MID( L, change); \ 75 STACK_MID( L, change); \
76 } 76 }
77 77
78#define STACK_DUMP( L) luaG_dump( L) 78#define STACK_DUMP( L) luaG_dump( L)
79 79
@@ -86,15 +86,15 @@ extern char const* debugspew_indent;
86// non-string keyed registry access 86// non-string keyed registry access
87#define REGISTRY_SET( L, key_, value_) \ 87#define REGISTRY_SET( L, key_, value_) \
88{ \ 88{ \
89 push_unique_key( L, key_); \ 89 push_unique_key( L, key_); \
90 value_; \ 90 value_; \
91 lua_rawset( L, LUA_REGISTRYINDEX); \ 91 lua_rawset( L, LUA_REGISTRYINDEX); \
92} 92}
93 93
94#define REGISTRY_GET( L, key_) \ 94#define REGISTRY_GET( L, key_) \
95{ \ 95{ \
96 push_unique_key( L, key_); \ 96 push_unique_key( L, key_); \
97 lua_rawget( L, LUA_REGISTRYINDEX); \ 97 lua_rawget( L, LUA_REGISTRYINDEX); \
98} 98}
99 99
100#define LUAG_FUNC( func_name) int LG_##func_name( lua_State* L) 100#define LUAG_FUNC( func_name) int LG_##func_name( lua_State* L)