From: Steve Peters Date: Fri, 16 May 2008 18:07:00 +0000 (+0000) Subject: Upgrade to Math-BigInt-FastCalc-0.19 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=206957a79d0bac91e0b2fccc7ef76f95e8df245e;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Math-BigInt-FastCalc-0.19 p4raw-id: //depot/perl@33837 --- diff --git a/ext/Math/BigInt/FastCalc/FastCalc.pm b/ext/Math/BigInt/FastCalc/FastCalc.pm index 5fb89dc..2b4aea5 100644 --- a/ext/Math/BigInt/FastCalc/FastCalc.pm +++ b/ext/Math/BigInt/FastCalc/FastCalc.pm @@ -11,7 +11,7 @@ use vars qw/@ISA $VERSION $BASE $BASE_LEN/; @ISA = qw(DynaLoader); -$VERSION = '0.16'; +$VERSION = '0.19'; bootstrap Math::BigInt::FastCalc $VERSION; @@ -60,6 +60,7 @@ sub import 1; __END__ +=pod =head1 NAME diff --git a/ext/Math/BigInt/FastCalc/FastCalc.xs b/ext/Math/BigInt/FastCalc/FastCalc.xs index 777e400..6dbe958 100644 --- a/ext/Math/BigInt/FastCalc/FastCalc.xs +++ b/ext/Math/BigInt/FastCalc/FastCalc.xs @@ -2,6 +2,11 @@ #include "perl.h" #include "XSUB.h" +/* for Perl prior to v5.7.1 */ +#ifndef SvUOK +# define SvUOK(sv) SvIOK_UV(sv) +#endif + double XS_BASE = 0; double XS_BASE_LEN = 0; @@ -61,7 +66,7 @@ _new(class, x) /* create the array */ RETVAL = newAV(); sv_2mortal((SV*)RETVAL); - if (SvIOK(x) && SvUV(x) < XS_BASE) + if (SvUOK(x) && SvUV(x) < XS_BASE) { /* shortcut for integer arguments */ av_push (RETVAL, newSVuv( SvUV(x) )); @@ -112,7 +117,7 @@ _copy(class, x) a = (AV*)SvRV(x); /* ref to aray, don't check ref */ elems = av_len(a); /* number of elems in array */ a2 = (AV*)sv_2mortal((SV*)newAV()); - av_extend (a2, elems); /* prepadd */ + av_extend (a2, elems); /* pre-padd */ while (elems >= 0) { /* av_store( a2, elems, newSVsv( (SV*)*av_fetch(a, elems, 0) ) ); */ @@ -201,7 +206,7 @@ _dec(class,x) while (index <= elems) { temp = *av_fetch(a, index, 0); /* fetch ptr to current element */ - sv_setnv (temp, SvNV(temp)-1); + sv_setnv (temp, SvNV(temp)-1); /* decrement */ if (SvNV(temp) >= 0) { break; /* early out */ diff --git a/ext/Math/BigInt/FastCalc/t/bigintfc.t b/ext/Math/BigInt/FastCalc/t/bigintfc.t index 2a13359..a89ed91 100644 --- a/ext/Math/BigInt/FastCalc/t/bigintfc.t +++ b/ext/Math/BigInt/FastCalc/t/bigintfc.t @@ -9,7 +9,7 @@ BEGIN chdir 't' if -d 't'; unshift @INC, '../lib'; # for running manually unshift @INC, '../blib/arch'; # for running manually - plan tests => 361; + plan tests => 359; } use Math::BigInt::FastCalc; @@ -32,14 +32,6 @@ my $x = $C->_new("123"); my $y = $C->_new("321"); ok (ref($x),'ARRAY'); ok ($C->_str($x),123); ok ($C->_str($y),321); ############################################################################### -# _new(0xffffffff) (the test is important for 32 bit Perls) - -my $ff = $C->_new(0xffffffff); - -ok ($C->_str($ff),"4294967295"); # must not be -1 -ok (scalar @{ $ff }, 2); # must be two parts - -############################################################################### # _add, _sub, _mul, _div ok ($C->_str($C->_add($x,$y)),444); ok ($C->_str($C->_sub($x,$y)),123); diff --git a/ext/Math/BigInt/FastCalc/t/bootstrap.t b/ext/Math/BigInt/FastCalc/t/bootstrap.t index 0dd429c..1691dd3 100644 --- a/ext/Math/BigInt/FastCalc/t/bootstrap.t +++ b/ext/Math/BigInt/FastCalc/t/bootstrap.t @@ -6,6 +6,7 @@ BEGIN $| = 1; unshift @INC, '../blib/lib'; unshift @INC, '../blib/arch'; + unshift @INC, '../lib'; chdir 't' if -d 't'; plan tests => 1; };