From 2a91c5f6bc1b2dd739e75a22dadbd73ce078e9cc Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Thu, 16 Jan 2020 11:40:44 +0100 Subject: [PATCH] fix misguided cppcheck fix for FixedDiv() Replace with the corresponding implementation from Chocolate Doom, to get back to the same demo compatibility as the original WinMBF. --- Source/m_fixed.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/m_fixed.h b/Source/m_fixed.h index c83ca525..9ae94556 100644 --- a/Source/m_fixed.h +++ b/Source/m_fixed.h @@ -61,7 +61,7 @@ inline static fixed_t FixedMul(fixed_t a, fixed_t b) inline static fixed_t FixedDiv(fixed_t a, fixed_t b) { - return (abs(a)>>14) >= abs(b) ? ((unsigned)(a^b)>>31) ^ D_MAXINT : + return (abs(a)>>14) >= abs(b) ? ((a^b) < 0 ? D_MININT : D_MAXINT) : (fixed_t)(((Long64) a << FRACBITS) / b); }