diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-10-18 09:51:44 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-10-18 09:51:44 -0300 |
commit | e5cfa7a3672eecfd81fb290faac9ac60c76e7231 (patch) | |
tree | 59dc6d9f10b2361b8156db93e0528bb21097df6e /lua.h | |
parent | aae16127470f266e1852dad7ad99d72e0671addc (diff) | |
download | lua-e5cfa7a3672eecfd81fb290faac9ac60c76e7231.tar.gz lua-e5cfa7a3672eecfd81fb290faac9ac60c76e7231.tar.bz2 lua-e5cfa7a3672eecfd81fb290faac9ac60c76e7231.zip |
use of parentheses around macro parameters in call lists, to avoid
problems with comma expressions
Diffstat (limited to 'lua.h')
-rw-r--r-- | lua.h | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.192 2004/06/04 15:30:53 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.193 2004/09/15 20:39:42 roberto Exp roberto $ |
3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil | 4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil |
5 | ** http://www.lua.org mailto:info@lua.org | 5 | ** http://www.lua.org mailto:info@lua.org |
@@ -251,26 +251,26 @@ LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud); | |||
251 | 251 | ||
252 | #define lua_newtable(L) lua_createtable(L, 0, 0) | 252 | #define lua_newtable(L) lua_createtable(L, 0, 0) |
253 | 253 | ||
254 | #define lua_register(L,n,f) (lua_pushcfunction(L,f), lua_setglobal(L,n)) | 254 | #define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) |
255 | 255 | ||
256 | #define lua_pushcfunction(L,f) lua_pushcclosure(L, f, 0) | 256 | #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) |
257 | 257 | ||
258 | #define lua_strlen(L,i) lua_objsize(L,i) | 258 | #define lua_strlen(L,i) lua_objsize(L, (i)) |
259 | 259 | ||
260 | #define lua_isfunction(L,n) (lua_type(L,n) == LUA_TFUNCTION) | 260 | #define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION) |
261 | #define lua_istable(L,n) (lua_type(L,n) == LUA_TTABLE) | 261 | #define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE) |
262 | #define lua_islightuserdata(L,n) (lua_type(L,n) == LUA_TLIGHTUSERDATA) | 262 | #define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA) |
263 | #define lua_isnil(L,n) (lua_type(L,n) == LUA_TNIL) | 263 | #define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL) |
264 | #define lua_isboolean(L,n) (lua_type(L,n) == LUA_TBOOLEAN) | 264 | #define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN) |
265 | #define lua_isthread(L,n) (lua_type(L,n) == LUA_TTHREAD) | 265 | #define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD) |
266 | #define lua_isnone(L,n) (lua_type(L,n) == LUA_TNONE) | 266 | #define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE) |
267 | #define lua_isnoneornil(L, n) (lua_type(L,n) <= 0) | 267 | #define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0) |
268 | 268 | ||
269 | #define lua_pushliteral(L, s) \ | 269 | #define lua_pushliteral(L, s) \ |
270 | lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1) | 270 | lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1) |
271 | 271 | ||
272 | #define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, s) | 272 | #define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s)) |
273 | #define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, s) | 273 | #define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s)) |
274 | 274 | ||
275 | 275 | ||
276 | 276 | ||