summaryrefslogtreecommitdiff
path: root/net/rsplib/files/patch-src_randomizer.c
blob: 667c7c707bdde86c683652b8072d1ffacd98f2b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- src/randomizer.c.orig	2021-02-17 14:14:20 UTC
+++ src/randomizer.c
@@ -32,13 +32,12 @@
 #include <math.h>
 #include <stdlib.h>
 
-
+/*
 #ifdef NDEBUG
 #undef min
 #undef max
 #include <omnetpp.h>
 #else
-/*
    It is tried to use /dev/urandom as random source first, since
    it provides high-quality random numbers. If /dev/urandom is not
    available, use the clib's random() function with a seed given
@@ -56,7 +55,6 @@
 
 static int   RandomSource = RS_TRY_DEVICE;
 static FILE* RandomDevice = NULL;
-#endif
 
 
 
@@ -84,11 +82,13 @@ uint64_t random64()
 /* ###### Get 32-bit random value ######################################## */
 uint32_t random32()
 {
+/*
 #ifdef NDEBUG
 #warning Using OMNeT++ random generator instead of time-seeded one!
    const double value = uniform(0.0, (double)0xffffffff);
    return((uint32_t)rint(value));
 #else
+*/
    uint32_t number;
 
    switch(RandomSource) {
@@ -116,7 +116,6 @@ uint32_t random32()
       break;
    }
    return(random());
-#endif
 }