From f902803af290726ca8417d54c9b1014acdb6f163 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Sat, 22 May 2010 14:27:53 +0000 Subject: [PATCH] Windows build fixes This was SVN commit r7566. --- source/scriptinterface/ScriptInterface.cpp | 4 +--- source/scriptinterface/tests/test_ScriptInterface.h | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/source/scriptinterface/ScriptInterface.cpp b/source/scriptinterface/ScriptInterface.cpp index 33c9f24d82..e6f63af694 100644 --- a/source/scriptinterface/ScriptInterface.cpp +++ b/source/scriptinterface/ScriptInterface.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include "valgrind.h" @@ -125,8 +124,7 @@ JSBool Math_random(JSContext* cx, uintN UNUSED(argc), jsval* vp) // TODO: is the double generation sufficiently deterministic for us? boost::uniform_real dist; - boost::variate_generator > gen(*rng, dist); - double r = gen(); + double r = dist(*rng); jsval rv; if (!JS_NewNumberValue(cx, r, &rv)) diff --git a/source/scriptinterface/tests/test_ScriptInterface.h b/source/scriptinterface/tests/test_ScriptInterface.h index 984b476f04..6df1f2ef2c 100644 --- a/source/scriptinterface/tests/test_ScriptInterface.h +++ b/source/scriptinterface/tests/test_ScriptInterface.h @@ -117,11 +117,11 @@ public: boost::rand48 rng; script.ReplaceNondeterministicFunctions(rng); - rng.seed(0); + rng.seed((u64)0); TS_ASSERT(script.Eval("Math.random()", d1)); TS_ASSERT(script.Eval("Math.random()", d2)); TS_ASSERT_DIFFERS(d1, d2); - rng.seed(0); + rng.seed((u64)0); TS_ASSERT(script.Eval("Math.random()", d2)); TS_ASSERT_EQUALS(d1, d2); }