diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-04-29 14:12:50 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-04-29 14:12:50 -0300 |
| commit | 88bf2f83c035e612db103d7138a8312c455e4c88 (patch) | |
| tree | e11d49feacbe6c78d5f07d621878852590813915 /lvm.h | |
| parent | 8fff05f6d00802fa47614d681f1c7a17694856e8 (diff) | |
| download | lua-88bf2f83c035e612db103d7138a8312c455e4c88.tar.gz lua-88bf2f83c035e612db103d7138a8312c455e4c88.tar.bz2 lua-88bf2f83c035e612db103d7138a8312c455e4c88.zip | |
new function 'tointeger' + 'luaV_arith' replaced by 'luaT_trybinTM'
Diffstat (limited to 'lvm.h')
| -rw-r--r-- | lvm.h | 9 |
1 files changed, 6 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.h,v 2.20 2013/04/25 19:12:41 roberto Exp roberto $ | 2 | ** $Id: lvm.h,v 2.21 2013/04/26 16:03:50 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 | */ |
| @@ -18,6 +18,9 @@ | |||
| 18 | #define tonumber(o,n) \ | 18 | #define tonumber(o,n) \ |
| 19 | (ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n)) | 19 | (ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n)) |
| 20 | 20 | ||
| 21 | #define tointeger(o,i) \ | ||
| 22 | (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointeger_(o,i)) | ||
| 23 | |||
| 21 | 24 | ||
| 22 | #define luaV_rawequalobj(t1,t2) luaV_equalobj(NULL,t1,t2) | 25 | #define luaV_rawequalobj(t1,t2) luaV_equalobj(NULL,t1,t2) |
| 23 | 26 | ||
| @@ -26,6 +29,8 @@ LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2); | |||
| 26 | LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); | 29 | LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); |
| 27 | LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r); | 30 | LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r); |
| 28 | LUAI_FUNC int luaV_tonumber_ (const TValue *obj, lua_Number *n); | 31 | LUAI_FUNC int luaV_tonumber_ (const TValue *obj, lua_Number *n); |
| 32 | LUAI_FUNC int luaV_tointeger_ (const TValue *obj, lua_Integer *p); | ||
| 33 | LUAI_FUNC int luaV_numtointeger (lua_Number n, lua_Integer *p); | ||
| 29 | LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); | 34 | LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); |
| 30 | LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, | 35 | LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, |
| 31 | StkId val); | 36 | StkId val); |
| @@ -37,8 +42,6 @@ LUAI_FUNC void luaV_concat (lua_State *L, int total); | |||
| 37 | LUAI_FUNC lua_Integer luaV_div (lua_State *L, lua_Integer x, lua_Integer y); | 42 | LUAI_FUNC lua_Integer luaV_div (lua_State *L, lua_Integer x, lua_Integer y); |
| 38 | LUAI_FUNC lua_Integer luaV_mod (lua_State *L, lua_Integer x, lua_Integer y); | 43 | LUAI_FUNC lua_Integer luaV_mod (lua_State *L, lua_Integer x, lua_Integer y); |
| 39 | LUAI_FUNC lua_Integer luaV_pow (lua_Integer x, lua_Integer y); | 44 | LUAI_FUNC lua_Integer luaV_pow (lua_Integer x, lua_Integer y); |
| 40 | LUAI_FUNC void luaV_arith (lua_State *L, StkId ra, const TValue *rb, | ||
| 41 | const TValue *rc, TMS op); | ||
| 42 | LUAI_FUNC void luaV_objlen (lua_State *L, StkId ra, const TValue *rb); | 45 | LUAI_FUNC void luaV_objlen (lua_State *L, StkId ra, const TValue *rb); |
| 43 | 46 | ||
| 44 | #endif | 47 | #endif |
