diff --git a/ChangeLog b/ChangeLog index dc6d12dafe..f7be7959d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Jun 13 06:12:18 2013 Tanaka Akira + + * bignum.c (integer_unpack_num_bdigits_small): Fix a comple error on + clang -Werror,-Wshorten-64-to-32 + Reported by Eric Hodel. [ruby-core:55467] [Bug #8522] + Thu Jun 13 05:32:13 2013 Eric Hodel * ext/socket/extconf.rb: Enable RFC 3542 IPV6 socket options for OS X diff --git a/bignum.c b/bignum.c index ab5bf59201..ba786489aa 100644 --- a/bignum.c +++ b/bignum.c @@ -1125,7 +1125,7 @@ integer_unpack_num_bdigits_small(size_t numwords, size_t wordsize, size_t nails, /* nlp_bits stands for number of leading padding bits */ size_t num_bits = (wordsize * CHAR_BIT - nails) * numwords; size_t num_bdigits = (num_bits + BITSPERDIG - 1) / BITSPERDIG; - *nlp_bits_ret = num_bdigits * BITSPERDIG - num_bits; + *nlp_bits_ret = (int)(num_bdigits * BITSPERDIG - num_bits); return num_bdigits; } @@ -1224,7 +1224,7 @@ rb_integer_unpack_internal(const void *words, size_t numwords, size_t wordsize, BDIGIT_DBL dd; int numbits_in_dd; - if (numwords <= (SIZE_MAX - (SIZEOF_BDIGITS*CHAR_BIT-1)) / CHAR_BIT / wordsize) { + if (numwords <= (SIZE_MAX - (BITSPERDIG-1)) / CHAR_BIT / wordsize) { num_bdigits = integer_unpack_num_bdigits_small(numwords, wordsize, nails, nlp_bits_ret); #if 0 {