#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;
/* 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) ));
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) ) ); */
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 */
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;
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);