[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

dbates at webkit.org dbates at webkit.org
Mon Feb 21 00:32:02 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit c66b51e7a328f5d8c1cbba4f3a9f5c159961e7c5
Author: dbates at webkit.org <dbates at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 1 18:50:17 2011 +0000

    2011-02-01  Daniel Bates  <dbates at rim.com>
    
            Reviewed by Antonio Gomes.
    
            Modify RandomNumberSeed.h to use USE(MERSENNE_TWISTER_19937)
            https://bugs.webkit.org/show_bug.cgi?id=53506
    
            Currently, use of the Mersenne Twister pseudorandom number generator
            is hardcoded to the Windows CE port. With the passing of bug #53253,
            we can generalize support for this PRNG to all ports that use srand(3)
            and rand(3), including Windows CE.
    
            * wtf/RandomNumberSeed.h:
            (WTF::initializeRandomNumberGenerator):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77260 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 1edfee2..b5f9638 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,18 @@
+2011-02-01  Daniel Bates  <dbates at rim.com>
+
+        Reviewed by Antonio Gomes.
+
+        Modify RandomNumberSeed.h to use USE(MERSENNE_TWISTER_19937)
+        https://bugs.webkit.org/show_bug.cgi?id=53506
+
+        Currently, use of the Mersenne Twister pseudorandom number generator
+        is hardcoded to the Windows CE port. With the passing of bug #53253,
+        we can generalize support for this PRNG to all ports that use srand(3)
+        and rand(3), including Windows CE.
+
+        * wtf/RandomNumberSeed.h:
+        (WTF::initializeRandomNumberGenerator):
+
 2011-02-01  Dave Tapuska  <dtapuska at rim.com>
 
         Reviewed by Gavin Barraclough.
diff --git a/Source/JavaScriptCore/wtf/RandomNumberSeed.h b/Source/JavaScriptCore/wtf/RandomNumberSeed.h
index 9ea7c71..0703abf 100644
--- a/Source/JavaScriptCore/wtf/RandomNumberSeed.h
+++ b/Source/JavaScriptCore/wtf/RandomNumberSeed.h
@@ -38,7 +38,7 @@
 #include <unistd.h>
 #endif
 
-#if OS(WINCE)
+#if USE(MERSENNE_TWISTER_19937)
 extern "C" {
 void init_by_array(unsigned long init_key[],int key_length);
 }
@@ -54,14 +54,6 @@ inline void initializeRandomNumberGenerator()
 #elif OS(WINCE)
     // initialize rand()
     srand(GetTickCount());
-
-    // use rand() to initialize the real RNG
-    unsigned long initializationBuffer[4];
-    initializationBuffer[0] = (rand() << 16) | rand();
-    initializationBuffer[1] = (rand() << 16) | rand();
-    initializationBuffer[2] = (rand() << 16) | rand();
-    initializationBuffer[3] = (rand() << 16) | rand();
-    init_by_array(initializationBuffer, 4);
 #elif COMPILER(MSVC) && defined(_CRT_RAND_S)
     // On Windows we use rand_s which initialises itself
 #elif PLATFORM(BREWMP)
@@ -74,6 +66,16 @@ inline void initializeRandomNumberGenerator()
 #else
     srand(static_cast<unsigned>(time(0)));
 #endif
+
+#if USE(MERSENNE_TWISTER_19937)
+    // use rand() to initialize the Mersenne Twister random number generator.
+    unsigned long initializationBuffer[4];
+    initializationBuffer[0] = (rand() << 16) | rand();
+    initializationBuffer[1] = (rand() << 16) | rand();
+    initializationBuffer[2] = (rand() << 16) | rand();
+    initializationBuffer[3] = (rand() << 16) | rand();
+    init_by_array(initializationBuffer, 4);
+#endif
 }
 
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list