From b44ccd426339a9eb0da83633d4b71a23dac29762 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 7 Jun 2011 21:28:31 +0200 Subject: [PATCH] Fix compiler warning. --- src/lj_vmmath.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lj_vmmath.c b/src/lj_vmmath.c index 970bb5ad..8ae8863b 100644 --- a/src/lj_vmmath.c +++ b/src/lj_vmmath.c @@ -44,11 +44,11 @@ int32_t LJ_FASTCALL lj_vm_modi(int32_t a, int32_t b) { uint32_t y, ua, ub; lua_assert(b != 0); /* This must be checked before using this function. */ - ua = a < 0 ? -(uint32_t)a : (uint32_t)a; - ub = b < 0 ? -(uint32_t)b : (uint32_t)b; + ua = a < 0 ? (uint32_t)-a : (uint32_t)a; + ub = b < 0 ? (uint32_t)-b : (uint32_t)b; y = ua % 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; } #endif