Browse Source

Rename Math.{cpp,h} to ModMath.{cpp,h}.

Compilers can get confused and include Math.h and math.h (included by cmath).
vrld 12 years ago
parent
commit
4b8c6d236d
3 changed files with 12 additions and 12 deletions
  1. 4 4
      src/modules/math/ModMath.cpp
  2. 5 5
      src/modules/math/ModMath.h
  3. 3 3
      src/modules/math/wrap_Math.cpp

+ 4 - 4
src/modules/math/Math.cpp → src/modules/math/ModMath.cpp

@@ -18,7 +18,7 @@
  * 3. This notice may not be removed or altered from any source distribution.
  * 3. This notice may not be removed or altered from any source distribution.
  **/
  **/
 
 
-#include "Math.h"
+#include "ModMath.h"
 #include "common/math.h"
 #include "common/math.h"
 
 
 #include <cmath>
 #include <cmath>
@@ -30,13 +30,13 @@ namespace math
 
 
 // 64 bit Xorshift implementation taken from the end of Sec. 3 (page 4) in
 // 64 bit Xorshift implementation taken from the end of Sec. 3 (page 4) in
 // George Marsaglia, "Xorshift RNGs", Journal of Statistical Software, Vol.8 (Issue 14), 2003
 // George Marsaglia, "Xorshift RNGs", Journal of Statistical Software, Vol.8 (Issue 14), 2003
-Math::Math()
+ModMath::ModMath()
 {
 {
 	RNGState.seed = 0x0139408DCBBF7A44;
 	RNGState.seed = 0x0139408DCBBF7A44;
 	RNGState.last_randnormal = std::numeric_limits<double>::infinity();
 	RNGState.last_randnormal = std::numeric_limits<double>::infinity();
 }
 }
 
 
-uint32_t Math::rand()
+uint32_t ModMath::rand()
 {
 {
 	uint64_t &x = RNGState.seed;
 	uint64_t &x = RNGState.seed;
 	x ^= (x << 13);
 	x ^= (x << 13);
@@ -46,7 +46,7 @@ uint32_t Math::rand()
 }
 }
 
 
 // Box–Muller transform
 // Box–Muller transform
-double Math::randnormal(double stddev)
+double ModMath::randnormal(double stddev)
 {
 {
 	if (RNGState.last_randnormal != std::numeric_limits<double>::infinity())
 	if (RNGState.last_randnormal != std::numeric_limits<double>::infinity())
 	{
 	{

+ 5 - 5
src/modules/math/Math.h → src/modules/math/ModMath.h

@@ -18,8 +18,8 @@
  * 3. This notice may not be removed or altered from any source distribution.
  * 3. This notice may not be removed or altered from any source distribution.
  **/
  **/
 
 
-#ifndef LOVE_MATH_MATH_H
-#define LOVE_MATH_MATH_H
+#ifndef LOVE_MATH_MODMATH_H
+#define LOVE_MATH_MODMATH_H
 
 
 // LOVE
 // LOVE
 #include "common/Module.h"
 #include "common/Module.h"
@@ -33,11 +33,11 @@ namespace love
 namespace math
 namespace math
 {
 {
 
 
-class Math : public Module
+class ModMath : public Module
 {
 {
 public:
 public:
-	Math();
-	virtual ~Math() {}
+	ModMath();
+	virtual ~ModMath() {}
 
 
 	/** Set pseudo random seed.
 	/** Set pseudo random seed.
 	 *
 	 *

+ 3 - 3
src/modules/math/wrap_Math.cpp

@@ -19,7 +19,7 @@
  **/
  **/
 
 
 #include "wrap_Math.h"
 #include "wrap_Math.h"
-#include "Math.h"
+#include "ModMath.h"
 
 
 #include <cmath>
 #include <cmath>
 #include <iostream>
 #include <iostream>
@@ -40,7 +40,7 @@ namespace love
 namespace math
 namespace math
 {
 {
 
 
-static Math *instance = 0;
+static ModMath *instance = 0;
 
 
 int w_randomseed(lua_State *L)
 int w_randomseed(lua_State *L)
 {
 {
@@ -112,7 +112,7 @@ static const lua_CFunction types[] =
 extern "C" int luaopen_love_math(lua_State *L)
 extern "C" int luaopen_love_math(lua_State *L)
 {
 {
 	if (instance == 0)
 	if (instance == 0)
-		instance = new love::math::Math();
+		instance = new love::math::ModMath();
 	else
 	else
 		instance->retain();
 		instance->retain();