diff options
| author | Mattias Andrée <maandree@kth.se> | 2016-04-08 16:22:14 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2016-04-08 16:22:14 +0200 |
| commit | 22dc2cc19a3c1e127bc75565980dc7f172dcff52 (patch) | |
| tree | 7e93ae92df2c41df713de12cb3b8d51445613bb1 /src/zrand.c | |
| parent | Some improvements: (diff) | |
| download | libzahl-22dc2cc19a3c1e127bc75565980dc7f172dcff52.tar.gz libzahl-22dc2cc19a3c1e127bc75565980dc7f172dcff52.tar.bz2 libzahl-22dc2cc19a3c1e127bc75565980dc7f172dcff52.tar.xz | |
Fix warnings (that were not turned on by default)
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
| -rw-r--r-- | src/zrand.c | 8 |
1 files changed, 4 insertions, 4 deletions
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--) { |
