summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorGisle Aas <gisle@activestate.com>2006-01-04 12:48:34 +0000
committerGisle Aas <gisle@activestate.com>2006-01-04 12:48:34 +0000
commit396482e1e4786de2b4c8ab57cb613dc0f110b931 (patch)
treeb05f1914132e9e79579a39f57a650aff075c27af /sv.c
parentbd5fcaa6efcc067647598367721b802e1f87eaa2 (diff)
downloadperl-396482e1e4786de2b4c8ab57cb613dc0f110b931.tar.gz
Introduce the macros newSVpvs(str) and sv_catpvs(sv, str).
Gets rid of many hardcoded string lengths. p4raw-id: //depot/perl@26641
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index 022f936ec8..bd433522da 100644
--- a/sv.c
+++ b/sv.c
@@ -1408,7 +1408,7 @@ S_not_a_number(pTHX_ SV *sv)
const char *pv;
if (DO_UTF8(sv)) {
- dsv = sv_2mortal(newSVpvn("", 0));
+ dsv = sv_2mortal(newSVpvs(""));
pv = sv_uni_display(dsv, sv, 10, 0);
} else {
char *d = tmpbuf;
@@ -2452,7 +2452,7 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags)
const SV *const referent = (SV*)SvRV(sv);
if (!referent) {
- tsv = sv_2mortal(newSVpvn("NULLREF", 7));
+ tsv = sv_2mortal(newSVpvs("NULLREF"));
} else if (SvTYPE(referent) == SVt_PVMG
&& ((SvFLAGS(referent) &
(SVs_OBJECT|SVf_OK|SVs_GMG|SVs_SMG|SVs_RMG))
@@ -8733,7 +8733,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
"\"%%\\%03"UVof"\"",
(UV)c & 0xFF);
} else
- sv_catpv(msg, "end of string");
+ sv_catpvs(msg, "end of string");
Perl_warner(aTHX_ packWARN(WARN_PRINTF), "%"SVf, msg); /* yes, this is reentrant */
}
@@ -11449,7 +11449,7 @@ S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool match)
case OP_SCHOMP:
case OP_CHOMP:
if (SvROK(PL_rs) && uninit_sv == SvRV(PL_rs))
- return sv_2mortal(newSVpvn("${$/}", 5));
+ return sv_2mortal(newSVpvs("${$/}"));
/* FALL THROUGH */
default: