X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=utils%2Fyarandom.c;h=f450735117b03dedeaf3c60528dc35af6954ceba;hp=6d4a32385b4cb94fbbce4a068d240de9c9496f6b;hb=8afc01a67be4fbf3f1cc0fce9adf01b5289a21c6;hpb=3f1091236d800c43a3124c44c7da54e53f205b13 diff --git a/utils/yarandom.c b/utils/yarandom.c index 6d4a3238..f4507351 100644 --- a/utils/yarandom.c +++ b/utils/yarandom.c @@ -1,5 +1,5 @@ /* yarandom.c -- Yet Another Random Number Generator. - * Copyright (c) 1997-2010 by Jamie Zawinski + * Copyright (c) 1997-2014 by Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -116,7 +116,7 @@ ya_rand_init(unsigned int seed) -- Brian Carlson, 2010. */ #define ROT(X,N) (((X)<<(N)) | ((X)>>((sizeof(unsigned int)*8)-(N)))) - seed = (999 * tp.tv_sec); + seed = (999U * (unsigned int) tp.tv_sec); seed = ROT (seed, 11); seed += (1001 * tp.tv_usec); seed = ROT (seed, 7);