aboutsummaryrefslogtreecommitdiff
path: root/src/unstable
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/unstable/bitstring.cpp10
1 files changed, 3 insertions, 7 deletions
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 @@
6 */ 6 */
7 7
8#include "bu/bitstring.h" 8#include "bu/bitstring.h"
9#include <stdlib.h> 9#include "bu/random.h"
10#include <stdio.h> 10#include <stdio.h>
11#include <string.h> 11#include <string.h>
12 12
13#include "bu/exceptionbase.h" 13#include "bu/exceptionbase.h"
14 14
15#ifdef _WIN32
16#define random() rand()
17#endif
18
19#define bitsToBytes( iBits ) (((iBits/8)+((iBits%8)?(1):(0)))); 15#define bitsToBytes( iBits ) (((iBits/8)+((iBits%8)?(1):(0))));
20 16
21Bu::BitString::BitString() 17Bu::BitString::BitString()
@@ -51,7 +47,7 @@ Bu::BitString::BitString( long iNewBits, bool bFillRandomly )
51 // I'll just use the low order byte) 47 // I'll just use the low order byte)
52 for( j = 0; j < iBytes; j++ ) 48 for( j = 0; j < iBytes; j++ )
53 { 49 {
54 caData[j] = (unsigned char)(random() & 0xFF); 50 caData[j] = (unsigned char)(Bu::Random::rand() & 0xFF);
55 } 51 }
56 } 52 }
57 else 53 else
@@ -413,7 +409,7 @@ void Bu::BitString::randomize()
413 { 409 {
414 for( int j = 0; j < iBytes; j++ ) 410 for( int j = 0; j < iBytes; j++ )
415 { 411 {
416 caData[j] = (unsigned char)(random() & 0xFF); 412 caData[j] = (unsigned char)(Bu::Random::rand() & 0xFF);
417 } 413 }
418 fixup(); 414 fixup();
419 } 415 }