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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
diff -ru dieharder-3.31.1/libdieharder/rng_dev_arandom.c dieharder-3.31.1_fixed/libdieharder/rng_dev_arandom.c
--- dieharder-3.31.1/libdieharder/rng_dev_arandom.c 2011-10-14 15:41:37.000000000 +0200
+++ dieharder-3.31.1_fixed/libdieharder/rng_dev_arandom.c 2014-01-03 22:51:30.010534418 +0100
@@ -6,6 +6,7 @@
*/
#include <dieharder/libdieharder.h>
+#include <stdint.h>
static unsigned long int dev_arandom_get (void *vstate);
static double dev_arandom_get_double (void *vstate);
@@ -21,7 +22,7 @@
dev_arandom_get (void *vstate)
{
dev_arandom_state_t *state = (dev_arandom_state_t *) vstate;
- unsigned long int j;
+ uint32_t j;
if(state->fp != NULL) {
fread(&j,sizeof(j),1,state->fp);
@@ -36,7 +37,7 @@
static double
dev_arandom_get_double (void *vstate)
{
- return dev_arandom_get (vstate) / (double) UINT_MAX;
+ return dev_arandom_get (vstate) / (double) UINT32_MAX;
}
static void
diff -ru dieharder-3.31.1/libdieharder/rng_dev_random.c dieharder-3.31.1_fixed/libdieharder/rng_dev_random.c
--- dieharder-3.31.1/libdieharder/rng_dev_random.c 2011-10-14 15:41:37.000000000 +0200
+++ dieharder-3.31.1_fixed/libdieharder/rng_dev_random.c 2014-01-03 22:50:57.852321485 +0100
@@ -6,6 +6,7 @@
*/
#include <dieharder/libdieharder.h>
+#include <stdint.h>
static unsigned long int dev_random_get (void *vstate);
static double dev_random_get_double (void *vstate);
@@ -21,7 +22,7 @@
dev_random_get (void *vstate)
{
dev_random_state_t *state = (dev_random_state_t *) vstate;
- unsigned long int j;
+ uint32_t j;
if(state->fp != NULL) {
fread(&j,sizeof(j),1,state->fp);
@@ -36,7 +37,7 @@
static double
dev_random_get_double (void *vstate)
{
- return dev_random_get (vstate) / (double) UINT_MAX;
+ return dev_random_get (vstate) / (double) UINT32_MAX;
}
static void
diff -ru dieharder-3.31.1/libdieharder/rng_dev_urandom.c dieharder-3.31.1_fixed/libdieharder/rng_dev_urandom.c
--- dieharder-3.31.1/libdieharder/rng_dev_urandom.c 2011-10-14 15:41:37.000000000 +0200
+++ dieharder-3.31.1_fixed/libdieharder/rng_dev_urandom.c 2014-01-03 23:06:24.124239582 +0100
@@ -3,6 +3,7 @@
*/
#include <dieharder/libdieharder.h>
+#include <stdint.h>
/*
* This is a wrapping of the /dev/random hardware rng
@@ -21,7 +22,7 @@
dev_urandom_get (void *vstate)
{
dev_urandom_state_t *state = (dev_urandom_state_t *) vstate;
- unsigned long int j;
+ uint32_t j;
if(state->fp != NULL) {
fread(&j,sizeof(j),1,state->fp);
@@ -36,7 +37,7 @@
static double
dev_urandom_get_double (void *vstate)
{
- return dev_urandom_get (vstate) / (double) UINT_MAX;
+ return dev_urandom_get (vstate) / (double) UINT32_MAX;
}
static void
|