diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-10-01 22:13:26 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-10-06 13:01:00 -0700 |
commit | 0fe84f7c4203febe7385a57fe43af2ee032318cf (patch) | |
tree | 7400788214696d457c6b2455adfefe2b5406883b /ext/XS-APItest | |
parent | aa1e761e6b2ad2f51373c7d89c32d7770fba38df (diff) | |
download | perl-0fe84f7c4203febe7385a57fe43af2ee032318cf.tar.gz |
Remove 4 from new gv_autoload4_(sv|pvn?) functions
The 4 was added in commit 54310121b442 (inseparable changes during
5.003/4 developement), presumably the ‘Don't look up &AUTOLOAD in @ISA
when calling plain function’ part.
Before that, gv_autoload had three arguments, so the 4 indicated the
new version (with the method argument).
Since these new functions don’t all have four arguments, and since
they have a new naming convention, there is not reason for the 4.
Diffstat (limited to 'ext/XS-APItest')
-rw-r--r-- | ext/XS-APItest/APItest.xs | 8 | ||||
-rw-r--r-- | ext/XS-APItest/t/gv_autoload4.t | 24 |
2 files changed, 16 insertions, 16 deletions
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs index d0fa057f81..618bd32dc8 100644 --- a/ext/XS-APItest/APItest.xs +++ b/ext/XS-APItest/APItest.xs @@ -1953,7 +1953,7 @@ gv_fetchmethod_flags_type(stash, methname, type, flags) XPUSHs( gv ? (SV*)gv : &PL_sv_undef); void -gv_autoload4_type(stash, methname, type, method, flags) +gv_autoload_type(stash, methname, type, method, flags) HV* stash SV* methname int type @@ -1969,13 +1969,13 @@ gv_autoload4_type(stash, methname, type, method, flags) gv = gv_autoload4(stash, name, len, method); break; case 1: - gv = gv_autoload4_sv(stash, methname, method, flags); + gv = gv_autoload_sv(stash, methname, method, flags); break; case 2: - gv = gv_autoload4_pv(stash, name, method, flags | SvUTF8(methname)); + gv = gv_autoload_pv(stash, name, method, flags | SvUTF8(methname)); break; case 3: - gv = gv_autoload4_pvn(stash, name, len, method, flags | SvUTF8(methname)); + gv = gv_autoload_pvn(stash, name, len, method, flags | SvUTF8(methname)); break; } XPUSHs( gv ? (SV*)gv : &PL_sv_undef); diff --git a/ext/XS-APItest/t/gv_autoload4.t b/ext/XS-APItest/t/gv_autoload4.t index beec17e130..dc4e2270a8 100644 --- a/ext/XS-APItest/t/gv_autoload4.t +++ b/ext/XS-APItest/t/gv_autoload4.t @@ -8,7 +8,7 @@ use Test::More tests => 19; #31; use_ok('XS::APItest'); my $method = 0; -my @types = map { 'gv_autoload4' . $_ } '', qw( _sv _pv _pvn ); +my @types = map { 'gv_autoload' . $_ } qw( 4 _sv _pv _pvn ); sub AUTOLOAD { our $AUTOLOAD; @@ -18,28 +18,28 @@ sub AUTOLOAD { my $sub = "nothing"; -ok my $glob = XS::APItest::gv_autoload4_type(\%::, $sub, 1, $method, 0); +ok my $glob = XS::APItest::gv_autoload_type(\%::, $sub, 1, $method, 0); *{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, '$AUTOLOAD set correctly' ); $sub = "some_sub"; for my $type ( 0..3 ) { - is $glob = XS::APItest::gv_autoload4_type(\%::, $sub, $type, $method, 0), "*main::AUTOLOAD", "*main::AUTOLOAD if autoload is true in $types[$type]."; + is $glob = XS::APItest::gv_autoload_type(\%::, $sub, $type, $method, 0), "*main::AUTOLOAD", "*main::AUTOLOAD if autoload is true in $types[$type]."; *{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, '$AUTOLOAD set correctly' ); } $sub = "method\0not quite!"; -ok $glob = XS::APItest::gv_autoload4_type(\%::, $sub, 0, $method, 0); +ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 0, $method, 0); *{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, "gv_autoload4() is nul-clean"); -ok $glob = XS::APItest::gv_autoload4_type(\%::, $sub, 1, $method, 0); -*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, "gv_autoload4_sv() is nul-clean"); +ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 1, $method, 0); +*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, "gv_autoload_sv() is nul-clean"); -ok $glob = XS::APItest::gv_autoload4_type(\%::, $sub, 2, $method, 0); -*{$glob}{CODE}->( __PACKAGE__ . "::" . ($sub =~ s/\0.*//r), "gv_autoload4_pv() is not nul-clean"); +ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 2, $method, 0); +*{$glob}{CODE}->( __PACKAGE__ . "::" . ($sub =~ s/\0.*//r), "gv_autoload_pv() is not nul-clean"); -ok $glob = XS::APItest::gv_autoload4_type(\%::, $sub, 3, $method, 0); -*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, "gv_autoload4_pvn() is nul-clean"); +ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 3, $method, 0); +*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, "gv_autoload_pvn() is nul-clean"); =begin { @@ -55,9 +55,9 @@ ok $glob = XS::APItest::gv_autoload4_type(\%::, $sub, 3, $method, 0); } for my $type ( 1..3 ) { - ::ok $glob = XS::APItest::gv_autoload4_type(\%main::, $sub = "method", $type, $method, 0); + ::ok $glob = XS::APItest::gv_autoload_type(\%main::, $sub = "method", $type, $method, 0); *{$glob}{CODE}->( "main::" . $sub, "$types[$type]() is UTF8-clean when both the stash and the sub are in UTF-8"); - ::ok $glob = XS::APItest::gv_autoload4_type(\%main::, $sub = "method", $type, $method, 0); + ::ok $glob = XS::APItest::gv_autoload_type(\%main::, $sub = "method", $type, $method, 0); *{$glob}{CODE}->( "main::" . $sub, "$types[$type]() is UTF8-clean when only the stash is in UTF-8"); } } |