warnings from other compilers

This commit is contained in:
Roberto Ierusalimschy 2002-06-06 15:17:33 -03:00
parent 65d66ba275
commit 000d081fd0
5 changed files with 12 additions and 17 deletions

View File

@ -1,5 +1,5 @@
/* /*
** $Id: ldebug.c,v 1.116 2002/05/15 18:57:44 roberto Exp roberto $ ** $Id: ldebug.c,v 1.117 2002/05/16 18:39:46 roberto Exp roberto $
** Debug Interface ** Debug Interface
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -434,12 +434,10 @@ static const char *getobjname (lua_State *L, CallInfo *ci, int stackpos,
case OP_GETTABLE: { case OP_GETTABLE: {
*name = kname(p, GETARG_C(i)); *name = kname(p, GETARG_C(i));
return "field"; return "field";
break;
} }
case OP_SELF: { case OP_SELF: {
*name = kname(p, GETARG_C(i)); *name = kname(p, GETARG_C(i));
return "method"; return "method";
break;
} }
default: break; default: break;
} }
@ -475,11 +473,10 @@ static int isinstack (CallInfo *ci, const TObject *o) {
void luaG_typeerror (lua_State *L, const TObject *o, const char *op) { void luaG_typeerror (lua_State *L, const TObject *o, const char *op) {
const char *name; const char *name = NULL;
const char *t = luaT_typenames[ttype(o)]; const char *t = luaT_typenames[ttype(o)];
const char *kind = NULL; const char *kind = (isinstack(L->ci, o)) ?
if (isinstack(L->ci, o)) getobjname(L, L->ci, o - L->ci->base, &name) : NULL;
kind = getobjname(L, L->ci, o - L->ci->base, &name);
if (kind) if (kind)
luaG_runerror(L, "attempt to %s %s `%s' (a %s value)", luaG_runerror(L, "attempt to %s %s `%s' (a %s value)",
op, kind, name, t); op, kind, name, t);

View File

@ -1,5 +1,5 @@
/* /*
** $Id: liolib.c,v 2.8 2002/06/05 17:42:03 roberto Exp roberto $ ** $Id: liolib.c,v 2.9 2002/06/06 12:43:08 roberto Exp roberto $
** Standard I/O (and system) library ** Standard I/O (and system) library
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -281,7 +281,6 @@ static int g_read (lua_State *L, FILE *f, int first) {
break; break;
case 'w': /* word */ case 'w': /* word */
return luaL_verror(L, "obsolete option `*w'"); return luaL_verror(L, "obsolete option `*w'");
break;
default: default:
return luaL_argerror(L, n, "invalid format"); return luaL_argerror(L, n, "invalid format");
} }

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lopcodes.h,v 1.96 2002/05/06 15:51:41 roberto Exp roberto $ ** $Id: lopcodes.h,v 1.97 2002/05/13 13:09:00 roberto Exp roberto $
** Opcodes for Lua virtual machine ** Opcodes for Lua virtual machine
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -216,10 +216,9 @@ extern const lu_byte luaP_opmodes[NUM_OPCODES];
#define testOpMode(m, b) (luaP_opmodes[m] & (1 << (b))) #define testOpMode(m, b) (luaP_opmodes[m] & (1 << (b)))
/* #ifdef LUA_OPNAMES
** opcode names (only included when compiled with LUA_OPNAMES) extern const char *const luaP_opnames[]; /* opcode names */
*/ #endif
extern const char *const luaP_opnames[];

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lstate.c,v 1.94 2002/05/08 17:34:23 roberto Exp roberto $ ** $Id: lstate.c,v 1.95 2002/06/03 14:09:57 roberto Exp roberto $
** Global State ** Global State
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -28,6 +28,7 @@ static void close_state (lua_State *L);
** call `lua_setpanicf' ** call `lua_setpanicf'
*/ */
static int default_panic (lua_State *L) { static int default_panic (lua_State *L) {
UNUSED(L);
return 0; return 0;
} }

3
lvm.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lvm.c,v 1.234 2002/06/03 14:08:43 roberto Exp roberto $ ** $Id: lvm.c,v 1.235 2002/06/05 12:34:19 roberto Exp roberto $
** Lua virtual machine ** Lua virtual machine
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -531,7 +531,6 @@ StkId luaV_execute (lua_State *L) {
if (nresults >= 0) L->top = L->ci->top; if (nresults >= 0) L->top = L->ci->top;
goto retentry; goto retentry;
} }
break;
} }
case OP_FORLOOP: { case OP_FORLOOP: {
lua_Number step, index, limit; lua_Number step, index, limit;