Ver Fonte

Avoid compiler warnings.

Mike Pall há 14 anos atrás
pai
commit
a850b27da9
2 ficheiros alterados com 2 adições e 2 exclusões
  1. 1 1
      src/lj_ir.c
  2. 1 1
      src/lj_opt_fold.c

+ 1 - 1
src/lj_ir.c

@@ -381,7 +381,7 @@ void lj_ir_kvalue(lua_State *L, TValue *tv, const IRIns *ir)
   case IR_KPTR: case IR_KNULL: setlightudV(tv, mref(ir->ptr, void)); break;
   case IR_KNUM: setnumV(tv, ir_knum(ir)->n); break;
   /* NYI: use FFI int64_t. */
-  case IR_KINT64: setnumV(tv, (int64_t)ir_kint64(ir)->u64); break;
+  case IR_KINT64: setnumV(tv, (lua_Number)(int64_t)ir_kint64(ir)->u64); break;
   default: lua_assert(0); break;
   }
 }

+ 1 - 1
src/lj_opt_fold.c

@@ -676,7 +676,7 @@ LJFOLDF(simplify_intsub_k64)
   if (k == 0)  /* i - 0 ==> i */
     return LEFTFOLD;
   fins->o = IR_ADD;  /* i - k ==> i + (-k) */
-  fins->op2 = (IRRef1)lj_ir_kint64(J, -k);  /* Overflow for -2^63 ok. */
+  fins->op2 = (IRRef1)lj_ir_kint64(J, (uint64_t)-(int64_t)k);
   return RETRYFOLD;
 }