You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.6 KiB
88 lines
2.6 KiB
6 years ago
|
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
|