ruby-changes:34686
From: nobu <ko1@a...>
Date: Wed, 9 Jul 2014 23:51:37 +0900 (JST)
Subject: [ruby-changes:34686] nobu:r46769 (trunk): random.c: fix casts
nobu 2014-07-09 23:51:26 +0900 (Wed, 09 Jul 2014) New Revision: 46769 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46769 Log: random.c: fix casts * random.c (fill_random_seed): fix type to cast. this may or may not suppress warnings by icc. Modified files: trunk/random.c Index: random.c =================================================================== --- random.c (revision 46768) +++ random.c (revision 46769) @@ -474,14 +474,14 @@ fill_random_seed(uint32_t seed[DEFAULT_S https://github.com/ruby/ruby/blob/trunk/random.c#L474 gettimeofday(&tv, 0); seed[0] ^= tv.tv_usec; - seed[1] ^= (unsigned int)tv.tv_sec; + seed[1] ^= (uint32_t)tv.tv_sec; #if SIZEOF_TIME_T > SIZEOF_INT - seed[0] ^= (unsigned int)((time_t)tv.tv_sec >> SIZEOF_INT * CHAR_BIT); + seed[0] ^= (uint32_t)((time_t)tv.tv_sec >> SIZEOF_INT * CHAR_BIT); #endif seed[2] ^= getpid() ^ (n++ << 16); - seed[3] ^= (unsigned int)(VALUE)&seed; + seed[3] ^= (uint32_t)(VALUE)&seed; #if SIZEOF_VOIDP > SIZEOF_INT - seed[2] ^= (unsigned int)((VALUE)&seed >> SIZEOF_INT * CHAR_BIT); + seed[2] ^= (uint32_t)((VALUE)&seed >> SIZEOF_INT * CHAR_BIT); #endif } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/