]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Use squid_random & squid_srandom instead of random & srandom.
authorserassio <>
Tue, 25 Apr 2006 16:40:29 +0000 (16:40 +0000)
committerserassio <>
Tue, 25 Apr 2006 16:40:29 +0000 (16:40 +0000)
test-suite/splay.cc

index 1b9085a1516f01c8772e8b3763d77b3fe009b16a..32b4bfca9ba249dc1db4b2d99fe7c8d84f5460d4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: splay.cc,v 1.7 2004/08/30 05:12:33 robertc Exp $
+ * $Id: splay.cc,v 1.8 2006/04/25 10:40:29 serassio Exp $
  *
  * based on ftp://ftp.cs.cmu.edu/user/sleator/splaying/top-down-splay.c
  * http://bobo.link.cs.cmu.edu/cgi-bin/splay/splay-cgi.pl
@@ -136,11 +136,11 @@ main(int argc, char *argv[])
         intnode *I;
         /* test void * splay containers */
         splayNode *top = NULL;
-        srandom(time(NULL));
+        squid_srandom(time(NULL));
 
         for (i = 0; i < 100; i++) {
             I = (intnode *)xcalloc(sizeof(intnode), 1);
-            I->i = random();
+            I->i = squid_random();
             top = top->insert(I, compareintvoid);
         }
 
@@ -164,7 +164,7 @@ main(int argc, char *argv[])
         {
             intnode *I;
             I = new intnode;
-            I->i = random();
+            I->i = squid_random();
             safeTop = safeTop->insert(I, compareint);
         }
 
@@ -183,7 +183,7 @@ main(int argc, char *argv[])
         for (int i = 0; i < 100; i++)
         {
             intnode I;
-            I.i = random();
+            I.i = squid_random();
             safeTop = safeTop->insert(I, compareintref);
         }
 
@@ -219,7 +219,7 @@ main(int argc, char *argv[])
 
         for (int i = 0; i < 100; i++) {
             intnode I;
-            I.i = random();
+            I.i = squid_random();
 
             if (I.i > 50 && I.i < 10000000)
                 safeTop = safeTop->insert(I, compareintref);