From de4096e8682a064ed9125af7ac30a3fe4021167b Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 7 Mar 2016 15:38:44 -0700 Subject: [PATCH] rand: use bools Signed-off-by: Jens Axboe --- lib/rand.c | 4 ++-- lib/rand.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/rand.c b/lib/rand.c index 1b661a86..9c3e0d6a 100644 --- a/lib/rand.c +++ b/lib/rand.c @@ -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; diff --git a/lib/rand.h b/lib/rand.h index 49773b0d..24fac23c 100644 --- a/lib/rand.h +++ b/lib/rand.h @@ -2,6 +2,7 @@ #define FIO_RAND_H #include +#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); -- 2.25.1