From: Nicholas Clark Date: Thu, 28 Oct 2010 13:15:01 +0000 (+0100) Subject: Reorder the list return of Math::BigInt::Calc::_base_len(). X-Git-Tag: accepted/trunk/20130322.191538~7089 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f800d0e18f11d3c11bd1daa3a3643fef23b55dd1;p=platform%2Fupstream%2Fperl.git Reorder the list return of Math::BigInt::Calc::_base_len(). A search of CPAN shows that this private function is only used internally between Math::BigInt::Calc, Math::BigInt::FastCalc and their test suites. --- diff --git a/dist/Math-BigInt-FastCalc/FastCalc.pm b/dist/Math-BigInt-FastCalc/FastCalc.pm index 24ab90b..e574655 100644 --- a/dist/Math-BigInt-FastCalc/FastCalc.pm +++ b/dist/Math-BigInt-FastCalc/FastCalc.pm @@ -4,11 +4,11 @@ use 5.006; use strict; use warnings; -use Math::BigInt::Calc; +use Math::BigInt::Calc 0.56; use vars qw/$VERSION $BASE $BASE_LEN/; -$VERSION = '0.23'; +$VERSION = '0.24'; require XSLoader; XSLoader::load(__PACKAGE__); @@ -40,11 +40,9 @@ BEGIN no strict 'refs'; *{'Math::BigInt::FastCalc::_' . $method} = \&{'Math::BigInt::Calc::_' . $method}; } - my ($AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL); - + # store BASE_LEN and BASE to later pass it to XS code - ($BASE_LEN, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL, $BASE) = - Math::BigInt::Calc::_base_len(); + ($BASE_LEN, $BASE) = Math::BigInt::Calc::_base_len(); } diff --git a/dist/Math-BigInt-FastCalc/t/bigintfc.t b/dist/Math-BigInt-FastCalc/t/bigintfc.t index 585ec75..a51610c 100644 --- a/dist/Math-BigInt-FastCalc/t/bigintfc.t +++ b/dist/Math-BigInt-FastCalc/t/bigintfc.t @@ -5,7 +5,7 @@ use Test::More tests => 359; use Math::BigInt::FastCalc; -my ($BASE_LEN, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL) = +my ($BASE_LEN, undef, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL) = Math::BigInt::FastCalc->_base_len(); print "# BASE_LEN = $BASE_LEN\n"; diff --git a/dist/Math-BigInt/lib/Math/BigInt/Calc.pm b/dist/Math-BigInt/lib/Math/BigInt/Calc.pm index f3b5156..1fc03d4 100644 --- a/dist/Math-BigInt/lib/Math/BigInt/Calc.pm +++ b/dist/Math-BigInt/lib/Math/BigInt/Calc.pm @@ -4,7 +4,7 @@ use 5.006002; use strict; # use warnings; # dont use warnings for older Perls -our $VERSION = '0.55'; +our $VERSION = '0.56'; # Package to store unsigned big integers in decimal and do math with them @@ -60,7 +60,7 @@ sub _base_len $BASE = int("1e".$BASE_LEN); $MAX_VAL = $BASE-1; return $BASE_LEN unless wantarray; - return ($BASE_LEN, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN, $MAX_VAL, $BASE); + return ($BASE_LEN, $BASE, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN, $MAX_VAL,); } # find whether we can use mul or div in mul()/div() @@ -95,7 +95,7 @@ sub _base_len } } return $BASE_LEN unless wantarray; - return ($BASE_LEN, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN, $MAX_VAL, $BASE); + return ($BASE_LEN, $BASE, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN, $MAX_VAL); } sub _new diff --git a/dist/Math-BigInt/t/bigintc.t b/dist/Math-BigInt/t/bigintc.t index a1274f2..9b94aeb 100644 --- a/dist/Math-BigInt/t/bigintc.t +++ b/dist/Math-BigInt/t/bigintc.t @@ -5,7 +5,7 @@ use Test::More tests => 375; use Math::BigInt::Calc; -my ($BASE_LEN, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL) = +my ($BASE_LEN, undef, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL) = Math::BigInt::Calc->_base_len(); print "# BASE_LEN = $BASE_LEN\n"; diff --git a/dist/Math-BigInt/t/bigintpm.inc b/dist/Math-BigInt/t/bigintpm.inc index 3e80bd3..d28ff54 100644 --- a/dist/Math-BigInt/t/bigintpm.inc +++ b/dist/Math-BigInt/t/bigintpm.inc @@ -583,7 +583,7 @@ is ($x, 23456); # construct a number with a zero-hole of BASE_LEN_SMALL { - my @bl = $CL->_base_len(); my $bl = $bl[4]; + my @bl = $CL->_base_len(); my $bl = $bl[5]; $x = '1' x $bl . '0' x $bl . '1' x $bl . '0' x $bl; $y = '1' x (2*$bl);