зеркало из https://github.com/github/ruby.git
* random.c (limited_big_rand): declare rnd, lim and mask as uint32_t
to avoid 64 bit to 32 bit shorten warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
1ba82b765c
Коммит
6c5000b5f1
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Jun 8 19:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
|
||||||
|
|
||||||
|
* random.c (limited_big_rand): declare rnd, lim and mask as uint32_t
|
||||||
|
to avoid 64 bit to 32 bit shorten warnings.
|
||||||
|
|
||||||
Sat Jun 8 19:23:53 2013 NARUSE, Yui <naruse@ruby-lang.org>
|
Sat Jun 8 19:23:53 2013 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* win32/Makefile.sub: r41163 changed win32/win32.c and configure.in
|
* win32/Makefile.sub: r41163 changed win32/win32.c and configure.in
|
||||||
|
|
7
random.c
7
random.c
|
@ -741,7 +741,7 @@ limited_big_rand(struct MT *mt, VALUE limit)
|
||||||
{
|
{
|
||||||
/* mt must be initialized */
|
/* mt must be initialized */
|
||||||
|
|
||||||
unsigned long mask, lim, rnd;
|
uint32_t mask;
|
||||||
long i;
|
long i;
|
||||||
int boundary;
|
int boundary;
|
||||||
|
|
||||||
|
@ -761,8 +761,9 @@ limited_big_rand(struct MT *mt, VALUE limit)
|
||||||
mask = 0;
|
mask = 0;
|
||||||
boundary = 1;
|
boundary = 1;
|
||||||
for (i = len-1; 0 <= i; i--) {
|
for (i = len-1; 0 <= i; i--) {
|
||||||
lim = lim_array[i];
|
uint32_t rnd;
|
||||||
mask = mask ? 0xffffffff : make_mask(lim);
|
uint32_t lim = lim_array[i];
|
||||||
|
mask = mask ? 0xffffffff : (uint32_t)make_mask(lim);
|
||||||
if (mask) {
|
if (mask) {
|
||||||
rnd = genrand_int32(mt) & mask;
|
rnd = genrand_int32(mt) & mask;
|
||||||
if (boundary) {
|
if (boundary) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче