From 76707e1d2f3a33bc5dabf367318ccd76ce242b6a Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 12 Jul 2021 11:03:12 +0100 Subject: Add sanity casts for 32/64 bit correctness --- src/common.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/common.cpp') diff --git a/src/common.cpp b/src/common.cpp index b0b1c3353..211fd4be4 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -341,7 +341,7 @@ bool sub_overflow_u64(u64 x, u64 y, u64 *result) { } void mul_overflow_u64(u64 x, u64 y, u64 *lo, u64 *hi) { -#if defined(GB_COMPILER_MSVC) +#if defined(GB_COMPILER_MSVC) && defined(GB_ARCH_64_BIT) *lo = _umul128(x, y, hi); #else // URL(bill): https://stackoverflow.com/questions/25095741/how-can-i-multiply-64-bit-operands-and-get-128-bit-result-portably#25096197 @@ -697,9 +697,9 @@ isize next_pow2_isize(isize n) { n |= n >> 4; n |= n >> 8; n |= n >> 16; - if (gb_size_of(isize) == 8) { + #if defined(GB_ARCH_64_BIT) n |= n >> 32; - } + #endif n++; return n; } -- cgit v1.2.3