aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-10-19 11:33:22 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-10-19 11:33:22 -0200
commit910836fb53cb80e93de666526714bc51f2c63510 (patch)
tree954e893d1ed30b8bcb1fc89b063e7b56472dd899
parent8e7451512f01a89b4230be65cf086f7c1d41d2e2 (diff)
downloadlua-910836fb53cb80e93de666526714bc51f2c63510.tar.gz
lua-910836fb53cb80e93de666526714bc51f2c63510.tar.bz2
lua-910836fb53cb80e93de666526714bc51f2c63510.zip
warnings from Visual C++
-rw-r--r--lbuiltin.c4
-rw-r--r--liolib.c5
-rw-r--r--llex.c4
-rw-r--r--lmem.c4
-rw-r--r--lobject.h4
-rw-r--r--lstring.c6
-rw-r--r--ltable.c4
7 files changed, 15 insertions, 16 deletions
diff --git a/lbuiltin.c b/lbuiltin.c
index f2821bdb..c37d4eb0 100644
--- a/lbuiltin.c
+++ b/lbuiltin.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbuiltin.c,v 1.66 1999/10/11 16:13:11 roberto Exp roberto $ 2** $Id: lbuiltin.c,v 1.67 1999/10/14 19:13:31 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*/
@@ -671,7 +671,7 @@ static void extra_services (void) {
671 lua_settagmethod(luaL_check_int(2), "gc"); 671 lua_settagmethod(luaL_check_int(2), "gc");
672 break; 672 break;
673 673
674 default: luaL_arg_check(0, 1, "invalid service"); 674 default: luaL_argerror(1, "invalid service");
675 } 675 }
676} 676}
677 677
diff --git a/liolib.c b/liolib.c
index 62246d8b..fcf270a1 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 1.46 1999/10/07 19:18:36 roberto Exp roberto $ 2** $Id: liolib.c,v 1.47 1999/10/11 16:06:01 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -500,8 +500,7 @@ static void setloc (void) {
500 500
501 501
502static void io_exit (void) { 502static void io_exit (void) {
503 lua_Object o = lua_getparam(1); 503 exit(luaL_opt_int(1, EXIT_FAILURE));
504 exit(lua_isnumber(o) ? (int)lua_getnumber(o) : 1);
505} 504}
506 505
507/* }====================================================== */ 506/* }====================================================== */
diff --git a/llex.c b/llex.c
index f0bcc514..c7d4e8d1 100644
--- a/llex.c
+++ b/llex.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.c,v 1.40 1999/10/04 17:51:04 roberto Exp roberto $ 2** $Id: llex.c,v 1.41 1999/10/11 16:13:42 roberto Exp roberto $
3** Lexical Analyzer 3** Lexical Analyzer
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -37,7 +37,7 @@ void luaX_init (void) {
37 int i; 37 int i;
38 for (i=0; i<(sizeof(reserved)/sizeof(reserved[0])); i++) { 38 for (i=0; i<(sizeof(reserved)/sizeof(reserved[0])); i++) {
39 TaggedString *ts = luaS_new(reserved[i]); 39 TaggedString *ts = luaS_new(reserved[i]);
40 ts->marked = RESERVEDMARK+i; /* reserved word */ 40 ts->marked = (unsigned char)(RESERVEDMARK+i); /* reserved word */
41 } 41 }
42} 42}
43 43
diff --git a/lmem.c b/lmem.c
index 26aac9c6..3f309ed4 100644
--- a/lmem.c
+++ b/lmem.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmem.c,v 1.17 1999/05/24 17:51:05 roberto Exp roberto $ 2** $Id: lmem.c,v 1.18 1999/08/16 20:52:00 roberto Exp roberto $
3** Interface to Memory Manager 3** Interface to Memory Manager
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -129,7 +129,7 @@ void *luaM_realloc (void *block, unsigned long size) {
129 numblocks++; 129 numblocks++;
130 *(unsigned long *)newblock = size; 130 *(unsigned long *)newblock = size;
131 for (i=0;i<MARKSIZE;i++) 131 for (i=0;i<MARKSIZE;i++)
132 *(newblock+HEADER+size+i) = MARK+i; 132 *(newblock+HEADER+size+i) = (char)(MARK+i);
133 return newblock+HEADER; 133 return newblock+HEADER;
134 } 134 }
135} 135}
diff --git a/lobject.h b/lobject.h
index 39a51b3d..181ab39e 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 1.32 1999/10/11 16:13:11 roberto Exp roberto $ 2** $Id: lobject.h,v 1.33 1999/10/14 19:13:31 roberto Exp roberto $
3** Type definitions for Lua objects 3** Type definitions for Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -170,7 +170,7 @@ typedef struct node {
170typedef struct Hash { 170typedef struct Hash {
171 int htag; 171 int htag;
172 Node *node; 172 Node *node;
173 unsigned int size; 173 int size;
174 Node *firstfree; /* this position is free; all positions after it are full */ 174 Node *firstfree; /* this position is free; all positions after it are full */
175 struct Hash *next; 175 struct Hash *next;
176 int marked; 176 int marked;
diff --git a/lstring.c b/lstring.c
index 237cb20c..6aaf6b82 100644
--- a/lstring.c
+++ b/lstring.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstring.c,v 1.23 1999/10/11 16:13:11 roberto Exp roberto $ 2** $Id: lstring.c,v 1.24 1999/10/14 19:13:31 roberto Exp roberto $
3** String table (keeps all strings handled by Lua) 3** String table (keeps all strings handled by Lua)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -146,7 +146,7 @@ static TaggedString *insert_s (const char *str, long l,
146 146
147 147
148static TaggedString *insert_u (void *buff, int tag, stringtable *tb) { 148static TaggedString *insert_u (void *buff, int tag, stringtable *tb) {
149 unsigned long h = (unsigned long)buff; 149 unsigned long h = (IntPoint)buff;
150 int h1 = h%tb->size; 150 int h1 = h%tb->size;
151 TaggedString *ts; 151 TaggedString *ts;
152 for (ts = tb->hash[h1]; ts; ts = ts->nexthash) 152 for (ts = tb->hash[h1]; ts; ts = ts->nexthash)
@@ -160,7 +160,7 @@ static TaggedString *insert_u (void *buff, int tag, stringtable *tb) {
160 160
161 161
162TaggedString *luaS_createudata (void *udata, int tag) { 162TaggedString *luaS_createudata (void *udata, int tag) {
163 int t = ((unsigned int)udata%NUM_HASHUDATA)+NUM_HASHSTR; 163 int t = ((IntPoint)udata%NUM_HASHUDATA)+NUM_HASHSTR;
164 return insert_u(udata, tag, &L->string_root[t]); 164 return insert_u(udata, tag, &L->string_root[t]);
165} 165}
166 166
diff --git a/ltable.c b/ltable.c
index adb7932f..947f1813 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 1.25 1999/10/04 17:51:04 roberto Exp roberto $ 2** $Id: ltable.c,v 1.26 1999/10/14 19:13:31 roberto Exp roberto $
3** Lua tables (hash) 3** Lua tables (hash)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -63,7 +63,7 @@ static Node *luaH_mainposition (const Hash *t, const TObject *key) {
63 lua_error("unexpected type to index table"); 63 lua_error("unexpected type to index table");
64 h = 0; /* to avoid warnings */ 64 h = 0; /* to avoid warnings */
65 } 65 }
66 return &t->node[h%t->size]; 66 return &t->node[h%(unsigned int)t->size];
67} 67}
68 68
69 69