浏览代码

Fixed warnings from Keil compiler

Roberto Ierusalimschy 5 年之前
父节点
当前提交
c12983cf8a
共有 2 个文件被更改,包括 4 次插入7 次删除
  1. 1 1
      lcode.c
  2. 3 6
      lvm.c

+ 1 - 1
lcode.c

@@ -110,7 +110,7 @@ int luaK_exp2const (FuncState *fs, const expdesc *e, TValue *v) {
 ** optimizations).
 ** optimizations).
 */
 */
 static Instruction *previousinstruction (FuncState *fs) {
 static Instruction *previousinstruction (FuncState *fs) {
-  static const Instruction invalidinstruction = -1;
+  static const Instruction invalidinstruction = ~(Instruction)0;
   if (fs->pc > fs->lasttarget)
   if (fs->pc > fs->lasttarget)
     return &fs->f->code[fs->pc - 1];  /* previous instruction */
     return &fs->f->code[fs->pc - 1];  /* previous instruction */
   else
   else

+ 3 - 6
lvm.c

@@ -1561,12 +1561,9 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
           luaD_poscall(L, ci, cast_int(L->top - ra));
           luaD_poscall(L, ci, cast_int(L->top - ra));
           return;
           return;
         }
         }
-        else {  /* Lua tail call */
-          ci->func -= delta;
-          luaD_pretailcall(L, ci, ra, b);  /* prepare call frame */
-          goto tailcall;
-        }
-        vmbreak;
+        ci->func -= delta;
+        luaD_pretailcall(L, ci, ra, b);  /* prepare call frame */
+        goto tailcall;
       }
       }
       vmcase(OP_RETURN) {
       vmcase(OP_RETURN) {
         int n = GETARG_B(i) - 1;  /* number of results */
         int n = GETARG_B(i) - 1;  /* number of results */