diff --git a/lbuiltin.c b/lbuiltin.c index f2821bdb..c37d4eb0 100644 --- a/lbuiltin.c +++ b/lbuiltin.c @@ -1,5 +1,5 @@ /* -** $Id: lbuiltin.c,v 1.66 1999/10/11 16:13:11 roberto Exp roberto $ +** $Id: lbuiltin.c,v 1.67 1999/10/14 19:13:31 roberto Exp roberto $ ** Built-in functions ** See Copyright Notice in lua.h */ @@ -671,7 +671,7 @@ static void extra_services (void) { lua_settagmethod(luaL_check_int(2), "gc"); break; - default: luaL_arg_check(0, 1, "invalid service"); + default: luaL_argerror(1, "invalid service"); } } diff --git a/liolib.c b/liolib.c index 62246d8b..fcf270a1 100644 --- a/liolib.c +++ b/liolib.c @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 1.46 1999/10/07 19:18:36 roberto Exp roberto $ +** $Id: liolib.c,v 1.47 1999/10/11 16:06:01 roberto Exp roberto $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -500,8 +500,7 @@ static void setloc (void) { static void io_exit (void) { - lua_Object o = lua_getparam(1); - exit(lua_isnumber(o) ? (int)lua_getnumber(o) : 1); + exit(luaL_opt_int(1, EXIT_FAILURE)); } /* }====================================================== */ diff --git a/llex.c b/llex.c index f0bcc514..c7d4e8d1 100644 --- a/llex.c +++ b/llex.c @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 1.40 1999/10/04 17:51:04 roberto Exp roberto $ +** $Id: llex.c,v 1.41 1999/10/11 16:13:42 roberto Exp roberto $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ @@ -37,7 +37,7 @@ void luaX_init (void) { int i; for (i=0; i<(sizeof(reserved)/sizeof(reserved[0])); i++) { TaggedString *ts = luaS_new(reserved[i]); - ts->marked = RESERVEDMARK+i; /* reserved word */ + ts->marked = (unsigned char)(RESERVEDMARK+i); /* reserved word */ } } diff --git a/lmem.c b/lmem.c index 26aac9c6..3f309ed4 100644 --- a/lmem.c +++ b/lmem.c @@ -1,5 +1,5 @@ /* -** $Id: lmem.c,v 1.17 1999/05/24 17:51:05 roberto Exp roberto $ +** $Id: lmem.c,v 1.18 1999/08/16 20:52:00 roberto Exp roberto $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ @@ -129,7 +129,7 @@ void *luaM_realloc (void *block, unsigned long size) { numblocks++; *(unsigned long *)newblock = size; for (i=0;isize; TaggedString *ts; for (ts = tb->hash[h1]; ts; ts = ts->nexthash) @@ -160,7 +160,7 @@ static TaggedString *insert_u (void *buff, int tag, stringtable *tb) { TaggedString *luaS_createudata (void *udata, int tag) { - int t = ((unsigned int)udata%NUM_HASHUDATA)+NUM_HASHSTR; + int t = ((IntPoint)udata%NUM_HASHUDATA)+NUM_HASHSTR; return insert_u(udata, tag, &L->string_root[t]); } diff --git a/ltable.c b/ltable.c index adb7932f..947f1813 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 1.25 1999/10/04 17:51:04 roberto Exp roberto $ +** $Id: ltable.c,v 1.26 1999/10/14 19:13:31 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -63,7 +63,7 @@ static Node *luaH_mainposition (const Hash *t, const TObject *key) { lua_error("unexpected type to index table"); h = 0; /* to avoid warnings */ } - return &t->node[h%t->size]; + return &t->node[h%(unsigned int)t->size]; }