chsize = 2;
switch (c) {
- case '\\' : /* fallthrough */
+ case '\\' : /* FALLTHROUGH */
case '%' : if ( c == esc ) {
octbuf[1] = esc;
} else {
finish:
while (unref--)
sv_catpv(t, ")");
- if (TAINTING_get && SvTAINTED(sv))
+ if (TAINTING_get && sv && SvTAINTED(sv))
sv_catpv(t, " [tainted]");
return SvPV_nolen(t);
}
static bool
S_op_private_to_names(pTHX_ SV *tmpsv, U32 optype, U32 op_private) {
const struct op_private_by_op *start = op_private_names;
- const struct op_private_by_op *const end
- = op_private_names + C_ARRAY_LENGTH(op_private_names);
+ const struct op_private_by_op *const end = C_ARRAY_END(op_private_names);
/* This is a linear search, but no worse than the code that it replaced.
It's debugging code - size is more important than speed. */
sv_catpv(d, " ),");
}
}
- /* FALL THROUGH */
+ /* FALLTHROUGH */
default:
evaled_or_uv:
if (SvEVALED(sv)) sv_catpv(d, "EVALED,");
if (SvVALID(sv)) sv_catpv(d, "VALID,");
if (SvPAD_TYPED(sv)) sv_catpv(d, "TYPED,");
if (SvPAD_OUR(sv)) sv_catpv(d, "OUR,");
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case SVt_PVNV:
if (SvPAD_STATE(sv)) sv_catpv(d, "STATE,");
goto evaled_or_uv;
}
}
break;
- case SVt_PVHV:
+ case SVt_PVHV: {
+ U32 usedkeys;
if (SvOOK(sv)) {
struct xpvhv_aux *const aux = HvAUX(sv);
Perl_dump_indent(aTHX_ level, file, " AUX_FLAGS = %"UVuf"\n",
(UV)aux->xhv_aux_flags);
}
Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%"UVxf, PTR2UV(HvARRAY(sv)));
- if (HvARRAY(sv) && HvUSEDKEYS(sv)) {
+ usedkeys = HvUSEDKEYS(sv);
+ if (HvARRAY(sv) && usedkeys) {
/* Show distribution of HEs in the ARRAY */
int freq[200];
-#define FREQ_MAX ((int)(sizeof freq / sizeof freq[0] - 1))
+#define FREQ_MAX ((int)(C_ARRAY_LENGTH(freq) - 1))
int i;
int max = 0;
- U32 pow2 = 2, keys = HvUSEDKEYS(sv);
+ U32 pow2 = 2, keys = usedkeys;
NV theoret, sum = 0;
PerlIO_printf(file, " (");
}
while ((keys = keys >> 1))
pow2 = pow2 << 1;
- theoret = HvUSEDKEYS(sv);
+ theoret = usedkeys;
theoret += theoret * (theoret-1)/pow2;
PerlIO_putc(file, '\n');
Perl_dump_indent(aTHX_ level, file, " hash quality = %.1"NVff"%%", theoret/sum*100);
}
PerlIO_putc(file, '\n');
- Perl_dump_indent(aTHX_ level, file, " KEYS = %"IVdf"\n", (IV)HvUSEDKEYS(sv));
+ Perl_dump_indent(aTHX_ level, file, " KEYS = %"IVdf"\n", (IV)usedkeys);
{
STRLEN count = 0;
HE **ents = HvARRAY(sv);
}
}
break;
+ } /* case SVt_PVHV */
case SVt_PVCV:
if (CvAUTOLOAD(sv)) {
generic_pv_escape(tmpsv, proto, CvPROTOLEN(sv),
SvUTF8(sv)));
}
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case SVt_PVFM:
do_hv_dump(level, file, " COMP_STASH", CvSTASH(sv));
if (!CvISXSUB(sv)) {