Revision: 15385
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15385
Author:   blendix
Date:     2008-06-29 22:53:17 +0200 (Sun, 29 Jun 2008)

Log Message:
-----------

Fix for bug #8680: GameLogic.getRandomFloat() returns very small
values on 64 bit, instead of range 0..1. Also a warning fix.

Modified Paths:
--------------
    trunk/blender/intern/iksolver/intern/IK_QTask.h
    trunk/blender/intern/moto/include/MT_random.h
    trunk/blender/intern/moto/intern/MT_random.cpp

Modified: trunk/blender/intern/iksolver/intern/IK_QTask.h
===================================================================
--- trunk/blender/intern/iksolver/intern/IK_QTask.h     2008-06-29 15:11:35 UTC 
(rev 15384)
+++ trunk/blender/intern/iksolver/intern/IK_QTask.h     2008-06-29 20:53:17 UTC 
(rev 15385)
@@ -74,7 +74,7 @@
 
        virtual bool PositionTask() const { return false; }
 
-       virtual void Scale(float scale) {}
+       virtual void Scale(float) {}
 
 protected:
        int m_id;

Modified: trunk/blender/intern/moto/include/MT_random.h
===================================================================
--- trunk/blender/intern/moto/include/MT_random.h       2008-06-29 15:11:35 UTC 
(rev 15384)
+++ trunk/blender/intern/moto/include/MT_random.h       2008-06-29 20:53:17 UTC 
(rev 15385)
@@ -31,10 +31,10 @@
 
 #include <limits.h>
 
-#define MT_RAND_MAX ULONG_MAX
+#define MT_RAND_MAX UINT_MAX
 
-extern void          MT_srand(unsigned long);
-extern unsigned long MT_rand();
+extern void          MT_srand(unsigned int);
+extern unsigned int  MT_rand();
 
 #endif
 

Modified: trunk/blender/intern/moto/intern/MT_random.cpp
===================================================================
--- trunk/blender/intern/moto/intern/MT_random.cpp      2008-06-29 15:11:35 UTC 
(rev 15384)
+++ trunk/blender/intern/moto/intern/MT_random.cpp      2008-06-29 20:53:17 UTC 
(rev 15385)
@@ -76,11 +76,11 @@
 #define TEMPERING_SHIFT_T(y)  (y << 15)
 #define TEMPERING_SHIFT_L(y)  (y >> 18)
 
-static unsigned long mt[N]; /* the array for the state vector  */
+static unsigned int mt[N]; /* the array for the state vector  */
 static int mti = N+1; /* mti==N+1 means mt[N] is not initialized */
 
 /* initializing the array with a NONZERO seed */
-void MT_srand(unsigned long seed)
+void MT_srand(unsigned int seed)
 {
     /* setting initial seeds to mt[N] using         */
     /* the generator Line 25 of Table 1 in          */
@@ -91,12 +91,12 @@
         mt[mti] = (69069 * mt[mti-1]) & 0xffffffff;
 }
 
-unsigned long MT_rand()
+unsigned int MT_rand()
 {
-    static unsigned long mag01[2] = { 0x0, MATRIX_A };
+    static unsigned int mag01[2] = { 0x0, MATRIX_A };
     /* mag01[x] = x * MATRIX_A  for x=0,1 */
 
-    unsigned long y;
+    unsigned int y;
 
     if (mti >= N) { /* generate N words at one time */
         int kk;


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to