summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-10 22:06:15 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-10 22:06:15 +0000
commit349d4f2f3d114fbec6897c6007862eb07a409a2d (patch)
treea43bbcb031855718e48d719d10f6ef5ec6f3752d /pp_hot.c
parent93524f2be2dba9389167a137d53a88545322b55e (diff)
downloadperl-349d4f2f3d114fbec6897c6007862eb07a409a2d.tar.gz
More SvPV consting, including some code cleanup and living dangerously
with socket API calls. p4raw-id: //depot/perl@24799
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 508840393b..04becac90f 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -153,7 +153,7 @@ PP(pp_concat)
if (TARG == right && right != left) {
right = sv_2mortal(newSVpvn(rpv, rlen));
- rpv = SvPV(right, rlen); /* no point setting UTF-8 here */
+ rpv = SvPV_const(right, rlen); /* no point setting UTF-8 here */
rcopied = TRUE;
}
@@ -186,7 +186,7 @@ PP(pp_concat)
if (!rcopied)
right = sv_2mortal(newSVpvn(rpv, rlen));
sv_utf8_upgrade_nomg(right);
- rpv = SvPV(right, rlen);
+ rpv = SvPV_const(right, rlen);
}
}
sv_catpvn_nomg(TARG, rpv, rlen);
@@ -1590,6 +1590,7 @@ Perl_do_readline(pTHX)
XPUSHs(sv);
if (type == OP_GLOB) {
char *tmps;
+ const char *t1;
if (SvCUR(sv) > 0 && SvCUR(PL_rs) > 0) {
tmps = SvEND(sv) - 1;
@@ -1598,16 +1599,16 @@ Perl_do_readline(pTHX)
SvCUR_set(sv, SvCUR(sv) - 1);
}
}
- for (tmps = SvPVX(sv); *tmps; tmps++)
- if (!isALPHA(*tmps) && !isDIGIT(*tmps) &&
- strchr("$&*(){}[]'\";\\|?<>~`", *tmps))
+ for (t1 = SvPVX_const(sv); *t1; t1++)
+ if (!isALPHA(*t1) && !isDIGIT(*t1) &&
+ strchr("$&*(){}[]'\";\\|?<>~`", *t1))
break;
- if (*tmps && PerlLIO_lstat(SvPVX_const(sv), &PL_statbuf) < 0) {
+ if (*t1 && PerlLIO_lstat(SvPVX_const(sv), &PL_statbuf) < 0) {
(void)POPs; /* Unmatched wildcard? Chuck it... */
continue;
}
} else if (SvUTF8(sv)) { /* OP_READLINE, OP_RCATLINE */
- const U8 *s = (U8*)SvPVX(sv) + offset;
+ const U8 *s = (const U8*)SvPVX_const(sv) + offset;
const STRLEN len = SvCUR(sv) - offset;
const U8 *f;