Skip to content

Commit

Permalink
[MERGE] Upgrade Scalar-List-Utils to 1.47
Browse files Browse the repository at this point in the history
including reverting any customisations.
  • Loading branch information
iabyn committed Jun 22, 2017
2 parents 385b74b + 5e99e06 commit b964556
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 45 deletions.
11 changes: 1 addition & 10 deletions Porting/Maintainers.pl
Expand Up @@ -959,17 +959,8 @@ package Maintainers;
},

'Scalar-List-Utils' => {
'DISTRIBUTION' => 'PEVANS/Scalar-List-Utils-1.46.tar.gz',
'DISTRIBUTION' => 'PEVANS/Scalar-List-Utils-1.47.tar.gz',
'FILES' => q[cpan/Scalar-List-Utils],
'CUSTOMIZED' => [
'lib/List/Util.pm', # CPAN RT 118470
'lib/List/Util/XS.pm', # CPAN RT 118470
'lib/Scalar/Util.pm', # CPAN RT 118470
'lib/Sub/Util.pm', # CPAN RT 118470
't/lln.t', # CPAN RT 118470
't/uniq.t', # CPAN RT 118470
't/tainted.t', # CPAN RT 119169
],
},

'Search::Dict' => {
Expand Down
39 changes: 29 additions & 10 deletions cpan/Scalar-List-Utils/ListUtil.xs
Expand Up @@ -7,14 +7,33 @@
#include <perl.h>
#include <XSUB.h>

#define NEED_sv_2pv_flags 1
#include "ppport.h"
#ifdef USE_PPPORT_H
# define NEED_sv_2pv_flags 1
# define NEED_newSVpvn_flags 1
# include "ppport.h"
#endif

#ifndef PERL_VERSION_DECIMAL
# define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
#endif
#ifndef PERL_DECIMAL_VERSION
# define PERL_DECIMAL_VERSION \
PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
#endif
#ifndef PERL_VERSION_GE
# define PERL_VERSION_GE(r,v,s) \
(PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
#endif
#ifndef PERL_VERSION_LE
# define PERL_VERSION_LE(r,v,s) \
(PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
#endif

#if PERL_BCDVERSION >= 0x5006000
#if PERL_VERSION_GE(5,6,0)
# include "multicall.h"
#endif

#if PERL_BCDVERSION < 0x5023008
#if !PERL_VERSION_GE(5,23,8)
# define UNUSED_VAR_newsp PERL_UNUSED_VAR(newsp)
#else
# define UNUSED_VAR_newsp NOOP
Expand All @@ -28,7 +47,7 @@
was not exported. Therefore platforms like win32, VMS etc have problems
so we redefine it here -- GMB
*/
#if PERL_BCDVERSION < 0x5007000
#if !PERL_VERSION_GE(5,7,0)
/* Not in 5.6.1. */
# ifdef cxinc
# undef cxinc
Expand Down Expand Up @@ -879,7 +898,7 @@ PPCODE:
/* This MULTICALL-based code appears to fail on perl 5.10.0 and 5.8.9
* Skip it on those versions (RT#87857)
*/
#if defined(dMULTICALL) && (PERL_BCDVERSION > 0x5010000 || PERL_BCDVERSION < 0x5008009)
#if defined(dMULTICALL) && (PERL_VERSION_GE(5,10,1) || PERL_VERSION_LE(5,8,8))
assert(cv);
if(!CvISXSUB(cv)) {
/* Since MULTICALL is about to move it */
Expand Down Expand Up @@ -1056,11 +1075,11 @@ CODE:
arg = sv_mortalcopy(arg);

if(SvUOK(arg))
sv_setpvf(keysv, "%"UVuf, SvUV(arg));
sv_setpvf(keysv, "%" UVuf, SvUV(arg));
else if(SvIOK(arg))
sv_setpvf(keysv, "%"IVdf, SvIV(arg));
sv_setpvf(keysv, "%" IVdf, SvIV(arg));
else
sv_setpvf(keysv, "%"NVgf, SvNV(arg));
sv_setpvf(keysv, "%" NVgf, SvNV(arg));
#ifdef HV_FETCH_EMPTY_HE
he = (HE*) hv_common(seen, NULL, SvPVX(keysv), SvCUR(keysv), 0, HV_FETCH_LVALUE | HV_FETCH_EMPTY_HE, NULL, 0);
if (HeVAL(he))
Expand Down Expand Up @@ -1329,7 +1348,7 @@ CODE:
if(SvAMAGIC(sv) && (tempsv = AMG_CALLun(sv, numer))) {
sv = tempsv;
}
#if PERL_BCDVERSION < 0x5008005
#if !PERL_VERSION_GE(5,8,5)
if(SvPOK(sv) || SvPOKp(sv)) {
RETVAL = looks_like_number(sv) ? &PL_sv_yes : &PL_sv_no;
}
Expand Down
2 changes: 1 addition & 1 deletion cpan/Scalar-List-Utils/Makefile.PL
Expand Up @@ -11,7 +11,7 @@ WriteMakefile(
NAME => q[List::Util],
ABSTRACT => q[Common Scalar and List utility subroutines],
AUTHOR => q[Graham Barr <gbarr@cpan.org>],
DEFINE => q[-DPERL_EXT],
DEFINE => ($ENV{PERL_CORE} ? q[-DPERL_EXT] : q[-DPERL_EXT -DUSE_PPPORT_H]),
DISTNAME => q[Scalar-List-Utils],
VERSION_FROM => 'lib/List/Util.pm',

Expand Down
2 changes: 1 addition & 1 deletion cpan/Scalar-List-Utils/lib/List/Util.pm
Expand Up @@ -15,7 +15,7 @@ our @EXPORT_OK = qw(
all any first min max minstr maxstr none notall product reduce sum sum0 shuffle uniq uniqnum uniqstr
pairs unpairs pairkeys pairvalues pairmap pairgrep pairfirst
);
our $VERSION = "1.46_02";
our $VERSION = "1.47";
our $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;

Expand Down
2 changes: 1 addition & 1 deletion cpan/Scalar-List-Utils/lib/List/Util/XS.pm
Expand Up @@ -3,7 +3,7 @@ use strict;
use warnings;
use List::Util;

our $VERSION = "1.46_02"; # FIXUP
our $VERSION = "1.47"; # FIXUP
$VERSION = eval $VERSION; # FIXUP

1;
Expand Down
2 changes: 1 addition & 1 deletion cpan/Scalar-List-Utils/lib/Scalar/Util.pm
Expand Up @@ -17,7 +17,7 @@ our @EXPORT_OK = qw(
dualvar isdual isvstring looks_like_number openhandle readonly set_prototype
tainted
);
our $VERSION = "1.46_02";
our $VERSION = "1.47";
$VERSION = eval $VERSION;

require List::Util; # List::Util loads the XS
Expand Down
2 changes: 1 addition & 1 deletion cpan/Scalar-List-Utils/lib/Sub/Util.pm
Expand Up @@ -15,7 +15,7 @@ our @EXPORT_OK = qw(
subname set_subname
);

our $VERSION = "1.46_02";
our $VERSION = "1.47";
$VERSION = eval $VERSION;

require List::Util; # as it has the XS
Expand Down
10 changes: 3 additions & 7 deletions cpan/Scalar-List-Utils/t/lln.t
Expand Up @@ -10,13 +10,9 @@ foreach my $num (qw(1 -1 +1 1.0 +1.0 -1.0 -1.0e-12)) {
ok(looks_like_number($num), "'$num'");
}

SKIP: {
my $vax_float = (pack("d",1) =~ /^[\x80\x10]\x40/);
skip("VAX does not have inf/nan", 3) if $vax_float;
is(!!looks_like_number("Inf"), $] >= 5.006001, 'Inf');
is(!!looks_like_number("Infinity"), $] >= 5.008, 'Infinity');
is(!!looks_like_number("NaN"), $] >= 5.008, 'NaN');
}
is(!!looks_like_number("Inf"), $] >= 5.006001, 'Inf');
is(!!looks_like_number("Infinity"), $] >= 5.008, 'Infinity');
is(!!looks_like_number("NaN"), $] >= 5.008, 'NaN');
is(!!looks_like_number("foo"), '', 'foo');
is(!!looks_like_number(undef), '', 'undef');
is(!!looks_like_number({}), '', 'HASH Ref');
Expand Down
7 changes: 1 addition & 6 deletions cpan/Scalar-List-Utils/t/uniq.t
Expand Up @@ -70,19 +70,14 @@ is_deeply( [ uniqnum qw( 1 1.1 1.2 1.3 ) ],
[ 1, 1.1, 1.2, 1.3 ],
'uniqnum distinguishes floats' );

SKIP: {
my $vax_float = (pack("d",1) =~ /^[\x80\x10]\x40/);
skip("VAX does not have inf/nan", 1) if $vax_float;

# Hard to know for sure what an Inf is going to be. Lets make one
my $Inf = 0 + eval '1E1000';
my $Inf = 0 + 1E1000;
my $NaN;
$Inf **= 1000 while ( $NaN = $Inf - $Inf ) == $NaN;

is_deeply( [ uniqnum 0, 1, 12345, $Inf, -$Inf, $NaN, 0, $Inf, $NaN ],
[ 0, 1, 12345, $Inf, -$Inf, $NaN ],
'uniqnum preserves the special values of +-Inf and Nan' );
}

{
my $maxint = ~0;
Expand Down
7 changes: 0 additions & 7 deletions t/porting/customized.dat
Expand Up @@ -14,13 +14,6 @@ Pod::Checker cpan/Pod-Checker/t/pod/contains_bad_pod.xr 73538fd80dfe6e19ad561fe0
Pod::Checker cpan/Pod-Checker/t/pod/selfcheck.t 8ce3cfd38e4b9bcf5bc7fe7f2a14195e49aed7d8
Pod::Checker cpan/Pod-Checker/t/pod/testcmp.pl a0cd5c8eca775c7753f4464eee96fa916e3d8a16
Pod::Checker cpan/Pod-Checker/t/pod/testpchk.pl b2072c7f4379fd050e15424175d7cac5facf5b3b
Scalar-List-Utils cpan/Scalar-List-Utils/lib/List/Util.pm 8cbd3463af838b4a39a7077bea3fe758a71f8ec3
Scalar-List-Utils cpan/Scalar-List-Utils/lib/List/Util/XS.pm 2d09b84a5575e67834655a0e9b3569c83d9a3902
Scalar-List-Utils cpan/Scalar-List-Utils/lib/Scalar/Util.pm 98af8fe390d9c9fa11a1fafebbc68ea663cdce2c
Scalar-List-Utils cpan/Scalar-List-Utils/lib/Sub/Util.pm 188cf0dd95cd7ba60fd6a366f440811fb52c2c79
Scalar-List-Utils cpan/Scalar-List-Utils/t/lln.t b7148c7f1cd9c70fd21d8153542b6d3de2b655ad
Scalar-List-Utils cpan/Scalar-List-Utils/t/tainted.t 9c52e04687ec8a7d23a1c38a762723858305b1fe
Scalar-List-Utils cpan/Scalar-List-Utils/t/uniq.t 5de01094d2bca9cf8b2bbbca920122f7396bf11e
Socket cpan/Socket/Socket.pm 98e38176d745c38282907f391c077298f5a3d0ba
Socket cpan/Socket/Socket.xs edd4fed212785f11c5c2095a75941dad27d586d9
Test::Harness cpan/Test-Harness/bin/prove 9b2866928cb1125de2c68f9773b25723e02c54c0
Expand Down

0 comments on commit b964556

Please sign in to comment.