summaryrefslogtreecommitdiff
path: root/ext/XS-APItest
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-10-01 22:14:19 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 13:01:00 -0700
commit0eeb01b957d2d66eec1a0e1e347c6d8772e5284e (patch)
tree110f9778173d6a76d65b152c2344eb48f09bc692 /ext/XS-APItest
parent0fe84f7c4203febe7385a57fe43af2ee032318cf (diff)
downloadperl-0eeb01b957d2d66eec1a0e1e347c6d8772e5284e.tar.gz
Remove method param from gv_autoload_*
method is a boolean flag (typed I32, but used as a boolean) added by commit 54310121b442. These new gv_autoload_* functions have a flags parameter, so there’s no reason for this extra effective bool. We can just use a flag bit.
Diffstat (limited to 'ext/XS-APItest')
-rw-r--r--ext/XS-APItest/APItest.xs10
-rw-r--r--ext/XS-APItest/t/gv_autoload4.t16
2 files changed, 13 insertions, 13 deletions
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs
index 618bd32dc8..6ef52d1b8f 100644
--- a/ext/XS-APItest/APItest.xs
+++ b/ext/XS-APItest/APItest.xs
@@ -1953,29 +1953,29 @@ gv_fetchmethod_flags_type(stash, methname, type, flags)
XPUSHs( gv ? (SV*)gv : &PL_sv_undef);
void
-gv_autoload_type(stash, methname, type, method, flags)
+gv_autoload_type(stash, methname, type, method)
HV* stash
SV* methname
int type
I32 method
- I32 flags
PREINIT:
STRLEN len;
const char * const name = SvPV_const(methname, len);
GV* gv;
+ I32 flags = method ? GV_AUTOLOAD_ISMETHOD : 0;
PPCODE:
switch (type) {
case 0:
gv = gv_autoload4(stash, name, len, method);
break;
case 1:
- gv = gv_autoload_sv(stash, methname, method, flags);
+ gv = gv_autoload_sv(stash, methname, flags);
break;
case 2:
- gv = gv_autoload_pv(stash, name, method, flags | SvUTF8(methname));
+ gv = gv_autoload_pv(stash, name, flags | SvUTF8(methname));
break;
case 3:
- gv = gv_autoload_pvn(stash, name, len, method, flags | SvUTF8(methname));
+ gv = gv_autoload_pvn(stash, name, len, 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 dc4e2270a8..1f57437168 100644
--- a/ext/XS-APItest/t/gv_autoload4.t
+++ b/ext/XS-APItest/t/gv_autoload4.t
@@ -18,27 +18,27 @@ sub AUTOLOAD {
my $sub = "nothing";
-ok my $glob = XS::APItest::gv_autoload_type(\%::, $sub, 1, $method, 0);
+ok my $glob = XS::APItest::gv_autoload_type(\%::, $sub, 1, $method);
*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, '$AUTOLOAD set correctly' );
$sub = "some_sub";
for my $type ( 0..3 ) {
- is $glob = XS::APItest::gv_autoload_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), "*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_autoload_type(\%::, $sub, 0, $method, 0);
+ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 0, $method);
*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, "gv_autoload4() is nul-clean");
-ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 1, $method, 0);
+ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 1, $method);
*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, "gv_autoload_sv() is nul-clean");
-ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 2, $method, 0);
+ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 2, $method);
*{$glob}{CODE}->( __PACKAGE__ . "::" . ($sub =~ s/\0.*//r), "gv_autoload_pv() is not nul-clean");
-ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 3, $method, 0);
+ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 3, $method);
*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, "gv_autoload_pvn() is nul-clean");
=begin
@@ -55,9 +55,9 @@ ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 3, $method, 0);
}
for my $type ( 1..3 ) {
- ::ok $glob = XS::APItest::gv_autoload_type(\%main::, $sub = "method", $type, $method, 0);
+ ::ok $glob = XS::APItest::gv_autoload_type(\%main::, $sub = "method", $type, $method);
*{$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_autoload_type(\%main::, $sub = "method", $type, $method, 0);
+ ::ok $glob = XS::APItest::gv_autoload_type(\%main::, $sub = "method", $type, $method);
*{$glob}{CODE}->( "main::" . $sub, "$types[$type]() is UTF8-clean when only the stash is in UTF-8");
}
}