From 28b8b3a91a61f80424563d30c0e5813754503b7a Mon Sep 17 00:00:00 2001 From: Seth Morabito Date: Tue, 8 Sep 2020 06:28:37 -0700 Subject: [PATCH] 3b2: Fix clang warnings Explicitly cast booleans to t_uint64 before doing logical negation. --- 3B2/3b2_400_mau.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/3B2/3b2_400_mau.c b/3B2/3b2_400_mau.c index 85dcedc4..9c22ee61 100644 --- a/3B2/3b2_400_mau.c +++ b/3B2/3b2_400_mau.c @@ -944,7 +944,8 @@ static uint32 round_pack_int(t_bool sign, t_uint64 frac, RM rounding_mode) round_bits = frac & 0x7f; frac = (frac + round_increment) >> 7; - frac &= ~(((round_bits ^ 0x40) == 0) & (rounding_mode == ROUND_NEAREST)); + frac &= ~((t_uint64)((round_bits ^ 0x40) == 0) & + (t_uint64)(rounding_mode == ROUND_NEAREST)); result = (int32)frac; @@ -999,7 +1000,8 @@ static t_int64 round_pack_int64(t_bool sign, mau_exc(MAU_ASR_OS, MAU_ASR_OM); return sign ? 0x8000000000000000ull : 0x7fffffffffffffffull; } - abs_0 &= ~(((t_uint64)(abs_1 << 1) == 0) & (rounding_mode == ROUND_NEAREST)); + abs_0 &= ~((t_uint64)((abs_1 << 1) == 0) & + (t_uint64)(rounding_mode == ROUND_NEAREST)); } z = abs_0; @@ -1076,7 +1078,8 @@ static SFP round_pack_sfp(t_bool sign, int16 exp, uint32 frac, RM rounding_mode) } frac = (frac + round_increment) >> 7; - frac &= ~(((round_bits ^ 0x40) == 0) & (rounding_mode == ROUND_NEAREST)); + frac &= ~((t_uint64)((round_bits ^ 0x40) == 0) & + (t_uint64)(rounding_mode == ROUND_NEAREST)); if (frac == 0) { exp = 0; }