From: Marcus Holland-Moritz Date: Tue, 11 Sep 2007 21:45:40 +0000 (+0000) Subject: Upgrade to Devel::PPPort 3.11_06 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aab9a3b697e77c80c3ac8b3db60730d246a5fbf5;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Devel::PPPort 3.11_06 p4raw-id: //depot/perl@31848 --- diff --git a/ext/Devel/PPPort/Changes b/ext/Devel/PPPort/Changes index 5ec0158..822e3df 100755 --- a/ext/Devel/PPPort/Changes +++ b/ext/Devel/PPPort/Changes @@ -1,3 +1,13 @@ +3.11_06 - 2007-09-11 + + * fix cpan #29302: Perl_croak_nocontext doesn't need aTHX_ + (spotted by Jerry D. Hedden) + * fix a Win32 VC++ compiler warning (thanks to Steve Hay for + providing a patch) + * don't generate redundant specs for provided Perl_ functions + * fun with const and casts to avoid compiler warnings + * bump max supported version to 5.10.0 + 3.11_05 - 2007-08-20 * fix: PERL_HASH() was emitting a warning when passed in a diff --git a/ext/Devel/PPPort/PPPort_pm.PL b/ext/Devel/PPPort/PPPort_pm.PL index 0b682a7..f670f78 100644 --- a/ext/Devel/PPPort/PPPort_pm.PL +++ b/ext/Devel/PPPort/PPPort_pm.PL @@ -4,9 +4,9 @@ # ################################################################################ # -# $Revision: 55 $ +# $Revision: 57 $ # $Author: mhx $ -# $Date: 2007/08/19 19:41:37 +0200 $ +# $Date: 2007/09/11 23:28:24 +0200 $ # ################################################################################ # @@ -82,6 +82,7 @@ for (@api) { my @perl_api; for (keys %provides) { + next if /^Perl_(.*)/ && exists $embed{$1}; next if exists $embed{$_}; push @perl_api, $_; check(2, "No API definition for provided element $_ found."); @@ -125,7 +126,7 @@ $data =~ s{^__UNSUPPORTED_API__(\s*?)^} {join "\n", @todo}gem; $data =~ s{__MIN_PERL__}{5.003}g; -$data =~ s{__MAX_PERL__}{5.9.5}g; +$data =~ s{__MAX_PERL__}{5.10.0}g; open FH, ">PPPort.pm" or die "PPPort.pm: $!\n"; print FH $data; @@ -344,9 +345,9 @@ __DATA__ # ################################################################################ # -# $Revision: 55 $ +# $Revision: 57 $ # $Author: mhx $ -# $Date: 2007/08/19 19:41:37 +0200 $ +# $Date: 2007/09/11 23:28:24 +0200 $ # ################################################################################ # @@ -507,7 +508,7 @@ package Devel::PPPort; use strict; use vars qw($VERSION $data); -$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.11_05 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' }; +$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.11_06 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' }; sub _init_data { diff --git a/ext/Devel/PPPort/TODO b/ext/Devel/PPPort/TODO index dc83cc9..ce07d8a 100644 --- a/ext/Devel/PPPort/TODO +++ b/ext/Devel/PPPort/TODO @@ -1,7 +1,5 @@ TODO: -* bump __MAX_PERL__ before 5.10 - * > 3. In several cases, "perl ppport.h --copy=.new" output a new file in > which the only change was the addition of "#include "ppport.h"". In each > case, that actually wasn't necessary because the source file in question diff --git a/ext/Devel/PPPort/parts/inc/SvPV b/ext/Devel/PPPort/parts/inc/SvPV index 88b83ef..ec89cb1 100644 --- a/ext/Devel/PPPort/parts/inc/SvPV +++ b/ext/Devel/PPPort/parts/inc/SvPV @@ -1,8 +1,8 @@ ################################################################################ ## -## $Revision: 17 $ +## $Revision: 18 $ ## $Author: mhx $ -## $Date: 2007/08/13 22:59:33 +0200 $ +## $Date: 2007/09/11 23:19:51 +0200 $ ## ################################################################################ ## @@ -56,7 +56,7 @@ __UNDEFINED__ sv_2pv_nolen(sv) SvPV_nolen(sv) #if { NEED sv_2pvbyte } char * -sv_2pvbyte(pTHX_ register SV *sv, STRLEN *lp) +sv_2pvbyte(pTHX_ SV *sv, STRLEN *lp) { sv_utf8_downgrade(sv,0); return SvPV(sv,*lp); diff --git a/ext/Devel/PPPort/parts/inc/grok b/ext/Devel/PPPort/parts/inc/grok index dce2467..e6dc979 100644 --- a/ext/Devel/PPPort/parts/inc/grok +++ b/ext/Devel/PPPort/parts/inc/grok @@ -1,8 +1,8 @@ ################################################################################ ## -## $Revision: 13 $ +## $Revision: 14 $ ## $Author: mhx $ -## $Date: 2007/08/12 23:57:10 +0200 $ +## $Date: 2007/09/11 23:20:41 +0200 $ ## ################################################################################ ## @@ -292,7 +292,7 @@ grok_number(pTHX_ const char *pv, STRLEN len, UV *valuep) #ifndef grok_bin #if { NEED grok_bin } UV -grok_bin(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) +grok_bin(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) { const char *s = start; STRLEN len = *len_p; @@ -381,7 +381,7 @@ grok_bin(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) #ifndef grok_hex #if { NEED grok_hex } UV -grok_hex(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) +grok_hex(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) { const char *s = start; STRLEN len = *len_p; @@ -470,7 +470,7 @@ grok_hex(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) #ifndef grok_oct #if { NEED grok_oct } UV -grok_oct(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) +grok_oct(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) { const char *s = start; STRLEN len = *len_p; diff --git a/ext/Devel/PPPort/parts/inc/magic b/ext/Devel/PPPort/parts/inc/magic index 48064e3..2cdd720 100644 --- a/ext/Devel/PPPort/parts/inc/magic +++ b/ext/Devel/PPPort/parts/inc/magic @@ -1,8 +1,8 @@ ################################################################################ ## -## $Revision: 14 $ +## $Revision: 15 $ ## $Author: mhx $ -## $Date: 2007/08/20 19:19:24 +0200 $ +## $Date: 2007/09/11 23:20:42 +0200 $ ## ################################################################################ ## @@ -312,7 +312,7 @@ sv_magic_portable(sv) mg = mg_find(sv, '~'); RETVAL = mg->mg_ptr == foo; #else - sv_magic(sv, 0, '~', foo, strlen(foo)); + sv_magic(sv, 0, '~', (char *) foo, strlen(foo)); mg = mg_find(sv, '~'); RETVAL = strEQ(mg->mg_ptr, foo); #endif diff --git a/ext/Devel/PPPort/parts/inc/newCONSTSUB b/ext/Devel/PPPort/parts/inc/newCONSTSUB index 9539bcf..02cbf41 100644 --- a/ext/Devel/PPPort/parts/inc/newCONSTSUB +++ b/ext/Devel/PPPort/parts/inc/newCONSTSUB @@ -1,8 +1,8 @@ ################################################################################ ## -## $Revision: 11 $ +## $Revision: 12 $ ## $Author: mhx $ -## $Date: 2007/01/02 12:32:33 +0100 $ +## $Date: 2007/09/11 23:20:42 +0200 $ ## ################################################################################ ## @@ -31,7 +31,7 @@ newCONSTSUB #if { NEED newCONSTSUB } void -newCONSTSUB(HV *stash, char *name, SV *sv) +newCONSTSUB(HV *stash, const char *name, SV *sv) { U32 oldhints = PL_hints; HV *old_cop_stash = PL_curcop->cop_stash; @@ -53,7 +53,7 @@ newCONSTSUB(HV *stash, char *name, SV *sv) start_subparse(FALSE, 0), #endif - newSVOP(OP_CONST, 0, newSVpv(name,0)), + newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)), newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */ newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv)) ); diff --git a/ext/Devel/PPPort/parts/inc/ppphbin b/ext/Devel/PPPort/parts/inc/ppphbin index 3a1c1eb..74dadd6 100644 --- a/ext/Devel/PPPort/parts/inc/ppphbin +++ b/ext/Devel/PPPort/parts/inc/ppphbin @@ -1,8 +1,8 @@ ################################################################################ ## -## $Revision: 44 $ +## $Revision: 45 $ ## $Author: mhx $ -## $Date: 2007/08/20 18:21:09 +0200 $ +## $Date: 2007/09/11 23:18:31 +0200 $ ## ################################################################################ ## @@ -386,11 +386,13 @@ for $filename (@files) { for $func (sort keys %{$file{uses_Perl}}) { if ($API{$func}{varargs}) { - my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))} - { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge); - if ($changes) { - warning("Doesn't pass interpreter argument aTHX to Perl_$func"); - $file{changes} += $changes; + unless ($API{$func}{nothxarg}) { + my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))} + { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge); + if ($changes) { + warning("Doesn't pass interpreter argument aTHX to Perl_$func"); + $file{changes} += $changes; + } } } else { diff --git a/ext/Devel/PPPort/parts/inc/ppphtest b/ext/Devel/PPPort/parts/inc/ppphtest index d1cd7aa..71a97b1 100644 --- a/ext/Devel/PPPort/parts/inc/ppphtest +++ b/ext/Devel/PPPort/parts/inc/ppphtest @@ -1,8 +1,8 @@ ################################################################################ ## -## $Revision: 40 $ +## $Revision: 41 $ ## $Author: mhx $ -## $Date: 2007/08/20 18:06:48 +0200 $ +## $Date: 2007/09/11 23:18:33 +0200 $ ## ################################################################################ ## @@ -15,11 +15,11 @@ ## ################################################################################ -=tests plan => 225 +=tests plan => 229 BEGIN { if ($ENV{'SKIP_SLOW_TESTS'}) { - for (1 .. 225) { + for (1 .. 229) { skip("skip: SKIP_SLOW_TESTS", 0); } exit 0; @@ -850,3 +850,44 @@ a_char = 'sv_yes' # define SOMETHING_ELSE PL_defgv + \ PL_sv_undef +=============================================================================== + +my $o = ppport(qw(--copy=f)); + +for (qw(file.xs)) { + ok($o =~ /^Writing copy of.*\Q$_\E.*with changes/mi); + ok(-e "${_}f"); + ok(eq_files("${_}f", "${_}r")); + unlink "${_}f"; +} + +---------------------------- file.xs ----------------------------------------- + +#define NEED_sv_2pv_flags +#define NEED_vnewSVpvf +#define NEED_warner +#include "ppport.h" +Perl_croak_nocontext("foo"); +Perl_croak("bar"); +croak("foo"); +croak_nocontext("foo"); +Perl_warner_nocontext("foo"); +Perl_warner("foo"); +warner_nocontext("foo"); +warner("foo"); + +---------------------------- file.xsr ----------------------------------------- + +#define NEED_sv_2pv_flags +#define NEED_vnewSVpvf +#define NEED_warner +#include "ppport.h" +Perl_croak_nocontext("foo"); +Perl_croak(aTHX_ "bar"); +croak("foo"); +croak_nocontext("foo"); +Perl_warner_nocontext("foo"); +Perl_warner(aTHX_ "foo"); +warner_nocontext("foo"); +warner("foo"); + diff --git a/ext/Devel/PPPort/parts/inc/shared_pv b/ext/Devel/PPPort/parts/inc/shared_pv index 8fbf4c8..ee3d6ea 100644 --- a/ext/Devel/PPPort/parts/inc/shared_pv +++ b/ext/Devel/PPPort/parts/inc/shared_pv @@ -1,8 +1,8 @@ ################################################################################ ## -## $Revision: 1 $ +## $Revision: 3 $ ## $Author: mhx $ -## $Date: 2007/08/19 19:38:17 +0200 $ +## $Date: 2007/09/11 23:20:42 +0200 $ ## ################################################################################ ## @@ -33,7 +33,7 @@ newSVpvn_share(pTHX_ const char *src, I32 len, U32 hash) if (len < 0) len = -len; if (!hash) - PERL_HASH(hash, src, len); + PERL_HASH(hash, (char*) src, len); sv = newSVpvn((char *) src, len); sv_upgrade(sv, SVt_PVIV); SvIVX(sv) = hash; @@ -65,7 +65,7 @@ newSVpvn_share() RETVAL = 0; s = "mhx"; len = 3; - PERL_HASH(hash, s, len); + PERL_HASH(hash, (char *) s, len); sv = newSVpvn_share(s, len, 0); s = 0; RETVAL += strEQ(SvPV_nolen_const(sv), "mhx"); @@ -74,8 +74,8 @@ newSVpvn_share() SvREFCNT_dec(sv); s = "foobar"; len = 6; - PERL_HASH(hash, s, len); - sv = newSVpvn_share(s, -len, hash); + PERL_HASH(hash, (char *) s, len); + sv = newSVpvn_share(s, -(I32) len, hash); s = 0; RETVAL += strEQ(SvPV_nolen_const(sv), "foobar"); RETVAL += SvCUR(sv) == len; diff --git a/ext/Devel/PPPort/parts/inc/sv_xpvf b/ext/Devel/PPPort/parts/inc/sv_xpvf index 7a4d588..5de173a 100644 --- a/ext/Devel/PPPort/parts/inc/sv_xpvf +++ b/ext/Devel/PPPort/parts/inc/sv_xpvf @@ -1,8 +1,8 @@ ################################################################################ ## -## $Revision: 7 $ +## $Revision: 8 $ ## $Author: mhx $ -## $Date: 2007/08/12 23:57:10 +0200 $ +## $Date: 2007/09/11 23:20:43 +0200 $ ## ################################################################################ ## @@ -175,7 +175,7 @@ static SV * test_vnewSVpvf(pTHX_ const char *pat, ...) #if { VERSION >= 5.004 } sv = vnewSVpvf(pat, &args); #else - sv = newSVpv(pat, 0); + sv = newSVpv((char *) pat, 0); #endif va_end(args); return sv; @@ -188,7 +188,7 @@ static void test_sv_vcatpvf(pTHX_ SV *sv, const char *pat, ...) #if { VERSION >= 5.004 } sv_vcatpvf(sv, pat, &args); #else - sv_catpv(sv, pat); + sv_catpv(sv, (char *) pat); #endif va_end(args); } @@ -200,7 +200,7 @@ static void test_sv_vsetpvf(pTHX_ SV *sv, const char *pat, ...) #if { VERSION >= 5.004 } sv_vsetpvf(sv, pat, &args); #else - sv_setpv(sv, pat); + sv_setpv(sv, (char *) pat); #endif va_end(args); } diff --git a/ext/Devel/PPPort/parts/inc/variables b/ext/Devel/PPPort/parts/inc/variables index d34b9c5..85dd180 100644 --- a/ext/Devel/PPPort/parts/inc/variables +++ b/ext/Devel/PPPort/parts/inc/variables @@ -1,8 +1,8 @@ ################################################################################ ## -## $Revision: 11 $ +## $Revision: 12 $ ## $Author: mhx $ -## $Date: 2007/08/13 00:31:48 +0200 $ +## $Date: 2007/09/11 23:20:43 +0200 $ ## ################################################################################ ## @@ -240,7 +240,7 @@ PL_rsfp_filters() SV * PL_hexdigit() CODE: - RETVAL = newSVpv(PL_hexdigit, 0); + RETVAL = newSVpv((char *) PL_hexdigit, 0); OUTPUT: RETVAL diff --git a/ext/Devel/PPPort/soak b/ext/Devel/PPPort/soak index 242e5ad..a240270 100644 --- a/ext/Devel/PPPort/soak +++ b/ext/Devel/PPPort/soak @@ -33,7 +33,7 @@ use File::Find; use List::Util qw(max); use Config; -my $VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.11_05 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' }; +my $VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.11_06 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' }; $| = 1; my %OPT = ( diff --git a/ext/Devel/PPPort/t/ppphtest.t b/ext/Devel/PPPort/t/ppphtest.t index f84f21b..56f83b3 100644 --- a/ext/Devel/PPPort/t/ppphtest.t +++ b/ext/Devel/PPPort/t/ppphtest.t @@ -30,9 +30,9 @@ BEGIN { require 'testutil.pl' if $@; } - if (225) { + if (229) { load(); - plan(tests => 225); + plan(tests => 229); } } @@ -50,7 +50,7 @@ package main; BEGIN { if ($ENV{'SKIP_SLOW_TESTS'}) { - for (1 .. 225) { + for (1 .. 229) { skip("skip: SKIP_SLOW_TESTS", 0); } exit 0; @@ -881,3 +881,44 @@ a_char = 'sv_yes' # define SOMETHING_ELSE PL_defgv + \ PL_sv_undef +=============================================================================== + +my $o = ppport(qw(--copy=f)); + +for (qw(file.xs)) { + ok($o =~ /^Writing copy of.*\Q$_\E.*with changes/mi); + ok(-e "${_}f"); + ok(eq_files("${_}f", "${_}r")); + unlink "${_}f"; +} + +---------------------------- file.xs ----------------------------------------- + +#define NEED_sv_2pv_flags +#define NEED_vnewSVpvf +#define NEED_warner +#include "ppport.h" +Perl_croak_nocontext("foo"); +Perl_croak("bar"); +croak("foo"); +croak_nocontext("foo"); +Perl_warner_nocontext("foo"); +Perl_warner("foo"); +warner_nocontext("foo"); +warner("foo"); + +---------------------------- file.xsr ----------------------------------------- + +#define NEED_sv_2pv_flags +#define NEED_vnewSVpvf +#define NEED_warner +#include "ppport.h" +Perl_croak_nocontext("foo"); +Perl_croak(aTHX_ "bar"); +croak("foo"); +croak_nocontext("foo"); +Perl_warner_nocontext("foo"); +Perl_warner(aTHX_ "foo"); +warner_nocontext("foo"); +warner("foo"); +