warnings from Visual C++

This commit is contained in:
Roberto Ierusalimschy 1999-10-19 11:33:22 -02:00
parent 8e7451512f
commit 910836fb53
7 changed files with 15 additions and 16 deletions

View File

@ -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");
}
}

View File

@ -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));
}
/* }====================================================== */

4
llex.c
View File

@ -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 */
}
}

4
lmem.c
View File

@ -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;i<MARKSIZE;i++)
*(newblock+HEADER+size+i) = MARK+i;
*(newblock+HEADER+size+i) = (char)(MARK+i);
return newblock+HEADER;
}
}

View File

@ -1,5 +1,5 @@
/*
** $Id: lobject.h,v 1.32 1999/10/11 16:13:11 roberto Exp roberto $
** $Id: lobject.h,v 1.33 1999/10/14 19:13:31 roberto Exp roberto $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
@ -170,7 +170,7 @@ typedef struct node {
typedef struct Hash {
int htag;
Node *node;
unsigned int size;
int size;
Node *firstfree; /* this position is free; all positions after it are full */
struct Hash *next;
int marked;

View File

@ -1,5 +1,5 @@
/*
** $Id: lstring.c,v 1.23 1999/10/11 16:13:11 roberto Exp roberto $
** $Id: lstring.c,v 1.24 1999/10/14 19:13:31 roberto Exp roberto $
** String table (keeps all strings handled by Lua)
** See Copyright Notice in lua.h
*/
@ -146,7 +146,7 @@ static TaggedString *insert_s (const char *str, long l,
static TaggedString *insert_u (void *buff, int tag, stringtable *tb) {
unsigned long h = (unsigned long)buff;
unsigned long h = (IntPoint)buff;
int h1 = h%tb->size;
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]);
}

View File

@ -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];
}