diff options
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 2.103 2014/10/01 11:52:33 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.104 2014/10/25 11:50:46 roberto Exp roberto $ |
3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -154,6 +154,8 @@ typedef struct lua_TValue TValue; | |||
154 | /* Macros to access values */ | 154 | /* Macros to access values */ |
155 | #define ivalue(o) check_exp(ttisinteger(o), val_(o).i) | 155 | #define ivalue(o) check_exp(ttisinteger(o), val_(o).i) |
156 | #define fltvalue(o) check_exp(ttisfloat(o), val_(o).n) | 156 | #define fltvalue(o) check_exp(ttisfloat(o), val_(o).n) |
157 | #define nvalue(o) check_exp(ttisnumber(o), \ | ||
158 | (ttisinteger(o) ? cast_num(ivalue(o)) : fltvalue(o))) | ||
157 | #define gcvalue(o) check_exp(iscollectable(o), val_(o).gc) | 159 | #define gcvalue(o) check_exp(iscollectable(o), val_(o).gc) |
158 | #define pvalue(o) check_exp(ttislightuserdata(o), val_(o).p) | 160 | #define pvalue(o) check_exp(ttislightuserdata(o), val_(o).p) |
159 | #define tsvalue(o) check_exp(ttisstring(o), gco2ts(val_(o).gc)) | 161 | #define tsvalue(o) check_exp(ttisstring(o), gco2ts(val_(o).gc)) |