diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-30 11:00:14 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-30 11:00:14 -0300 |
commit | 34ac039fb84e3c12fb8c96c9c99c34224c09872b (patch) | |
tree | a859f6338c6c851088a67b129765de662ed6f223 /lvm.h | |
parent | 1aa526263405fb4906eafab3011b13de4e5daf73 (diff) | |
download | lua-34ac039fb84e3c12fb8c96c9c99c34224c09872b.tar.gz lua-34ac039fb84e3c12fb8c96c9c99c34224c09872b.tar.bz2 lua-34ac039fb84e3c12fb8c96c9c99c34224c09872b.zip |
new macro 'cvt2str' to better control whether numbers are convertible
to strings
Diffstat (limited to 'lvm.h')
-rw-r--r-- | lvm.h | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.h,v 2.30 2014/05/12 21:22:05 roberto Exp roberto $ | 2 | ** $Id: lvm.h,v 2.31 2014/05/26 17:10:22 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 | */ |
@@ -24,12 +24,18 @@ | |||
24 | #define luaV_rawequalobj(t1,t2) luaV_equalobj(NULL,t1,t2) | 24 | #define luaV_rawequalobj(t1,t2) luaV_equalobj(NULL,t1,t2) |
25 | 25 | ||
26 | 26 | ||
27 | #if !defined(LUA_NOCVTN2S) | ||
28 | #define cvt2str(o) ttisnumber(o) | ||
29 | #else | ||
30 | #define cvt2str(o) 0 /* no convertion from numbers to strings */ | ||
31 | #endif | ||
32 | |||
33 | |||
27 | LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2); | 34 | LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2); |
28 | LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); | 35 | LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); |
29 | LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r); | 36 | LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r); |
30 | LUAI_FUNC int luaV_tonumber_ (const TValue *obj, lua_Number *n); | 37 | LUAI_FUNC int luaV_tonumber_ (const TValue *obj, lua_Number *n); |
31 | LUAI_FUNC int luaV_tointeger_ (const TValue *obj, lua_Integer *p); | 38 | LUAI_FUNC int luaV_tointeger_ (const TValue *obj, lua_Integer *p); |
32 | LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); | ||
33 | LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, | 39 | LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, |
34 | StkId val); | 40 | StkId val); |
35 | LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, | 41 | LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, |