summaryrefslogtreecommitdiff
path: root/src/utils/mathutils.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-26 00:21:24 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-26 00:21:24 +0300
commitcbc375df8f579bfe25eb5c47472459745f3836f3 (patch)
tree58a1ef99056639441ab2db16135c619db1afa77d /src/utils/mathutils.h
parent47ae9763163585a913a31a33936004eef48ebf6a (diff)
downloadmanaverse-cbc375df8f579bfe25eb5c47472459745f3836f3.tar.gz
manaverse-cbc375df8f579bfe25eb5c47472459745f3836f3.tar.bz2
manaverse-cbc375df8f579bfe25eb5c47472459745f3836f3.tar.xz
manaverse-cbc375df8f579bfe25eb5c47472459745f3836f3.zip
Use uint8_t for array items in square_roots.
Diffstat (limited to 'src/utils/mathutils.h')
-rw-r--r--src/utils/mathutils.h4
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);
}