Skip to content

Commit 7654aaa

Browse files
committed
Revert "Update Scalar-List-Utils to CPAN version 1.51"
This reverts commit 96684a7. Failures with uselongdouble
1 parent 319c348 commit 7654aaa

File tree

9 files changed

+25
-88
lines changed

9 files changed

+25
-88
lines changed

Porting/Maintainers.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ package Maintainers;
946946
},
947947

948948
'Scalar::Util' => {
949-
'DISTRIBUTION' => 'PEVANS/Scalar-List-Utils-1.51.tar.gz',
949+
'DISTRIBUTION' => 'PEVANS/Scalar-List-Utils-1.50.tar.gz',
950950
'FILES' => q[cpan/Scalar-List-Utils],
951951
},
952952

cpan/Scalar-List-Utils/ListUtil.xs

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,15 +1177,12 @@ CODE:
11771177
/* clone the value so we don't invoke magic again */
11781178
arg = sv_mortalcopy(arg);
11791179

1180-
if(SvOK(arg) && !(SvUOK(arg) || SvIOK(arg) || SvNOK(arg)))
1181-
SvNV(arg); /* sets SVf_IOK/SVf_UOK if it's an integer */
1182-
1183-
if(!SvOK(arg) || SvUOK(arg))
1180+
if(SvUOK(arg))
11841181
sv_setpvf(keysv, "%" UVuf, SvUV(arg));
11851182
else if(SvIOK(arg))
11861183
sv_setpvf(keysv, "%" IVdf, SvIV(arg));
11871184
else
1188-
sv_setpvf(keysv, "%.15" NVgf, SvNV(arg));
1185+
sv_setpvf(keysv, "%" NVgf, SvNV(arg));
11891186
#ifdef HV_FETCH_EMPTY_HE
11901187
he = (HE*) hv_common(seen, NULL, SvPVX(keysv), SvCUR(keysv), 0, HV_FETCH_LVALUE | HV_FETCH_EMPTY_HE, NULL, 0);
11911188
if (HeVAL(he))
@@ -1604,18 +1601,15 @@ PPCODE:
16041601
/* under debugger, provide information about sub location */
16051602
if (PL_DBsub && CvGV(cv)) {
16061603
HV* DBsub = GvHV(PL_DBsub);
1607-
HE* old_data = NULL;
1604+
HE* old_data;
16081605

16091606
GV* oldgv = CvGV(cv);
16101607
HV* oldhv = GvSTASH(oldgv);
1608+
SV* old_full_name = sv_2mortal(newSVpvn_flags(HvNAME(oldhv), HvNAMELEN_get(oldhv), HvNAMEUTF8(oldhv) ? SVf_UTF8 : 0));
1609+
sv_catpvn(old_full_name, "::", 2);
1610+
sv_catpvn_flags(old_full_name, GvNAME(oldgv), GvNAMELEN(oldgv), GvNAMEUTF8(oldgv) ? SV_CATUTF8 : SV_CATBYTES);
16111611

1612-
if (oldhv) {
1613-
SV* old_full_name = sv_2mortal(newSVpvn_flags(HvNAME(oldhv), HvNAMELEN_get(oldhv), HvNAMEUTF8(oldhv) ? SVf_UTF8 : 0));
1614-
sv_catpvn(old_full_name, "::", 2);
1615-
sv_catpvn_flags(old_full_name, GvNAME(oldgv), GvNAMELEN(oldgv), GvNAMEUTF8(oldgv) ? SV_CATUTF8 : SV_CATBYTES);
1616-
1617-
old_data = hv_fetch_ent(DBsub, old_full_name, 0, 0);
1618-
}
1612+
old_data = hv_fetch_ent(DBsub, old_full_name, 0, 0);
16191613

16201614
if (old_data && HeVAL(old_data)) {
16211615
SV* new_full_name = sv_2mortal(newSVpvn_flags(HvNAME(stash), HvNAMELEN_get(stash), HvNAMEUTF8(stash) ? SVf_UTF8 : 0));
@@ -1666,7 +1660,6 @@ subname(code)
16661660
PREINIT:
16671661
CV *cv;
16681662
GV *gv;
1669-
const char *stashname;
16701663
PPCODE:
16711664
if (!SvROK(code) && SvGMAGICAL(code))
16721665
mg_get(code);
@@ -1677,12 +1670,7 @@ PPCODE:
16771670
if(!(gv = CvGV(cv)))
16781671
XSRETURN(0);
16791672

1680-
if(GvSTASH(gv))
1681-
stashname = HvNAME(GvSTASH(gv));
1682-
else
1683-
stashname = "__ANON__";
1684-
1685-
mPUSHs(newSVpvf("%s::%s", stashname, GvNAME(gv)));
1673+
mPUSHs(newSVpvf("%s::%s", HvNAME(GvSTASH(gv)), GvNAME(gv)));
16861674
XSRETURN(1);
16871675

16881676
BOOT:

cpan/Scalar-List-Utils/lib/List/Util.pm

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ our @EXPORT_OK = qw(
1515
all any first min max minstr maxstr none notall product reduce sum sum0 shuffle uniq uniqnum uniqstr
1616
head tail pairs unpairs pairkeys pairvalues pairmap pairgrep pairfirst
1717
);
18-
our $VERSION = "1.51";
18+
our $VERSION = "1.50";
1919
our $XS_VERSION = $VERSION;
20-
$VERSION =~ tr/_//d;
20+
$VERSION = eval $VERSION;
2121

2222
require XSLoader;
2323
XSLoader::load('List::Util', $XS_VERSION);
@@ -38,7 +38,6 @@ sub import
3838
# For objects returned by pairs()
3939
sub List::Util::_Pair::key { shift->[0] }
4040
sub List::Util::_Pair::value { shift->[1] }
41-
sub List::Util::_Pair::TO_JSON { [ @{+shift} ] }
4241

4342
=head1 NAME
4443
@@ -342,9 +341,6 @@ equivalent:
342341
...
343342
}
344343
345-
Since version C<1.51> they also have a C<TO_JSON> method to ease
346-
serialisation.
347-
348344
=head2 unpairs
349345
350346
my @kvlist = unpairs @pairs
@@ -561,8 +557,6 @@ entire list of values returned by C<uniqstr> are well-behaved as strings.
561557
562558
my @values = head $size, @list;
563559
564-
I<Since version 1.50.>
565-
566560
Returns the first C<$size> elements from C<@list>. If C<$size> is negative, returns
567561
all but the last C<$size> elements from C<@list>.
568562
@@ -576,8 +570,6 @@ all but the last C<$size> elements from C<@list>.
576570
577571
my @values = tail $size, @list;
578572
579-
I<Since version 1.50.>
580-
581573
Returns the last C<$size> elements from C<@list>. If C<$size> is negative, returns
582574
all but the first C<$size> elements from C<@list>.
583575

cpan/Scalar-List-Utils/lib/List/Util/XS.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use strict;
33
use warnings;
44
use List::Util;
55

6-
our $VERSION = "1.51"; # FIXUP
7-
$VERSION =~ tr/_//d; # FIXUP
6+
our $VERSION = "1.50"; # FIXUP
7+
$VERSION = eval $VERSION; # FIXUP
88

99
1;
1010
__END__

cpan/Scalar-List-Utils/lib/Scalar/Util.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ our @EXPORT_OK = qw(
1717
dualvar isdual isvstring looks_like_number openhandle readonly set_prototype
1818
tainted
1919
);
20-
our $VERSION = "1.51";
21-
$VERSION =~ tr/_//d;
20+
our $VERSION = "1.50";
21+
$VERSION = eval $VERSION;
2222

2323
require List::Util; # List::Util loads the XS
2424
List::Util->VERSION( $VERSION ); # Ensure we got the right XS version (RT#100863)
@@ -276,8 +276,8 @@ L<perlapi/looks_like_number>.
276276
277277
my $fh = openhandle( $fh );
278278
279-
Returns C<$fh> itself, if C<$fh> may be used as a filehandle and is open, or if
280-
it is a tied handle. Otherwise C<undef> is returned.
279+
Returns C<$fh> itself if C<$fh> may be used as a filehandle and is open, or is
280+
is a tied handle. Otherwise C<undef> is returned.
281281
282282
$fh = openhandle(*STDIN); # \*STDIN
283283
$fh = openhandle(\*STDIN); # \*STDIN

cpan/Scalar-List-Utils/lib/Sub/Util.pm

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ our @EXPORT_OK = qw(
1515
subname set_subname
1616
);
1717

18-
our $VERSION = "1.51";
19-
$VERSION =~ tr/_//d;
18+
our $VERSION = "1.50";
19+
$VERSION = eval $VERSION;
2020

2121
require List::Util; # as it has the XS
2222
List::Util->VERSION( $VERSION ); # Ensure we got the right XS version (RT#100863)
@@ -95,10 +95,8 @@ I<Since version 1.40.>
9595
Returns the name of the given C<$code> reference, if it has one. Normal named
9696
subs will give a fully-qualified name consisting of the package and the
9797
localname separated by C<::>. Anonymous code references will give C<__ANON__>
98-
as the localname. If the package the code was compiled in has been deleted
99-
(e.g. using C<delete_package> from L<Symbol>), C<__ANON__> will be returned as
100-
the package name. If a name has been set using L</set_subname>, this name will be
101-
returned instead.
98+
as the localname. If a name has been set using L</set_subname>, this name will
99+
be returned instead.
102100
103101
This function was inspired by C<sub_fullname> from L<Sub::Identify>. The
104102
remaining functions that C<Sub::Identify> implements can easily be emulated

cpan/Scalar-List-Utils/t/pair.t

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
use strict;
44
use warnings;
55

6-
use Test::More tests => 29;
6+
use Test::More tests => 27;
77
use List::Util qw(pairgrep pairfirst pairmap pairs unpairs pairkeys pairvalues);
8-
use Scalar::Util qw(blessed);
98

109
no warnings 'misc'; # avoid "Odd number of elements" warnings most of the time
1110

@@ -105,10 +104,6 @@ is_deeply( [ pairs one => 1, two => ],
105104
my @p = pairs one => 1, two => 2;
106105
is( $p[0]->key, "one", 'pairs ->key' );
107106
is( $p[0]->value, 1, 'pairs ->value' );
108-
is_deeply( $p[0]->TO_JSON,
109-
[ one => 1 ],
110-
'pairs ->TO_JSON' );
111-
ok( !blessed($p[0]->TO_JSON) , 'pairs ->TO_JSON is not blessed' );
112107
}
113108

114109
is_deeply( [ unpairs [ four => 4 ], [ five => 5 ], [ six => 6 ] ],

cpan/Scalar-List-Utils/t/subname.t

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ use warnings;
33

44
BEGIN { $^P |= 0x210 }
55

6-
use Test::More tests => 21;
6+
use Test::More tests => 18;
77

88
use B::Deparse;
99
use Sub::Util qw( subname set_subname );
10-
use Symbol qw( delete_package ) ;
1110

1211
{
1312
sub localfunc {}
@@ -79,18 +78,4 @@ is($x->(), "main::foo");
7978
'subname of set_subname');
8079
}
8180

82-
# this used to segfault
83-
84-
{
85-
sub ToDelete::foo {}
86-
87-
my $foo = \&ToDelete::foo;
88-
89-
delete_package 'ToDelete';
90-
91-
is( subname($foo), "$]" >= 5.010 ? '__ANON__::foo' : 'ToDelete::foo', 'subname in deleted package' );
92-
ok( set_subname('NewPackage::foo', $foo), 'rename from deleted package' );
93-
is( subname($foo), 'NewPackage::foo', 'subname after rename' );
94-
}
95-
9681
# vim: ft=perl

cpan/Scalar-List-Utils/t/uniq.t

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use strict;
44
use warnings;
55

6-
use Test::More tests => 33;
6+
use Test::More tests => 30;
77
use List::Util qw( uniqnum uniqstr uniq );
88

99
use Tie::Array;
@@ -75,18 +75,6 @@ is_deeply( [ uniqnum qw( 1 1.1 1.2 1.3 ) ],
7575
[ 1, 1.1, 1.2, 1.3 ],
7676
'uniqnum distinguishes floats' );
7777

78-
{
79-
my @nums = map $_+0.1, 1e7..1e7+5;
80-
is_deeply( [ uniqnum @nums ],
81-
[ @nums ],
82-
'uniqnum distinguishes large floats' );
83-
84-
my @strings = map "$_", @nums;
85-
is_deeply( [ uniqnum @strings ],
86-
[ @strings ],
87-
'uniqnum distinguishes large floats (stringified)' );
88-
}
89-
9078
# Hard to know for sure what an Inf is going to be. Lets make one
9179
my $Inf = 0 + 1E1000;
9280
my $NaN;
@@ -96,7 +84,7 @@ is_deeply( [ uniqnum 0, 1, 12345, $Inf, -$Inf, $NaN, 0, $Inf, $NaN ],
9684
[ 0, 1, 12345, $Inf, -$Inf, $NaN ],
9785
'uniqnum preserves the special values of +-Inf and Nan' );
9886

99-
SKIP: {
87+
{
10088
my $maxuint = ~0;
10189
my $maxint = ~0 >> 1;
10290
my $minint = -(~0 >> 1) - 1;
@@ -106,15 +94,6 @@ SKIP: {
10694
is_deeply( [ uniqnum @nums, 1.0 ],
10795
[ @nums ],
10896
'uniqnum preserves uniqness of full integer range' );
109-
110-
my @strs = map "$_", @nums;
111-
112-
skip( "Perl $] doesn't stringify UV_MAX right ($maxuint)", 1 )
113-
if $maxuint !~ /\A[0-9]+\z/;
114-
115-
is_deeply( [ uniqnum @strs, "1.0" ],
116-
[ @strs ],
117-
'uniqnum preserves uniqness of full integer range (stringified)' );
11897
}
11998

12099
{

0 commit comments

Comments
 (0)