From 22dc2cc19a3c1e127bc75565980dc7f172dcff52 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 8 Apr 2016 16:22:14 +0200 Subject: Fix warnings (that were not turned on by default) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/zrand.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/zrand.c') diff --git a/src/zrand.c b/src/zrand.c index 3d70452..f1913e1 100644 --- a/src/zrand.c +++ b/src/zrand.c @@ -26,11 +26,11 @@ zrand_libc_rand(void *out, size_t n, void *statep) if (!inited) { inited = 1; - srand((intptr_t)out | time(NULL)); + srand((unsigned)((intptr_t)out | time(NULL))); } while (n--) { - ri = rand(); + ri = (unsigned)rand(); rd = (double)ri / ((double)RAND_MAX + 1); #ifdef GOOD_RAND rd *= 256 * 256; @@ -63,7 +63,7 @@ zrand_libc_rand48(void *out, size_t n, void *statep) while (n--) { r0 = lrand48() & 15; r1 = lrand48() & 15; - buf[n] = (r0 << 4) | r1; + buf[n] = (unsigned char)((r0 << 4) | r1); } (void) statep; @@ -79,7 +79,7 @@ zrand_libc_random(void *out, size_t n, void *statep) if (!inited) { inited = 1; - srandom((intptr_t)out | time(NULL)); + srandom((unsigned)((intptr_t)out | time(NULL))); } while (n--) { -- cgit v1.2.3-70-g09d2