From 2b93ed5e762d15334ad063be99cc9b9cb9d7df2f Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 25 Jun 2013 03:08:23 +0000 Subject: * bignum.c (MSB): Removed. (BDIGIT_MSB): Defined using BIGRAD_HALF. (bary_2comp): Apply BIGLO after possible over flow of BDIGIT. (get2comp): Ditto. (bary_unpack_internal): Use BDIGIT_MSB. Apply BIGLO after possible over flow of BDIGIT. (rb_integer_unpack): Use BDIGIT_MSB. (calc_hbase): Use BDIGMAX. (big2dbl): Use BDIGMAX. Apply BIGLO after possible over flow of BDIGIT. (rb_big_neg): Apply BIGLO after possible over flow of BDIGIT. (biglsh_bang): Ditto. (bigrsh_bang): Ditto. (bary_divmod): Use BDIGIT_MSB. (bigdivrem): Ditto. (bigxor_int): Apply BIGLO after possible over flow of BDIGIT. * marshal.c (shortlen): Use SIZEOF_BDIGITS instead of sizeof(BDIGIT). * ext/openssl/ossl_bn.c (ossl_bn_initialize): Use SIZEOF_BDIGITS instead of sizeof(BDIGIT). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl_bn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/openssl/ossl_bn.c') diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c index a01272946e..05473635ae 100644 --- a/ext/openssl/ossl_bn.c +++ b/ext/openssl/ossl_bn.c @@ -147,14 +147,14 @@ ossl_bn_initialize(int argc, VALUE *argv, VALUE self) for (i = 0; len > i; i++) { BDIGIT v = ds[i]; - for (j = sizeof(BDIGIT) - 1; 0 <= j; j--) { - bin[(len-1-i)*sizeof(BDIGIT)+j] = v&0xff; + for (j = SIZEOF_BDIGITS - 1; 0 <= j; j--) { + bin[(len-1-i)*SIZEOF_BDIGITS+j] = v&0xff; v >>= 8; } } GetBN(self, bn); - if (!BN_bin2bn(bin, (int)sizeof(BDIGIT)*len, bn)) { + if (!BN_bin2bn(bin, (int)SIZEOF_BDIGITS*len, bn)) { ALLOCV_END(buf); ossl_raise(eBNError, NULL); } -- cgit v1.2.3