summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-12 21:13:56 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-12 21:13:56 +0000
commit2b1c2b7223de78de5d8b855d62b89623ed930744 (patch)
tree0c2ea1dc1c0c666474e9a51ff540b93e711bc74c /bignum.c
parentd341276561accd598d91bfdb736378c72ec41ab3 (diff)
* 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c4
1 files changed, 2 insertions, 2 deletions
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
{