From 4bcca427622eee34bd9cde98036436c5aacb69f1 Mon Sep 17 00:00:00 2001 From: truelight Date: Wed, 7 Nov 2007 22:41:50 +0000 Subject: [PATCH] (svn r11390) -Fix r11387: AB() was wrong (spotted by Rafal Rzepecki, patch by skidd13) --- src/macros.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/macros.h b/src/macros.h index 2f5a9b48f4..004e4039de 100644 --- a/src/macros.h +++ b/src/macros.h @@ -66,9 +66,8 @@ template static inline T SB(T& x, const uint8 s, const u */ template static inline T AB(T& x, const uint8 s, const uint8 n, const U i) { - const T tmp = (T)(((1U << n) - 1) << s); - x &= ~tmp; - x |= (T)((x + (i << s)) & tmp); + const T mask = (T)(((1U << n) - 1) << s); + x = (T)((x & ~mask) | ((x + (i << s)) & mask)); return x; }