diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-06-10 20:48:35 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-06-10 20:48:35 +0000 |
commit | 93524f2be2dba9389167a137d53a88545322b55e (patch) | |
tree | be092e7b27a41cc50a20a34ed87bfed6c68842d9 /op.c | |
parent | da9e634887501d86e4a653cbb4bbc6b2d723c303 (diff) | |
download | perl-93524f2be2dba9389167a137d53a88545322b55e.tar.gz |
Move SvPV consting, remove an n_a, and correct one error in Move()
p4raw-id: //depot/perl@24798
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -2491,7 +2491,7 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) t = uvuni_to_utf8_flags(tmpbuf, 0x7fffffff, UNICODE_ALLOW_SUPER); sv_catpvn(transv, (char*)tmpbuf, t - tmpbuf); - t = (U8*)SvPVX(transv); + t = (const U8*)SvPVX_const(transv); tlen = SvCUR(transv); tend = t + tlen; Safefree(cp); @@ -5507,7 +5507,7 @@ Perl_ck_fun(pTHX_ OP *o) } if (tmpstr) { - name = SvPV(tmpstr, len); + name = SvPV_const(tmpstr, len); sv_2mortal(tmpstr); } } @@ -6812,13 +6812,13 @@ Perl_peep(pTHX_ register OP *o) fields = (GV**)hv_fetch(SvSTASH(lexname), "FIELDS", 6, FALSE); if (!fields || !GvHV(*fields)) break; - key = SvPV(*svp, keylen); + key = SvPV_const(*svp, keylen); if (!hv_fetch(GvHV(*fields), key, SvUTF8(*svp) ? -(I32)keylen : keylen, FALSE)) { Perl_croak(aTHX_ "No such class field \"%s\" " "in variable %s of type %s", - key, SvPV_nolen(lexname), HvNAME_get(SvSTASH(lexname))); + key, SvPV_nolen_const(lexname), HvNAME_get(SvSTASH(lexname))); } break; @@ -6829,7 +6829,7 @@ Perl_peep(pTHX_ register OP *o) SV *lexname; GV **fields; SV **svp; - char *key; + const char *key; STRLEN keylen; SVOP *first_key_op, *key_op; @@ -6869,7 +6869,7 @@ Perl_peep(pTHX_ register OP *o) if (key_op->op_type != OP_CONST) continue; svp = cSVOPx_svp(key_op); - key = SvPV(*svp, keylen); + key = SvPV_const(*svp, keylen); if (!hv_fetch(GvHV(*fields), key, SvUTF8(*svp) ? -(I32)keylen : keylen, FALSE)) { |