Newxz(dc, needlen + 1, char);
}
else if (SvOK(sv) || SvTYPE(sv) > SVt_PVMG) {
- STRLEN n_a;
- dc = SvPV_force_nomg(sv, n_a);
+ dc = SvPV_force_nomg_nolen(sv);
if (SvCUR(sv) < (STRLEN)len) {
dc = SvGROW(sv, (STRLEN)(len + 1));
(void)memzero(dc + SvCUR(sv), len - SvCUR(sv) + 1);
#ifdef OS2
ULONG rc;
QWORD cnt;
- STRLEN n_a;
if (!g_frequ) {
if (CheckOSError(DosTmrQueryFreq(&g_frequ)))
g_frequ = g_frequ/DPROF_HZ; /* count per tick */
if (CheckOSError(DosTmrQueryTime(&cnt)))
croak("DosTmrQueryTime: %s",
- SvPV(perl_get_sv("!",TRUE), n_a));
+ SvPV_nolen_const(perl_get_sv("!",TRUE)));
g_start_cnt = toLongLong(cnt);
}
}
else if (SvPOK(bitspec) && SvCUR(bitspec) == (STRLEN)opset_len) {
int b, j;
- STRLEN n_a;
- const char * const bitmap = SvPV(bitspec,n_a);
+ const char * const bitmap = SvPV_nolen_const(bitspec);
int myopcode = 0;
for (b=0; b < opset_len; b++) {
const U16 bits = bitmap[b];
case 61:
#line 341 "perly.y"
- { STRLEN n_a; const char *name = SvPV_const(((SVOP*)(yyvsp[0].opval))->op_sv,n_a);
+ { const char *const name = SvPV_nolen_const(((SVOP*)(yyvsp[0].opval))->op_sv);
if (strEQ(name, "BEGIN") || strEQ(name, "END")
|| strEQ(name, "INIT") || strEQ(name, "CHECK"))
CvSPECIAL_on(PL_compcv);
;
/* Name of a subroutine - must be a bareword, could be special */
-subname : WORD { STRLEN n_a; const char *name = SvPV_const(((SVOP*)$1)->op_sv,n_a);
+subname : WORD { const char *const name = SvPV_nolen_const(((SVOP*)$1)->op_sv);
if (strEQ(name, "BEGIN") || strEQ(name, "END")
|| strEQ(name, "INIT") || strEQ(name, "CHECK"))
CvSPECIAL_on(PL_compcv);
SvGETMAGIC(fromstr);
if (!SvOK(fromstr)) aptr = NULL;
else {
- STRLEN n_a;
/* XXX better yet, could spirit away the string to
* a safe spot and hang on to it until the result
* of pack() (and all copies of the result) are
"Attempt to pack pointer to temporary value");
}
if (SvPOK(fromstr) || SvNIOK(fromstr))
- aptr = SvPV_nomg_const(fromstr, n_a);
+ aptr = SvPV_nomg_const_nolen(fromstr);
else
- aptr = SvPV_force_flags(fromstr, n_a, 0);
+ aptr = SvPV_force_flags_nolen(fromstr, 0);
}
DO_BO_PACK_PC(aptr);
PUSH_VAR(utf8, cur, aptr);
((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
(const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
+#define SvPV_flags_const_nolen(sv, flags) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? SvPVX_const(sv) : \
+ (const char*) sv_2pv_flags(sv, 0, flags|SV_CONST_RETURN))
#define SvPV_flags_mutable(sv, lp, flags) \
((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
#define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
#define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
+#define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0)
#define SvPV_force_flags(sv, lp, flags) \
((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
#define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
#define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
+#define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
/* ----*/