SAVEFREEPV(type);
/* Lose leading and trailing white space */
- for (; isSPACE(*type); type++) ;
+ while (isSPACE(*type))
+ type++;
while (tend > type && isSPACE(tend[-1]))
*--tend = '\0';
}
type++;
}
- for (type++; isSPACE(*type); type++) ;
+ do {
+ type++;
+ } while (isSPACE(*type));
if (!num_svs) {
name = type;
len = tend-type;
if (num_svs > 1) {
Perl_croak(aTHX_ "More than one argument to '%c&' open",IoTYPE(io));
}
- for (; isSPACE(*type); type++) ;
+ while (isSPACE(*type))
+ type++;
if (num_svs && (SvIOK(*svp) || (SvPOK(*svp) && looks_like_number(*svp)))) {
fd = SvUV(*svp);
num_svs = 0;
}
} /* & */
else {
- for (; isSPACE(*type); type++) ;
+ while (isSPACE(*type))
+ type++;
if (*type == IoTYPE_STD && (!type[1] || isSPACE(type[1]) || type[1] == ':')) {
type++;
fp = PerlIO_stdout();
goto unknown_open_mode;
} /* IoTYPE_WRONLY */
else if (*type == IoTYPE_RDONLY) {
- for (type++; isSPACE(*type); type++) ;
+ do {
+ type++;
+ } while (isSPACE(*type));
mode[0] = 'r';
#ifdef HAS_STRLCAT
if (in_raw)
}
IoTYPE(io) = IoTYPE_PIPE;
if (num_svs) {
- for (; isSPACE(*type); type++) ;
+ while (isSPACE(*type))
+ type++;
if (*type) {
if (PerlIO_apply_layers(aTHX_ fp, mode, type) != 0) {
goto say_false;
if (PL_inplace) {
if (!PL_argvout_stack)
PL_argvout_stack = newAV();
- av_push(PL_argvout_stack, SvREFCNT_inc_simple(PL_defoutgv));
+ assert(PL_defoutgv);
+ av_push(PL_argvout_stack, SvREFCNT_inc_simple_NN(PL_defoutgv));
}
}
if (PL_filemode & (S_ISUID|S_ISGID)) {
if (strnEQ(cmd,"exec",4) && isSPACE(cmd[4]))
goto doshell;
- for (s = cmd; *s && isALNUM(*s); s++) ; /* catch VAR=val gizmo */
+ s = cmd;
+ while (isALNUM(*s))
+ s++; /* catch VAR=val gizmo */
if (*s == '=')
goto doshell;
PL_Cmd = savepvn(cmd, s-cmd);
a = PL_Argv;
for (s = PL_Cmd; *s;) {
- while (*s && isSPACE(*s)) s++;
+ while (isSPACE(*s))
+ s++;
if (*s)
*(a++) = s;
- while (*s && !isSPACE(*s)) s++;
+ while (*s && !isSPACE(*s))
+ s++;
if (*s)
*s++ = '\0';
}
S_sequence(pTHX_ register const OP *o)
{
dVAR;
- SV *op;
- const char *key;
- STRLEN len;
const OP *oldop = NULL;
- OP *l;
if (!o)
return;
Sequence = newHV();
for (; o; o = o->op_next) {
- op = newSVuv(PTR2UV(o));
- key = SvPV_const(op, len);
+ STRLEN len;
+ SV * const op = newSVuv(PTR2UV(o));
+ const char * const key = SvPV_const(op, len);
+
if (hv_exists(Sequence, key, len))
break;
case OP_COND_EXPR:
case OP_RANGE:
hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
- for (l = cLOGOPo->op_other; l && l->op_type == OP_NULL; l = l->op_next)
- ;
- sequence(l);
+ sequence_tail(cLOGOPo->op_other);
break;
case OP_ENTERLOOP:
case OP_ENTERITER:
hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
- for (l = cLOOPo->op_redoop; l && l->op_type == OP_NULL; l = l->op_next)
- ;
- sequence(l);
- for (l = cLOOPo->op_nextop; l && l->op_type == OP_NULL; l = l->op_next)
- ;
- sequence(l);
- for (l = cLOOPo->op_lastop; l && l->op_type == OP_NULL; l = l->op_next)
- ;
- sequence(l);
+ sequence_tail(cLOOPo->op_redoop);
+ sequence_tail(cLOOPo->op_nextop);
+ sequence_tail(cLOOPo->op_lastop);
break;
case OP_QR:
case OP_MATCH:
case OP_SUBST:
hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
- for (l = cPMOPo->op_pmreplstart; l && l->op_type == OP_NULL; l = l->op_next)
- ;
- sequence(l);
+ sequence_tail(cPMOPo->op_pmreplstart);
break;
case OP_HELEM:
}
}
+static void
+S_sequence_tail(pTHX_ const OP *o)
+{
+ while (o && (o->op_type == OP_NULL))
+ o = o->op_next;
+ sequence(o);
+}
+
STATIC UV
S_sequence_num(pTHX_ const OP *o)
{
s |CV* |deb_curcv |I32 ix
s |void |debprof |NN const OP *o
s |void |sequence |NULLOK const OP *o
+s |void |sequence_tail |NULLOK const OP *o
s |UV |sequence_num |NULLOK const OP *o
s |SV* |pm_description |NN const PMOP *pm
#endif
#define deb_curcv S_deb_curcv
#define debprof S_debprof
#define sequence S_sequence
+#define sequence_tail S_sequence_tail
#define sequence_num S_sequence_num
#define pm_description S_pm_description
#endif
#define deb_curcv(a) S_deb_curcv(aTHX_ a)
#define debprof(a) S_debprof(aTHX_ a)
#define sequence(a) S_sequence(aTHX_ a)
+#define sequence_tail(a) S_sequence_tail(aTHX_ a)
#define sequence_num(a) S_sequence_num(aTHX_ a)
#define pm_description(a) S_pm_description(aTHX_ a)
#endif
__attribute__nonnull__(pTHX_1);
STATIC void S_sequence(pTHX_ const OP *o);
+STATIC void S_sequence_tail(pTHX_ const OP *o);
STATIC UV S_sequence_num(pTHX_ const OP *o);
STATIC SV* S_pm_description(pTHX_ const PMOP *pm)
__attribute__nonnull__(pTHX_1);