diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-07-26 00:21:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-07-26 00:21:24 +0300 |
commit | cbc375df8f579bfe25eb5c47472459745f3836f3 (patch) | |
tree | 58a1ef99056639441ab2db16135c619db1afa77d /src | |
parent | 47ae9763163585a913a31a33936004eef48ebf6a (diff) | |
download | manaplus-cbc375df8f579bfe25eb5c47472459745f3836f3.tar.gz manaplus-cbc375df8f579bfe25eb5c47472459745f3836f3.tar.bz2 manaplus-cbc375df8f579bfe25eb5c47472459745f3836f3.tar.xz manaplus-cbc375df8f579bfe25eb5c47472459745f3836f3.zip |
Use uint8_t for array items in square_roots.
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/mathutils.h | 4 |
1 files 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<int>(square_roots[n]); return sqrt(n); } |