diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-12-04 16:33:40 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-12-04 16:33:40 -0200 |
commit | 4894c2796277b47b0ffc8983e8231d2cc95ee09b (patch) | |
tree | dc702c79716a42f22301bc5b9b5798a28173f7c2 /lapi.c | |
parent | 10ac68c648e0e1d23fe5485bc711df8fc71b6ae3 (diff) | |
download | lua-4894c2796277b47b0ffc8983e8231d2cc95ee09b.tar.gz lua-4894c2796277b47b0ffc8983e8231d2cc95ee09b.tar.bz2 lua-4894c2796277b47b0ffc8983e8231d2cc95ee09b.zip |
lua_Number defined in lua.h (1st version)
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.110 2000/10/30 12:50:09 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.111 2000/11/24 17:39:56 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 | */ |
@@ -154,7 +154,7 @@ LUA_API int lua_lessthan (lua_State *L, int index1, int index2) { | |||
154 | 154 | ||
155 | 155 | ||
156 | 156 | ||
157 | LUA_API double lua_tonumber (lua_State *L, int index) { | 157 | LUA_API lua_Number lua_tonumber (lua_State *L, int index) { |
158 | StkId o = luaA_indexAcceptable(L, index); | 158 | StkId o = luaA_indexAcceptable(L, index); |
159 | return (o == NULL || tonumber(o)) ? 0 : nvalue(o); | 159 | return (o == NULL || tonumber(o)) ? 0 : nvalue(o); |
160 | } | 160 | } |
@@ -205,7 +205,7 @@ LUA_API void lua_pushnil (lua_State *L) { | |||
205 | } | 205 | } |
206 | 206 | ||
207 | 207 | ||
208 | LUA_API void lua_pushnumber (lua_State *L, double n) { | 208 | LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { |
209 | nvalue(L->top) = n; | 209 | nvalue(L->top) = n; |
210 | ttype(L->top) = LUA_TNUMBER; | 210 | ttype(L->top) = LUA_TNUMBER; |
211 | api_incr_top(L); | 211 | api_incr_top(L); |
@@ -461,7 +461,7 @@ LUA_API int lua_getn (lua_State *L, int index) { | |||
461 | if (ttype(value) == LUA_TNUMBER) | 461 | if (ttype(value) == LUA_TNUMBER) |
462 | return (int)nvalue(value); | 462 | return (int)nvalue(value); |
463 | else { | 463 | else { |
464 | Number max = 0; | 464 | lua_Number max = 0; |
465 | int i = h->size; | 465 | int i = h->size; |
466 | Node *n = h->node; | 466 | Node *n = h->node; |
467 | while (i--) { | 467 | while (i--) { |