From 4ea0900aece57823557e34e8b4d1a8a69c5fa9a3 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Thu, 17 Mar 2016 20:45:18 +0000 Subject: [PATCH] Fix to 16 bit parity calculation. Altered to keep code coverage tool happy. --- src/binary.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/binary.h b/src/binary.h index c1d5cbe2..81cf100c 100644 --- a/src/binary.h +++ b/src/binary.h @@ -156,14 +156,18 @@ namespace etl { STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); + T result; + if (distance > 0) { - return rotate_left(value, size_t(distance)); + result = rotate_left(value, size_t(distance)); } else { - return rotate_right(value, size_t(-distance)); + result = rotate_right(value, size_t(-distance)); } + + return result; } //*************************************************************************** @@ -440,7 +444,7 @@ namespace etl value ^= value >> 8; value ^= value >> 4; value &= 0x0F; - return (0x96 >> value) & 1; + return (0x6996 >> value) & 1; } //***************************************************************************