]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Avoid compiler warnings.
authorMike Pall <mike>
Mon, 6 Dec 2010 02:07:10 +0000 (03:07 +0100)
committerMike Pall <mike>
Mon, 6 Dec 2010 02:07:10 +0000 (03:07 +0100)
src/lj_ir.c
src/lj_opt_fold.c

index fca83904fcbf1f2a1d8e9d1fc11be88780bca3e4..e936476231119ae7a164beb654cddd8a71f562bd 100644 (file)
@@ -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;
   }
 }
index 3476235e903c24a561a169a295a3f1debf9c16cb..22d211e1ff1a8af90a7cf355243d24b8755cf69e 100644 (file)
@@ -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;
 }