mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix compiler warning.
This commit is contained in:
parent
a0840d2695
commit
b44ccd4263
@ -44,11 +44,11 @@ int32_t LJ_FASTCALL lj_vm_modi(int32_t a, int32_t b)
|
|||||||
{
|
{
|
||||||
uint32_t y, ua, ub;
|
uint32_t y, ua, ub;
|
||||||
lua_assert(b != 0); /* This must be checked before using this function. */
|
lua_assert(b != 0); /* This must be checked before using this function. */
|
||||||
ua = a < 0 ? -(uint32_t)a : (uint32_t)a;
|
ua = a < 0 ? (uint32_t)-a : (uint32_t)a;
|
||||||
ub = b < 0 ? -(uint32_t)b : (uint32_t)b;
|
ub = b < 0 ? (uint32_t)-b : (uint32_t)b;
|
||||||
y = ua % ub;
|
y = ua % ub;
|
||||||
if (y != 0 && (a^b) < 0) y = y - ub;
|
if (y != 0 && (a^b) < 0) y = y - ub;
|
||||||
if (((int32_t)y^b) < 0) y = -y;
|
if (((int32_t)y^b) < 0) y = (uint32_t)-(int32_t)y;
|
||||||
return (int32_t)y;
|
return (int32_t)y;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user