aboutsummaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 9c711c8d..88c8db67 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.74 2002/05/16 18:39:46 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.75 2002/05/16 19:09:19 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -174,7 +174,7 @@ static int luaB_nexti (lua_State *L) {
174 else { /* `for' step */ 174 else { /* `for' step */
175 i++; /* next value */ 175 i++; /* next value */
176 lua_pushnumber(L, i); 176 lua_pushnumber(L, i);
177 lua_rawgeti(L, 1, i); 177 lua_rawgeti(L, 1, (int)i);
178 return (lua_isnil(L, -1)) ? 0 : 2; 178 return (lua_isnil(L, -1)) ? 0 : 2;
179 } 179 }
180} 180}
@@ -194,20 +194,20 @@ static int luaB_loadstring (lua_State *L) {
194 size_t l; 194 size_t l;
195 const char *s = luaL_check_lstr(L, 1, &l); 195 const char *s = luaL_check_lstr(L, 1, &l);
196 const char *chunkname = luaL_opt_string(L, 2, s); 196 const char *chunkname = luaL_opt_string(L, 2, s);
197 return passresults(L, lua_loadbuffer(L, s, l, chunkname)); 197 return passresults(L, luaL_loadbuffer(L, s, l, chunkname));
198} 198}
199 199
200 200
201static int luaB_loadfile (lua_State *L) { 201static int luaB_loadfile (lua_State *L) {
202 const char *fname = luaL_opt_string(L, 1, NULL); 202 const char *fname = luaL_opt_string(L, 1, NULL);
203 return passresults(L, lua_loadfile(L, fname)); 203 return passresults(L, luaL_loadfile(L, fname));
204} 204}
205 205
206 206
207static int luaB_assert (lua_State *L) { 207static int luaB_assert (lua_State *L) {
208 luaL_check_any(L, 1); 208 luaL_check_any(L, 1);
209 if (!lua_toboolean(L, 1)) 209 if (!lua_toboolean(L, 1))
210 return luaL_verror(L, "assertion failed! %s", luaL_opt_string(L, 2, "")); 210 return luaL_verror(L, "%s", luaL_opt_string(L, 2, "assertion failed!"));
211 lua_settop(L, 1); 211 lua_settop(L, 1);
212 return 1; 212 return 1;
213} 213}
@@ -349,7 +349,7 @@ static int luaB_require (lua_State *L) {
349 lua_settop(L, 3); /* reset stack position */ 349 lua_settop(L, 3); /* reset stack position */
350 if ((path = pushnextpath(L, path)) == NULL) break; 350 if ((path = pushnextpath(L, path)) == NULL) break;
351 pushcomposename(L); 351 pushcomposename(L);
352 status = lua_loadfile(L, lua_tostring(L, -1)); /* try to load it */ 352 status = luaL_loadfile(L, lua_tostring(L, -1)); /* try to load it */
353 } 353 }
354 } 354 }
355 switch (status) { 355 switch (status) {