浏览代码

warnings from other compilers

Roberto Ierusalimschy 23 年之前
父节点
当前提交
000d081fd0
共有 5 个文件被更改,包括 12 次插入17 次删除
  1. 4 7
      ldebug.c
  2. 1 2
      liolib.c
  3. 4 5
      lopcodes.h
  4. 2 1
      lstate.c
  5. 1 2
      lvm.c

+ 4 - 7
ldebug.c

@@ -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
 ** See Copyright Notice in lua.h
 */
@@ -434,12 +434,10 @@ static const char *getobjname (lua_State *L, CallInfo *ci, int stackpos,
       case OP_GETTABLE: {
         *name = kname(p, GETARG_C(i));
         return "field";
-        break;
       }
       case OP_SELF: {
         *name = kname(p, GETARG_C(i));
         return "method";
-        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) {
-  const char *name;
+  const char *name = NULL;
   const char *t = luaT_typenames[ttype(o)];
-  const char *kind = NULL;
-  if (isinstack(L->ci, o))
-    kind = getobjname(L, L->ci, o - L->ci->base, &name);
+  const char *kind = (isinstack(L->ci, o)) ?
+                         getobjname(L, L->ci, o - L->ci->base, &name) : NULL;
   if (kind)
     luaG_runerror(L, "attempt to %s %s `%s' (a %s value)",
                 op, kind, name, t);

+ 1 - 2
liolib.c

@@ -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
 ** See Copyright Notice in lua.h
 */
@@ -281,7 +281,6 @@ static int g_read (lua_State *L, FILE *f, int first) {
             break;
           case 'w':  /* word */
             return luaL_verror(L, "obsolete option `*w'");
-            break;
           default:
             return luaL_argerror(L, n, "invalid format");
         }

+ 4 - 5
lopcodes.h

@@ -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
 ** 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)))
 
 
-/*
-** opcode names (only included when compiled with LUA_OPNAMES)
-*/
-extern const char *const luaP_opnames[];
+#ifdef LUA_OPNAMES
+extern const char *const luaP_opnames[];  /* opcode names */
+#endif
 
 
 

+ 2 - 1
lstate.c

@@ -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
 ** See Copyright Notice in lua.h
 */
@@ -28,6 +28,7 @@ static void close_state (lua_State *L);
 ** call `lua_setpanicf'
 */
 static int default_panic (lua_State *L) {
+  UNUSED(L);
   return 0;
 }
 

+ 1 - 2
lvm.c

@@ -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
 ** See Copyright Notice in lua.h
 */
@@ -531,7 +531,6 @@ StkId luaV_execute (lua_State *L) {
           if (nresults >= 0) L->top = L->ci->top;
           goto retentry;
         }
-        break;
       }
       case OP_FORLOOP: {
         lua_Number step, index, limit;