rand: use bools
authorJens Axboe <axboe@fb.com>
Mon, 7 Mar 2016 22:38:44 +0000 (15:38 -0700)
committerJens Axboe <axboe@fb.com>
Mon, 7 Mar 2016 22:38:44 +0000 (15:38 -0700)
Signed-off-by: Jens Axboe <axboe@fb.com>
lib/rand.c
lib/rand.h

index 1b661a86946bd75a06c2048022422487b00f17ea..9c3e0d6a39e181149ad04ac5c36f7220d115de95 100644 (file)
@@ -76,7 +76,7 @@ static void __init_rand64(struct taus258_state *state, uint64_t seed)
                __rand64(state);
 }
 
-void init_rand(struct frand_state *state, int use64)
+void init_rand(struct frand_state *state, bool use64)
 {
        state->use64 = use64;
 
@@ -86,7 +86,7 @@ void init_rand(struct frand_state *state, int use64)
                __init_rand64(&state->state64, 1);
 }
 
-void init_rand_seed(struct frand_state *state, unsigned int seed, int use64)
+void init_rand_seed(struct frand_state *state, unsigned int seed, bool use64)
 {
        state->use64 = use64;
 
index 49773b0d9b6bec616744fe7bc91c548f7b80aa42..24fac23cfec0856b409405e69a313dc7e873be33 100644 (file)
@@ -2,6 +2,7 @@
 #define FIO_RAND_H
 
 #include <inttypes.h>
+#include "types.h"
 #include "../arch/arch.h"
 
 #define FRAND32_MAX    (-1U)
@@ -128,8 +129,8 @@ static inline int rand_between(struct frand_state *state, int start, int end)
        return start + (int) ((double)end * (r / (rand_max(state) + 1.0)));
 }
 
-extern void init_rand(struct frand_state *, int);
-extern void init_rand_seed(struct frand_state *, unsigned int seed, int);
+extern void init_rand(struct frand_state *, bool);
+extern void init_rand_seed(struct frand_state *, unsigned int seed, bool);
 extern void __fill_random_buf(void *buf, unsigned int len, unsigned long seed);
 extern unsigned long fill_random_buf(struct frand_state *, void *buf, unsigned int len);
 extern void __fill_random_buf_percentage(unsigned long, void *, unsigned int, unsigned int, unsigned int, char *, unsigned int);