lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 910836fb53cb80e93de666526714bc51f2c63510
parent 8e7451512f01a89b4230be65cf086f7c1d41d2e2
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Tue, 19 Oct 1999 11:33:00 -0200

warnings from Visual C++

Diffstat:
Mlbuiltin.c | 4++--
Mliolib.c | 5++---
Mllex.c | 4++--
Mlmem.c | 4++--
Mlobject.h | 4++--
Mlstring.c | 6+++---
Mltable.c | 4++--
7 files changed, 15 insertions(+), 16 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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; } } diff --git a/lobject.h b/lobject.h @@ -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; diff --git a/lstring.c b/lstring.c @@ -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]); } diff --git 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]; }