From ce793e31f387c0715fa5b50c20e06510cc3e95ff Mon Sep 17 00:00:00 2001
From: Mike Buland <eichlan@xagasoft.com>
Date: Tue, 22 May 2012 17:15:40 +0000
Subject: Moved random to stable, just needs some minor tweaks.  But it's
 already in use in a couple of core components, including in tempFile name
 generation.

---
 src/unstable/bitstring.cpp | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

(limited to 'src/unstable')

diff --git a/src/unstable/bitstring.cpp b/src/unstable/bitstring.cpp
index c32240c..9559aad 100644
--- a/src/unstable/bitstring.cpp
+++ b/src/unstable/bitstring.cpp
@@ -6,16 +6,12 @@
  */
 
 #include "bu/bitstring.h"
-#include <stdlib.h>
+#include "bu/random.h"
 #include <stdio.h>
 #include <string.h>
 
 #include "bu/exceptionbase.h"
 
-#ifdef _WIN32
-#define random() rand()
-#endif
-
 #define bitsToBytes( iBits ) (((iBits/8)+((iBits%8)?(1):(0))));
 
 Bu::BitString::BitString()
@@ -51,7 +47,7 @@ Bu::BitString::BitString( long iNewBits, bool bFillRandomly )
 		// I'll just use the low order byte)
 		for( j = 0; j < iBytes; j++ )
 		{
-			caData[j] = (unsigned char)(random() & 0xFF);
+			caData[j] = (unsigned char)(Bu::Random::rand() & 0xFF);
 		}
 	}
 	else
@@ -413,7 +409,7 @@ void Bu::BitString::randomize()
 	{
 		for( int j = 0; j < iBytes; j++ )
 		{
-			caData[j] = (unsigned char)(random() & 0xFF);
+			caData[j] = (unsigned char)(Bu::Random::rand() & 0xFF);
 		}
 		fixup();
 	}
-- 
cgit v1.2.3