Make non-gcc compilers happy...

This commit is contained in:
vrld
2013-03-13 23:09:25 +01:00
parent ece4ff6472
commit 1a407a6af3
4 changed files with 12 additions and 11 deletions
@@ -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 <cmath>
@@ -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 <cmath>
@@ -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);
@@ -24,6 +24,7 @@
// LOVE
#include "common/Module.h"
#include "common/math.h"
#include "common/int.h"
// STL
#include <limits>
@@ -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<uint32_t>::max()) + 1.0);
return double(rand()) / (double(std::numeric_limits<uint64>::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;
};
+1 -1
View File
@@ -19,7 +19,7 @@
**/
#include "wrap_Math.h"
#include "modules/math/Math.h"
#include "modules/math/MathModule.h"
#include <cmath>
#include <iostream>