summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-10-15 19:38:08 +0100
committerNicholas Clark <nick@ccl4.org>2009-10-15 21:27:49 +0100
commit352e1c09cf09498d4917c120c2055943a4301c0a (patch)
tree49947f84102d5916d2b432725e917a9489f5527d /ext
parent6beb30a667e08397498a369fab75270de918b033 (diff)
downloadperl-352e1c09cf09498d4917c120c2055943a4301c0a.tar.gz
Use gv_stashsv() and gv_fetchpvs(), the later with proper arguments.
Brought to you by the Campaign for the Elimination of strlen(). (And the elimination of accidental bugs due to typos in lenghts of constants, and the elimination of abuse of boolean constants for parameters with more than 2 values.)
Diffstat (limited to 'ext')
-rw-r--r--ext/Opcode/Opcode.pm2
-rw-r--r--ext/Opcode/Opcode.xs12
2 files changed, 7 insertions, 7 deletions
diff --git a/ext/Opcode/Opcode.pm b/ext/Opcode/Opcode.pm
index 31b6f4471c..9dbbce0b5d 100644
--- a/ext/Opcode/Opcode.pm
+++ b/ext/Opcode/Opcode.pm
@@ -6,7 +6,7 @@ use strict;
our($VERSION, @ISA, @EXPORT_OK);
-$VERSION = "1.14";
+$VERSION = "1.15";
use Carp;
use Exporter ();
diff --git a/ext/Opcode/Opcode.xs b/ext/Opcode/Opcode.xs
index 4bcb2e47de..5f2979cb85 100644
--- a/ext/Opcode/Opcode.xs
+++ b/ext/Opcode/Opcode.xs
@@ -260,12 +260,12 @@ BOOT:
void
_safe_pkg_prep(Package)
- const char *Package
+ SV *Package
PPCODE:
HV *hv;
ENTER;
- hv = gv_stashpv(Package, GV_ADDWARN); /* should exist already */
+ hv = gv_stashsv(Package, GV_ADDWARN); /* should exist already */
if (strNE(HvNAME_get(hv),"main")) {
/* make it think it's in main:: */
@@ -281,7 +281,7 @@ PPCODE:
void
_safe_call_sv(Package, mask, codesv)
- char * Package
+ SV * Package
SV * mask
SV * codesv
PPCODE:
@@ -298,7 +298,7 @@ PPCODE:
save_hptr(&PL_defstash); /* save current default stash */
/* the assignment to global defstash changes our sense of 'main' */
- PL_defstash = gv_stashpv(Package, GV_ADDWARN); /* should exist already */
+ PL_defstash = gv_stashsv(Package, GV_ADDWARN); /* should exist already */
save_hptr(&PL_curstash);
PL_curstash = PL_defstash;
@@ -306,13 +306,13 @@ PPCODE:
/* defstash must itself contain a main:: so we'll add that now */
/* take care with the ref counts (was cause of long standing bug) */
/* XXX I'm still not sure if this is right, GV_ADDWARN should warn! */
- gv = gv_fetchpv("main::", GV_ADDWARN, SVt_PVHV);
+ gv = gv_fetchpvs("main::", GV_ADDWARN, SVt_PVHV);
sv_free((SV*)GvHV(gv));
GvHV(gv) = (HV*)SvREFCNT_inc(PL_defstash);
/* %INC must be clean for use/require in compartment */
dummy_hv = save_hash(PL_incgv);
- GvHV(PL_incgv) = (HV*)SvREFCNT_inc(GvHV(gv_HVadd(gv_fetchpv("INC",TRUE,SVt_PVHV))));
+ GvHV(PL_incgv) = (HV*)SvREFCNT_inc(GvHV(gv_HVadd(gv_fetchpvs("INC",GV_ADD,SVt_PVHV))));
/* Invalidate ISA and method caches */
++PL_sub_generation;