diff options
| author | gingerBill <bill@gingerbill.org> | 2021-07-12 11:03:12 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-07-12 11:03:12 +0100 |
| commit | 76707e1d2f3a33bc5dabf367318ccd76ce242b6a (patch) | |
| tree | f8858e15dba0312f85e0b25f7be12a97fd420c9b /src/common.cpp | |
| parent | ff2e5c3efe931e6a088c2368b0ce5d5c21f03c65 (diff) | |
Add sanity casts for 32/64 bit correctness
Diffstat (limited to 'src/common.cpp')
| -rw-r--r-- | src/common.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |