X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=lib%2Frand.c;h=69acb06c14410296f959da96f27fe842f57eede1;hb=379e5f09a16f789f3d15ff5541a42e1e74d2b383;hp=f18bd8d84e9cf021cd49a8df3dc931f47d7f35e2;hpb=3363fa4482e24fb87d8aea3443e11d90f1bfc462;p=fio.git diff --git a/lib/rand.c b/lib/rand.c index f18bd8d8..69acb06c 100644 --- a/lib/rand.c +++ b/lib/rand.c @@ -95,7 +95,7 @@ void init_rand_seed(struct frand_state *state, unsigned int seed, bool use64) __init_rand64(&state->state64, seed); } -void __fill_random_buf(void *buf, unsigned int len, unsigned long seed) +void __fill_random_buf(void *buf, unsigned int len, uint64_t seed) { void *ptr = buf; @@ -122,10 +122,10 @@ void __fill_random_buf(void *buf, unsigned int len, unsigned long seed) } } -unsigned long fill_random_buf(struct frand_state *fs, void *buf, - unsigned int len) +uint64_t fill_random_buf(struct frand_state *fs, void *buf, + unsigned int len) { - unsigned long r = __rand(fs); + uint64_t r = __rand(fs); if (sizeof(int) != sizeof(long *)) r *= (unsigned long) __rand(fs); @@ -134,7 +134,7 @@ unsigned long fill_random_buf(struct frand_state *fs, void *buf, return r; } -void __fill_random_buf_percentage(unsigned long seed, void *buf, +void __fill_random_buf_percentage(uint64_t seed, void *buf, unsigned int percentage, unsigned int segment, unsigned int len, char *pattern, unsigned int pbytes) @@ -183,12 +183,12 @@ void __fill_random_buf_percentage(unsigned long seed, void *buf, } } -unsigned long fill_random_buf_percentage(struct frand_state *fs, void *buf, - unsigned int percentage, - unsigned int segment, unsigned int len, - char *pattern, unsigned int pbytes) +uint64_t fill_random_buf_percentage(struct frand_state *fs, void *buf, + unsigned int percentage, + unsigned int segment, unsigned int len, + char *pattern, unsigned int pbytes) { - unsigned long r = __rand(fs); + uint64_t r = __rand(fs); if (sizeof(int) != sizeof(long *)) r *= (unsigned long) __rand(fs);