summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/utils/mathutils.cpp2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index bfac30d0..d0e6074a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-16 Guillaume Melquiond <guillaume.melquiong@gmail.com>
+
+ * src/utils/mathutils.cpp: Fixed miscompilation of rsqrt due to type
+ aliasing and sped up sqrt.
+
2007-04-11 Philipp Sehmisch <tmw@crushnet.org>
* src/game-server/being.cpp: Using effective attributes instead of base
diff --git a/src/utils/mathutils.cpp b/src/utils/mathutils.cpp
index 1c5e608c..6ffaffc2 100644
--- a/src/utils/mathutils.cpp
+++ b/src/utils/mathutils.cpp
@@ -45,7 +45,7 @@ float tanList[MATH_UTILS_MAX_ANGLE];
*/
float utils::math::fastInvSqrt(float x)
{
- typedef char float_is_32_bits[(sizeof(float) == 4) - 1];
+ typedef char float_must_be_32_bits[(sizeof(float) == 4) * 2 - 1];
float xhalf = 0.5f * x;
uint32_t i;
memcpy(&i, &x, 4);