From 5b844783ae804bafc3dac2fe9c1ab39784bab44e Mon Sep 17 00:00:00 2001 From: Egor Chesakov Date: Mon, 20 Aug 2018 13:18:08 -0700 Subject: [PATCH] Add roundUp(unsigned size, unsigned mult) and roundDn(unsigned size, unsigned mult) to 64-bit host in src/jit/jit.h --- src/jit/jit.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/jit/jit.h b/src/jit/jit.h index f09b31d..3c2ee48 100644 --- a/src/jit/jit.h +++ b/src/jit/jit.h @@ -687,6 +687,18 @@ inline size_t roundDn(size_t size, size_t mult = sizeof(size_t)) return (size) & ~(mult - 1); } +#ifdef _HOST_64BIT_ +inline unsigned int roundUp(unsigned size, unsigned mult) +{ + return (unsigned int)roundUp((size_t)size, (size_t)mult); +} + +inline unsigned int roundDn(unsigned size, unsigned mult) +{ + return (unsigned int)roundDn((size_t)size, (size_t)mult); +} +#endif // _HOST_64BIT_ + inline unsigned int unsigned_abs(int x) { return ((unsigned int)abs(x)); -- 2.7.4