diff options
Diffstat (limited to 'apps/plugins/lua/lobject.h')
-rw-r--r-- | apps/plugins/lua/lobject.h | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/apps/plugins/lua/lobject.h b/apps/plugins/lua/lobject.h index 26d2a81b49..028ff0355b 100644 --- a/apps/plugins/lua/lobject.h +++ b/apps/plugins/lua/lobject.h | |||
@@ -117,42 +117,48 @@ typedef struct lua_TValue { | |||
117 | #define setnilvalue(obj) ((obj)->tt=LUA_TNIL) | 117 | #define setnilvalue(obj) ((obj)->tt=LUA_TNIL) |
118 | 118 | ||
119 | #define setnvalue(obj,x) \ | 119 | #define setnvalue(obj,x) \ |
120 | { TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; } | 120 | { lua_Number i_x = (x); TValue *i_o=(obj); i_o->value.n=i_x; i_o->tt=LUA_TNUMBER; } |
121 | 121 | ||
122 | #define setpvalue(obj,x) \ | 122 | #define setpvalue(obj,x) \ |
123 | { TValue *i_o=(obj); i_o->value.p=(x); i_o->tt=LUA_TLIGHTUSERDATA; } | 123 | { void *i_x = (x); TValue *i_o=(obj); i_o->value.p=i_x; i_o->tt=LUA_TLIGHTUSERDATA; } |
124 | 124 | ||
125 | #define setbvalue(obj,x) \ | 125 | #define setbvalue(obj,x) \ |
126 | { TValue *i_o=(obj); i_o->value.b=(x); i_o->tt=LUA_TBOOLEAN; } | 126 | { int i_x = (x); TValue *i_o=(obj); i_o->value.b=i_x; i_o->tt=LUA_TBOOLEAN; } |
127 | 127 | ||
128 | #define setsvalue(L,obj,x) \ | 128 | #define setsvalue(L,obj,x) \ |
129 | { TValue *i_o=(obj); \ | 129 | { GCObject *i_x = cast(GCObject *, (x)); \ |
130 | i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TSTRING; \ | 130 | TValue *i_o=(obj); \ |
131 | i_o->value.gc=i_x; i_o->tt=LUA_TSTRING; \ | ||
131 | checkliveness(G(L),i_o); } | 132 | checkliveness(G(L),i_o); } |
132 | 133 | ||
133 | #define setuvalue(L,obj,x) \ | 134 | #define setuvalue(L,obj,x) \ |
134 | { TValue *i_o=(obj); \ | 135 | { GCObject *i_x = cast(GCObject *, (x)); \ |
135 | i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TUSERDATA; \ | 136 | TValue *i_o=(obj); \ |
137 | i_o->value.gc=i_x; i_o->tt=LUA_TUSERDATA; \ | ||
136 | checkliveness(G(L),i_o); } | 138 | checkliveness(G(L),i_o); } |
137 | 139 | ||
138 | #define setthvalue(L,obj,x) \ | 140 | #define setthvalue(L,obj,x) \ |
139 | { TValue *i_o=(obj); \ | 141 | { GCObject *i_x = cast(GCObject *, (x)); \ |
140 | i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTHREAD; \ | 142 | TValue *i_o=(obj); \ |
143 | i_o->value.gc=i_x; i_o->tt=LUA_TTHREAD; \ | ||
141 | checkliveness(G(L),i_o); } | 144 | checkliveness(G(L),i_o); } |
142 | 145 | ||
143 | #define setclvalue(L,obj,x) \ | 146 | #define setclvalue(L,obj,x) \ |
144 | { TValue *i_o=(obj); \ | 147 | { GCObject *i_x = cast(GCObject *, (x)); \ |
145 | i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TFUNCTION; \ | 148 | TValue *i_o=(obj); \ |
149 | i_o->value.gc=i_x; i_o->tt=LUA_TFUNCTION; \ | ||
146 | checkliveness(G(L),i_o); } | 150 | checkliveness(G(L),i_o); } |
147 | 151 | ||
148 | #define sethvalue(L,obj,x) \ | 152 | #define sethvalue(L,obj,x) \ |
149 | { TValue *i_o=(obj); \ | 153 | { GCObject *i_x = cast(GCObject *, (x)); \ |
150 | i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTABLE; \ | 154 | TValue *i_o=(obj); \ |
155 | i_o->value.gc=i_x; i_o->tt=LUA_TTABLE; \ | ||
151 | checkliveness(G(L),i_o); } | 156 | checkliveness(G(L),i_o); } |
152 | 157 | ||
153 | #define setptvalue(L,obj,x) \ | 158 | #define setptvalue(L,obj,x) \ |
154 | { TValue *i_o=(obj); \ | 159 | { GCObject *i_x = cast(GCObject *, (x)); \ |
155 | i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TPROTO; \ | 160 | TValue *i_o=(obj); \ |
161 | i_o->value.gc=i_x; i_o->tt=LUA_TPROTO; \ | ||
156 | checkliveness(G(L),i_o); } | 162 | checkliveness(G(L),i_o); } |
157 | 163 | ||
158 | 164 | ||