From cbc375df8f579bfe25eb5c47472459745f3836f3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 26 Jul 2015 00:21:24 +0300 Subject: Use uint8_t for array items in square_roots. --- src/utils/mathutils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/mathutils.h b/src/utils/mathutils.h index 3fa7ad002..fdb919f7e 100644 --- a/src/utils/mathutils.h +++ b/src/utils/mathutils.h @@ -64,7 +64,7 @@ static const uint16_t crc_table[256] = 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 }; -static const int square_roots[1000] = +static const uint8_t square_roots[1000] = { 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, @@ -188,7 +188,7 @@ inline int powerOfTwo(const unsigned int input) inline int fastSqrtInt(const unsigned int n) { if (n < 1000) - return square_roots[n]; + return static_cast(square_roots[n]); return sqrt(n); } -- cgit v1.2.3-70-g09d2