diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-06 15:05:34 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-06 15:05:34 -0200 |
commit | 155dd01163cb67f4ee64d828337b06b7753af295 (patch) | |
tree | ea6432d5563d34a00057ce88524fc560539cb149 /lvm.h | |
parent | 599789a907fad3bda13a3eaeb41dab3338d4a451 (diff) | |
download | lua-155dd01163cb67f4ee64d828337b06b7753af295.tar.gz lua-155dd01163cb67f4ee64d828337b06b7753af295.tar.bz2 lua-155dd01163cb67f4ee64d828337b06b7753af295.zip |
avoid using 'ttype' when there is an explicit test
Diffstat (limited to 'lvm.h')
-rw-r--r-- | lvm.h | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.h,v 2.10 2009/06/17 16:17:14 roberto Exp roberto $ | 2 | ** $Id: lvm.h,v 2.11 2009/06/17 17:51:07 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -13,10 +13,9 @@ | |||
13 | #include "ltm.h" | 13 | #include "ltm.h" |
14 | 14 | ||
15 | 15 | ||
16 | #define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o))) | 16 | #define tostring(L,o) (ttisstring(o) || (luaV_tostring(L, o))) |
17 | 17 | ||
18 | #define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \ | 18 | #define tonumber(o,n) (ttisnumber(o) || (((o) = luaV_tonumber(o,n)) != NULL)) |
19 | (((o) = luaV_tonumber(o,n)) != NULL)) | ||
20 | 19 | ||
21 | #define equalobj(L,o1,o2) \ | 20 | #define equalobj(L,o1,o2) \ |
22 | (ttype(o1) == ttype(o2) && luaV_equalval_(L, o1, o2)) | 21 | (ttype(o1) == ttype(o2) && luaV_equalval_(L, o1, o2)) |