diff options
Diffstat (limited to 'lvm.h')
| -rw-r--r-- | lvm.h | 9 |
1 files changed, 8 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.h,v 2.45 2017/06/29 15:06:44 roberto Exp roberto $ | 2 | ** $Id: lvm.h,v 2.46 2017/07/07 16:34:32 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 | */ |
| @@ -53,6 +53,12 @@ | |||
| 53 | (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointeger(o,i,LUA_FLOORN2I)) | 53 | (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointeger(o,i,LUA_FLOORN2I)) |
| 54 | 54 | ||
| 55 | 55 | ||
| 56 | /* convert an object to an integer (without string coercion) */ | ||
| 57 | #define tointegerns(o,i) \ | ||
| 58 | (ttisinteger(o) ? (*(i) = ivalue(o), 1) \ | ||
| 59 | : luaV_flttointeger(o,i,LUA_FLOORN2I)) | ||
| 60 | |||
| 61 | |||
| 56 | #define intop(op,v1,v2) l_castU2S(l_castS2U(v1) op l_castS2U(v2)) | 62 | #define intop(op,v1,v2) l_castU2S(l_castS2U(v1) op l_castS2U(v2)) |
| 57 | 63 | ||
| 58 | #define luaV_rawequalobj(t1,t2) luaV_equalobj(NULL,t1,t2) | 64 | #define luaV_rawequalobj(t1,t2) luaV_equalobj(NULL,t1,t2) |
| @@ -100,6 +106,7 @@ LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); | |||
| 100 | LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r); | 106 | LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r); |
| 101 | LUAI_FUNC int luaV_tonumber_ (const TValue *obj, lua_Number *n); | 107 | LUAI_FUNC int luaV_tonumber_ (const TValue *obj, lua_Number *n); |
| 102 | LUAI_FUNC int luaV_tointeger (const TValue *obj, lua_Integer *p, int mode); | 108 | LUAI_FUNC int luaV_tointeger (const TValue *obj, lua_Integer *p, int mode); |
| 109 | LUAI_FUNC int luaV_flttointeger (const TValue *obj, lua_Integer *p, int mode); | ||
| 103 | LUAI_FUNC void luaV_finishget (lua_State *L, const TValue *t, TValue *key, | 110 | LUAI_FUNC void luaV_finishget (lua_State *L, const TValue *t, TValue *key, |
| 104 | StkId val, const TValue *slot); | 111 | StkId val, const TValue *slot); |
| 105 | LUAI_FUNC void luaV_finishset (lua_State *L, const TValue *t, TValue *key, | 112 | LUAI_FUNC void luaV_finishset (lua_State *L, const TValue *t, TValue *key, |
