SV *tmpRef;
const char *elem;
dSP;
- STRLEN n_a;
sv = POPs;
- elem = SvPV(sv, n_a);
+ elem = SvPV_nolen_const(sv);
gv = (GV*)POPs;
tmpRef = Nullsv;
sv = Nullsv;
SETn(-SvNV(sv));
else if (SvPOKp(sv)) {
STRLEN len;
- char *s = SvPV(sv, len);
+ const char *s = SvPV_const(sv, len);
if (isIDFIRST(*s)) {
sv_setpvn(TARG, "-", 1);
sv_catsv(TARG, sv);
register I32 anum;
STRLEN len;
- (void)SvPV_nomg(sv,len); /* force check for uninit var */
+ (void)SvPV_nomg_const(sv,len); /* force check for uninit var */
sv_setsv_nomg(TARG, sv);
tmps = (U8*)SvPV_force(TARG, len);
anum = len;
if (num_args > 2) {
if (num_args > 3) {
repl_sv = POPs;
- repl = SvPV(repl_sv, repl_len);
+ repl = SvPV_const(repl_sv, repl_len);
repl_is_utf8 = DO_UTF8(repl_sv) && SvCUR(repl_sv);
}
len = POPi;
else if (lvalue) { /* it's an lvalue! */
if (!SvGMAGICAL(sv)) {
if (SvROK(sv)) {
- STRLEN n_a;
- SvPV_force(sv,n_a);
+ SvPV_force_nolen(sv);
if (ckWARN(WARN_SUBSTR))
Perl_warner(aTHX_ packWARN(WARN_SUBSTR),
"Attempt to use reference as lvalue in substr");
SV *temp = Nullsv;
I32 offset;
I32 retval;
- char *tmps;
- char *tmps2;
+ const char *tmps;
+ const char *tmps2;
STRLEN biglen;
I32 arybase = PL_curcop->cop_arybase;
int big_utf8;
/* One needs to be upgraded. */
SV *bytes = little_utf8 ? big : little;
STRLEN len;
- char *p = SvPV(bytes, len);
+ const char *p = SvPV_const(bytes, len);
temp = newSVpvn(p, len);
}
if (big_utf8 && offset > 0)
sv_pos_u2b(big, &offset, 0);
- tmps = SvPV(big, biglen);
+ tmps = SvPV_const(big, biglen);
if (offset < 0)
offset = 0;
else if (offset > (I32)biglen)
STRLEN llen;
I32 offset;
I32 retval;
- char *tmps;
- char *tmps2;
+ const char *tmps;
+ const char *tmps2;
I32 arybase = PL_curcop->cop_arybase;
int big_utf8;
int little_utf8;
/* One needs to be upgraded. */
SV *bytes = little_utf8 ? big : little;
STRLEN len;
- char *p = SvPV(bytes, len);
+ const char *p = SvPV_const(bytes, len);
temp = newSVpvn(p, len);
little = temp;
}
}
- tmps2 = SvPV(little, llen);
- tmps = SvPV(big, blen);
+ tmps2 = SvPV_const(little, llen);
+ tmps = SvPV_const(big, blen);
if (MAXARG < 3)
offset = blen;
#ifdef HAS_CRYPT
dSP; dTARGET;
dPOPTOPssrl;
- STRLEN n_a;
STRLEN len;
- char *tmps = SvPV(left, len);
+ const char *tmps = SvPV_const(left, len);
if (DO_UTF8(left)) {
/* If Unicode, try to downgrade.
# endif /* HAS_CRYPT_R */
# endif /* USE_ITHREADS */
# ifdef FCRYPT
- sv_setpv(TARG, fcrypt(tmps, SvPV(right, n_a)));
+ sv_setpv(TARG, fcrypt(tmps, SvPV_nolen_const(right)));
# else
- sv_setpv(TARG, PerlProc_crypt(tmps, SvPV(right, n_a)));
+ sv_setpv(TARG, PerlProc_crypt(tmps, SvPV_nolen_const(right)));
# endif
SETs(TARG);
RETURN;
{
dSP;
SV *sv = TOPs;
- register U8 *s;
+ const U8 *s;
STRLEN slen;
SvGETMAGIC(sv);
if (DO_UTF8(sv) &&
- (s = (U8*)SvPV_nomg(sv, slen)) && slen &&
+ (s = (const U8*)SvPV_nomg_const(sv, slen)) && slen &&
UTF8_IS_START(*s)) {
U8 tmpbuf[UTF8_MAXBYTES_CASE+1];
STRLEN ulen;
}
}
else {
+ U8 *s1;
if (!SvPADTMP(sv) || SvREADONLY(sv)) {
dTARGET;
SvUTF8_off(TARG); /* decontaminate */
sv = TARG;
SETs(sv);
}
- s = (U8*)SvPV_force_nomg(sv, slen);
- if (*s) {
+ s1 = (U8*)SvPV_force_nomg(sv, slen);
+ if (*s1) {
if (IN_LOCALE_RUNTIME) {
TAINT;
SvTAINTED_on(sv);
- *s = toUPPER_LC(*s);
+ *s1 = toUPPER_LC(*s1);
}
else
- *s = toUPPER(*s);
+ *s1 = toUPPER(*s1);
}
}
SvSETMAGIC(sv);
{
dSP;
SV *sv = TOPs;
- register U8 *s;
+ const U8 *s;
STRLEN slen;
SvGETMAGIC(sv);
if (DO_UTF8(sv) &&
- (s = (U8*)SvPV_nomg(sv, slen)) && slen &&
+ (s = (const U8*)SvPV_nomg_const(sv, slen)) && slen &&
UTF8_IS_START(*s)) {
STRLEN ulen;
U8 tmpbuf[UTF8_MAXBYTES_CASE+1];
}
}
else {
+ U8 *s1;
if (!SvPADTMP(sv) || SvREADONLY(sv)) {
dTARGET;
SvUTF8_off(TARG); /* decontaminate */
sv = TARG;
SETs(sv);
}
- s = (U8*)SvPV_force_nomg(sv, slen);
- if (*s) {
+ s1 = (U8*)SvPV_force_nomg(sv, slen);
+ if (*s1) {
if (IN_LOCALE_RUNTIME) {
TAINT;
SvTAINTED_on(sv);
- *s = toLOWER_LC(*s);
+ *s1 = toLOWER_LC(*s1);
}
else
- *s = toLOWER(*s);
+ *s1 = toLOWER(*s1);
}
}
SvSETMAGIC(sv);
{
dSP;
SV *sv = TOPs;
- register U8 *s;
STRLEN len;
SvGETMAGIC(sv);
dTARGET;
STRLEN ulen;
register U8 *d;
- U8 *send;
+ const U8 *s;
+ const U8 *send;
U8 tmpbuf[UTF8_MAXBYTES+1];
- s = (U8*)SvPV_nomg(sv,len);
+ s = (const U8*)SvPV_nomg_const(sv,len);
if (!len) {
SvUTF8_off(TARG); /* decontaminate */
sv_setpvn(TARG, "", 0);
}
}
else {
+ U8 *s;
if (!SvPADTMP(sv) || SvREADONLY(sv)) {
dTARGET;
SvUTF8_off(TARG); /* decontaminate */
}
s = (U8*)SvPV_force_nomg(sv, len);
if (len) {
- register U8 *send = s + len;
+ const register U8 *send = s + len;
if (IN_LOCALE_RUNTIME) {
TAINT;
{
dSP;
SV *sv = TOPs;
- register U8 *s;
STRLEN len;
SvGETMAGIC(sv);
if (DO_UTF8(sv)) {
dTARGET;
+ const U8 *s;
STRLEN ulen;
register U8 *d;
- U8 *send;
+ const U8 *send;
U8 tmpbuf[UTF8_MAXBYTES_CASE+1];
- s = (U8*)SvPV_nomg(sv,len);
+ s = (const U8*)SvPV_nomg_const(sv,len);
if (!len) {
SvUTF8_off(TARG); /* decontaminate */
sv_setpvn(TARG, "", 0);
}
}
else {
+ U8 *s;
if (!SvPADTMP(sv) || SvREADONLY(sv)) {
dTARGET;
SvUTF8_off(TARG); /* decontaminate */
register IV limit = POPi; /* note, negative is forever */
SV *sv = POPs;
STRLEN len;
- register char *s = SvPV(sv, len);
+ register const char *s = SvPV_const(sv, len);
bool do_utf8 = DO_UTF8(sv);
- char *strend = s + len;
+ const char *strend = s + len;
register PMOP *pm;
register REGEXP *rx;
register SV *dstr;
- register char *m;
+ register const char *m;
I32 iters = 0;
const STRLEN slen = do_utf8 ? utf8_length((U8*)s, (U8*)strend) : (strend - s);
I32 maxiters = slen + 10;
I32 i;
- char *orig;
+ const char *orig;
I32 origlimit = limit;
I32 realarray = 0;
I32 base;
len = rx->minlen;
if (len == 1 && !(rx->reganch & ROPT_UTF8) && !tail) {
- STRLEN n_a;
- char c = *SvPV(csv, n_a);
+ char c = *SvPV_nolen_const(csv);
while (--limit) {
/*SUPPRESS 530*/
for (m = s; m < strend && *m != c; m++) ;
while (s < strend && --limit)
{
PUTBACK;
- i = CALLREGEXEC(aTHX_ rx, s, strend, orig, 1 , sv, NULL, 0);
+ i = CALLREGEXEC(aTHX_ rx, (char*)s, (char*)strend, (char*)orig, 1 ,
+ sv, NULL, 0);
SPAGAIN;
if (i == 0)
break;