Avoid compiler warnings.

This commit is contained in:
Mike Pall 2010-12-06 03:07:10 +01:00
parent e137408752
commit a850b27da9
2 changed files with 2 additions and 2 deletions

View 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_KPTR: case IR_KNULL: setlightudV(tv, mref(ir->ptr, void)); break;
case IR_KNUM: setnumV(tv, ir_knum(ir)->n); break; case IR_KNUM: setnumV(tv, ir_knum(ir)->n); break;
/* NYI: use FFI int64_t. */ /* 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; default: lua_assert(0); break;
} }
} }

View File

@ -676,7 +676,7 @@ LJFOLDF(simplify_intsub_k64)
if (k == 0) /* i - 0 ==> i */ if (k == 0) /* i - 0 ==> i */
return LEFTFOLD; return LEFTFOLD;
fins->o = IR_ADD; /* i - k ==> i + (-k) */ 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; return RETRYFOLD;
} }