From a004c7b50cc28b2402e64deb3b3ca1414effd9e0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 6 Jul 2012 00:06:33 +0200 Subject: [PATCH] [0061] Use fabs instead of abs for float type. On some platforms abs has only int overload exists. Signed-off-by: stfx --- src/game/vmap/WorldModel.cpp | 6 ++---- src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/game/vmap/WorldModel.cpp b/src/game/vmap/WorldModel.cpp index 83d43724d..81e0ea325 100644 --- a/src/game/vmap/WorldModel.cpp +++ b/src/game/vmap/WorldModel.cpp @@ -28,7 +28,6 @@ template<> struct BoundsTrait static void getBounds(const VMAP::GroupModel& obj, G3D::AABox& out) { out = obj.GetBound(); } }; - namespace VMAP { bool IntersectTriangle(const MeshTriangle& tri, std::vector::const_iterator points, const G3D::Ray& ray, float& distance) @@ -42,7 +41,7 @@ namespace VMAP const Vector3 p(ray.direction().cross(e2)); const float a = e1.dot(p); - if (abs(a) < EPS) + if (fabs(a) < EPS) { // Determinant is ill-conditioned; abort early return false; @@ -508,9 +507,8 @@ namespace VMAP if (!wf) return false; - bool result = true; uint32 chunkSize, count; - result = fwrite(VMAP_MAGIC, 1, 8, wf) == 8; + bool result = fwrite(VMAP_MAGIC, 1, 8, wf) == 8; if (result && fwrite("WMOD", 1, 4, wf) != 4) result = false; chunkSize = sizeof(uint32) + sizeof(uint32); if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) result = false; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 82547e76d..6644b38a5 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "0060" + #define REVISION_NR "0061" #endif // __REVISION_NR_H__