diff options
-rw-r--r-- | lbuiltin.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuiltin.c,v 1.53 1999/02/22 19:13:12 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.54 1999/02/23 14:57:28 roberto Exp roberto $ |
3 | ** Built-in functions | 3 | ** Built-in functions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -147,7 +147,7 @@ static void luaB_tonumber (void) { | |||
147 | long n; | 147 | long n; |
148 | luaL_arg_check(0 <= base && base <= 36, 2, "base out of range"); | 148 | luaL_arg_check(0 <= base && base <= 36, 2, "base out of range"); |
149 | n = strtol(s, &s, base); | 149 | n = strtol(s, &s, base); |
150 | while (isspace(*s)) s++; /* skip trailing spaces */ | 150 | while (isspace((unsigned char)*s)) s++; /* skip trailing spaces */ |
151 | if (*s) lua_pushnil(); /* invalid format: return nil */ | 151 | if (*s) lua_pushnil(); /* invalid format: return nil */ |
152 | else lua_pushnumber(n); | 152 | else lua_pushnumber(n); |
153 | } | 153 | } |
@@ -190,7 +190,7 @@ static void luaB_settag (void) { | |||
190 | lua_Object o = luaL_tablearg(1); | 190 | lua_Object o = luaL_tablearg(1); |
191 | lua_pushobject(o); | 191 | lua_pushobject(o); |
192 | lua_settag(luaL_check_int(2)); | 192 | lua_settag(luaL_check_int(2)); |
193 | lua_pushobject(o); /* returns first argument */ | 193 | lua_pushobject(o); /* return first argument */ |
194 | } | 194 | } |
195 | 195 | ||
196 | static void luaB_newtag (void) { | 196 | static void luaB_newtag (void) { |
@@ -649,7 +649,7 @@ static void testC (void) { | |||
649 | case 'N' : lua_pushstring(lua_nextvar(lua_getstring(reg[getnum(s)]))); | 649 | case 'N' : lua_pushstring(lua_nextvar(lua_getstring(reg[getnum(s)]))); |
650 | break; | 650 | break; |
651 | case 'n' : { int n=getnum(s); | 651 | case 'n' : { int n=getnum(s); |
652 | n=lua_next(reg[n], lua_getnumber(reg[getnum(s)])); | 652 | n=lua_next(reg[n], (int)lua_getnumber(reg[getnum(s)])); |
653 | lua_pushnumber(n); break; | 653 | lua_pushnumber(n); break; |
654 | } | 654 | } |
655 | default: luaL_verror("unknown command in `testC': %c", *(s-1)); | 655 | default: luaL_verror("unknown command in `testC': %c", *(s-1)); |