From 1a407a6af36d288d9d82286a3db46078a9c69b7c Mon Sep 17 00:00:00 2001 From: vrld Date: Wed, 13 Mar 2013 23:09:25 +0100 Subject: [PATCH] Make non-gcc compilers happy... --- src/modules/graphics/opengl/ParticleSystem.cpp | 2 +- src/modules/math/{Math.cpp => MathModule.cpp} | 10 +++++----- src/modules/math/{Math.h => MathModule.h} | 9 +++++---- src/modules/math/wrap_Math.cpp | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) rename src/modules/math/{Math.cpp => MathModule.cpp} (98%) rename src/modules/math/{Math.h => MathModule.h} (93%) diff --git a/src/modules/graphics/opengl/ParticleSystem.cpp b/src/modules/graphics/opengl/ParticleSystem.cpp index 4ab0fdc53..963742f80 100644 --- a/src/modules/graphics/opengl/ParticleSystem.cpp +++ b/src/modules/graphics/opengl/ParticleSystem.cpp @@ -21,7 +21,7 @@ #include "ParticleSystem.h" #include "common/math.h" -#include "modules/math/Math.h" +#include "modules/math/MathModule.h" #include "OpenGL.h" #include diff --git a/src/modules/math/Math.cpp b/src/modules/math/MathModule.cpp similarity index 98% rename from src/modules/math/Math.cpp rename to src/modules/math/MathModule.cpp index c836cb0be..6141712ca 100644 --- a/src/modules/math/Math.cpp +++ b/src/modules/math/MathModule.cpp @@ -18,7 +18,7 @@ * 3. This notice may not be removed or altered from any source distribution. **/ -#include "modules/math/Math.h" +#include "modules/math/MathModule.h" #include "common/math.h" #include @@ -90,11 +90,11 @@ Math::Math() // i mean union { - uint64_t b64; + uint64 b64; struct { - uint32_t a; - uint32_t b; + uint32 a; + uint32 b; } b32; } converter; @@ -111,7 +111,7 @@ Math::Math() retain(); } -uint32_t Math::rand() +uint64 Math::rand() { rng_state ^= (rng_state << 13); rng_state ^= (rng_state >> 7); diff --git a/src/modules/math/Math.h b/src/modules/math/MathModule.h similarity index 93% rename from src/modules/math/Math.h rename to src/modules/math/MathModule.h index fcecf21c8..c19214133 100644 --- a/src/modules/math/Math.h +++ b/src/modules/math/MathModule.h @@ -24,6 +24,7 @@ // LOVE #include "common/Module.h" #include "common/math.h" +#include "common/int.h" // STL #include @@ -54,9 +55,9 @@ public: /** Return uniformly distributed pseudo random integer. * - * @returns Pseudo random integer in [0,2^32). + * @returns Pseudo random integer in [0,2^64). */ - uint32_t rand(); + uint64 rand(); /** Get uniformly distributed pseudo random number in [0,1). * @@ -64,7 +65,7 @@ public: */ inline double random() { - return double(rand()) / (double(std::numeric_limits::max()) + 1.0); + return double(rand()) / (double(std::numeric_limits::max()) + 1.0); } /** Get uniformly distributed pseudo random number in [0,max). @@ -108,7 +109,7 @@ public: private: Math(); - uint64_t rng_state; + uint64 rng_state; double last_randnormal; }; diff --git a/src/modules/math/wrap_Math.cpp b/src/modules/math/wrap_Math.cpp index 1ba2cc5e5..b2737c7f7 100644 --- a/src/modules/math/wrap_Math.cpp +++ b/src/modules/math/wrap_Math.cpp @@ -19,7 +19,7 @@ **/ #include "wrap_Math.h" -#include "modules/math/Math.h" +#include "modules/math/MathModule.h" #include #include