diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-06 15:03:37 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-06 15:03:37 -0200 |
commit | 599789a907fad3bda13a3eaeb41dab3338d4a451 (patch) | |
tree | a7182fc0048c8c4fd01dee1408f0aca0ab284191 /lapi.c | |
parent | 9756f56354af72d62b4f63c85000d4ae1db6b130 (diff) | |
download | lua-599789a907fad3bda13a3eaeb41dab3338d4a451.tar.gz lua-599789a907fad3bda13a3eaeb41dab3338d4a451.tar.bz2 lua-599789a907fad3bda13a3eaeb41dab3338d4a451.zip |
better to enclose macros in 'if' bodies with brackets
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.95 2009/11/05 16:48:31 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.96 2009/11/05 17:26:00 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -287,9 +287,10 @@ LUA_API int lua_rawequal (lua_State *L, int index1, int index2) { | |||
287 | LUA_API void lua_arith (lua_State *L, int op) { | 287 | LUA_API void lua_arith (lua_State *L, int op) { |
288 | lua_lock(L); | 288 | lua_lock(L); |
289 | api_checknelems(L, 2); | 289 | api_checknelems(L, 2); |
290 | if (ttisnumber(L->top - 2) && ttisnumber(L->top - 1)) | 290 | if (ttisnumber(L->top - 2) && ttisnumber(L->top - 1)) { |
291 | changenvalue(L->top - 2, | 291 | changenvalue(L->top - 2, |
292 | luaO_arith(op, nvalue(L->top - 2), nvalue(L->top - 1))); | 292 | luaO_arith(op, nvalue(L->top - 2), nvalue(L->top - 1))); |
293 | } | ||
293 | else | 294 | else |
294 | luaV_arith(L, L->top - 2, L->top - 2, L->top - 1, op - LUA_OPADD + TM_ADD); | 295 | luaV_arith(L, L->top - 2, L->top - 2, L->top - 1, op - LUA_OPADD + TM_ADD); |
295 | L->top--; | 296 | L->top--; |