summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-06-25 18:42:45 -0600
committerKarl Williamson <public@khwilliamson.com>2013-06-25 18:59:51 -0600
commitb3e714770ee1b3012dc2480cc4bc33146b13e6d5 (patch)
tree4fc763db40ab30338a2261f77ebf0c3cfd03ed47 /gv.c
parent1c8b67b38f0a53a8eee6b8fa0ed6fa49e4c25cc7 (diff)
downloadperl-b3e714770ee1b3012dc2480cc4bc33146b13e6d5.tar.gz
Revert "Use UTF8f in more places"
This reverts commit acc19697c67fa63c10e07491b670a26c48f4175f. This and the other UTF8f patch are causing significant problems on some configurations on 32-bit platforms. We've decided to revert them until they can be resubmitted after the kinks get ironed out.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/gv.c b/gv.c
index 87e94b0c7a..9658362e3e 100644
--- a/gv.c
+++ b/gv.c
@@ -1026,9 +1026,10 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN le
return gv;
}
Perl_croak(aTHX_
- "Can't locate object method \"%"UTF8f
+ "Can't locate object method \"%"SVf
"\" via package \"%"HEKf"\"",
- is_utf8, nend - name, name,
+ SVfARG(newSVpvn_flags(name, nend - name,
+ SVs_TEMP | is_utf8)),
HEKfARG(HvNAME_HEK(stash)));
}
else {
@@ -1137,10 +1138,9 @@ Perl_gv_autoload_pvn(pTHX_ HV *stash, const char *name, STRLEN len, U32 flags)
&& (GvCVGEN(gv) || GvSTASH(gv) != stash)
)
Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
- "Use of inherited AUTOLOAD for non-method %"SVf
- "::%"UTF8f"() is deprecated",
+ "Use of inherited AUTOLOAD for non-method %"SVf"::%"SVf"() is deprecated",
SVfARG(packname),
- is_utf8, len, name);
+ SVfARG(newSVpvn_flags(name, len, SVs_TEMP | is_utf8)));
if (CvISXSUB(cv)) {
/* Instead of forcing the XSUB do another lookup for $AUTOLOAD
@@ -1410,7 +1410,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
const char *name = nambeg;
GV *gv = NULL;
GV**gvp;
- STRLEN len;
+ I32 len;
const char *name_cursor;
HV *stash = NULL;
const I32 no_init = flags & (GV_NOADD_NOINIT | GV_NOINIT);
@@ -1569,18 +1569,18 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
(sv_type == SVt_PVAV && !GvIMPORTED_AV(*gvp)) ||
(sv_type == SVt_PVHV && !GvIMPORTED_HV(*gvp)) )
{
+ SV* namesv = newSVpvn_flags(name, len, SVs_TEMP | is_utf8);
/* diag_listed_as: Variable "%s" is not imported%s */
Perl_ck_warner_d(
aTHX_ packWARN(WARN_MISC),
- "Variable \"%c%"UTF8f"\" is not imported",
+ "Variable \"%c%"SVf"\" is not imported",
sv_type == SVt_PVAV ? '@' :
sv_type == SVt_PVHV ? '%' : '$',
- is_utf8, len, name);
+ SVfARG(namesv));
if (GvCVu(*gvp))
Perl_ck_warner_d(
aTHX_ packWARN(WARN_MISC),
- "\t(Did you mean &%"UTF8f" instead?)\n",
- is_utf8, len, name
+ "\t(Did you mean &%"SVf" instead?)\n", SVfARG(namesv)
);
stash = NULL;
}
@@ -1597,14 +1597,15 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
if (!stash) {
if (add && !PL_in_clean_all) {
+ SV * const namesv = newSVpvn_flags(name, len, is_utf8);
SV * const err = Perl_mess(aTHX_
- "Global symbol \"%s%"UTF8f
- "\" requires explicit package name",
+ "Global symbol \"%s%"SVf"\" requires explicit package name",
(sv_type == SVt_PV ? "$"
: sv_type == SVt_PVAV ? "@"
: sv_type == SVt_PVHV ? "%"
- : ""), is_utf8, len, name);
+ : ""), SVfARG(namesv));
GV *gv;
+ SvREFCNT_dec_NN(namesv);
if (is_utf8)
SvUTF8_on(err);
qerror(err);
@@ -1699,9 +1700,8 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
faking_it = SvOK(gv);
if (add & GV_ADDWARN)
- Perl_ck_warner_d(aTHX_ packWARN(WARN_INTERNAL),
- "Had to create %"UTF8f" unexpectedly",
- is_utf8, name_end-nambeg, nambeg);
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_INTERNAL), "Had to create %"SVf" unexpectedly",
+ SVfARG(newSVpvn_flags(nambeg, name_end-nambeg, SVs_TEMP | is_utf8 )));
gv_init_pvn(gv, stash, name, len, (add & GV_ADDMULTI)|is_utf8);
if ( isIDFIRST_lazy_if(name, is_utf8)
@@ -2124,10 +2124,10 @@ Perl_newGVgen_flags(pTHX_ const char *pack, U32 flags)
{
dVAR;
PERL_ARGS_ASSERT_NEWGVGEN_FLAGS;
- assert(!(flags & ~SVf_UTF8));
- return gv_fetchpv(Perl_form(aTHX_ "%"UTF8f"::_GEN_%ld",
- flags, strlen(pack), pack,
+ return gv_fetchpv(Perl_form(aTHX_ "%"SVf"::_GEN_%ld",
+ SVfARG(newSVpvn_flags(pack, strlen(pack),
+ SVs_TEMP | flags)),
(long)PL_gensym++),
GV_ADD, SVt_PVGV);
}