diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-11-03 13:16:17 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-11-03 13:16:17 -0200 |
| commit | f1629217f136c37b58c912692b4d78f4314b4795 (patch) | |
| tree | 59ffb5310394c0001b77e3d5b8ce57f8d79e10d1 /lapi.c | |
| parent | fdd5f2f7a32535eb8f2fbafbed2d84c0e69392c0 (diff) | |
| download | lua-f1629217f136c37b58c912692b4d78f4314b4795.tar.gz lua-f1629217f136c37b58c912692b4d78f4314b4795.tar.bz2 lua-f1629217f136c37b58c912692b4d78f4314b4795.zip | |
code for conversion macros moved from luaconf to llimits + 'uint'
renamed to 'unsigned' in those macros
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 2.138 2010/10/25 19:01:37 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.139 2010/10/25 20:31:11 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -353,7 +353,7 @@ LUA_API lua_Unsigned lua_tounsignedx (lua_State *L, int idx, int *isnum) { | |||
| 353 | if (tonumber(o, &n)) { | 353 | if (tonumber(o, &n)) { |
| 354 | lua_Unsigned res; | 354 | lua_Unsigned res; |
| 355 | lua_Number num = nvalue(o); | 355 | lua_Number num = nvalue(o); |
| 356 | lua_number2uint(res, num); | 356 | lua_number2unsigned(res, num); |
| 357 | if (isnum) *isnum = 1; | 357 | if (isnum) *isnum = 1; |
| 358 | return res; | 358 | return res; |
| 359 | } | 359 | } |
| @@ -472,7 +472,7 @@ LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) { | |||
| 472 | LUA_API void lua_pushunsigned (lua_State *L, lua_Unsigned u) { | 472 | LUA_API void lua_pushunsigned (lua_State *L, lua_Unsigned u) { |
| 473 | lua_Number n; | 473 | lua_Number n; |
| 474 | lua_lock(L); | 474 | lua_lock(L); |
| 475 | n = lua_uint2number(u); | 475 | n = lua_unsigned2number(u); |
| 476 | setnvalue(L->top, n); | 476 | setnvalue(L->top, n); |
| 477 | api_incr_top(L); | 477 | api_incr_top(L); |
| 478 | lua_unlock(L); | 478 | lua_unlock(L); |
