Skip to content

Commit

Permalink
Cannot do much if putc fails in debug output.
Browse files Browse the repository at this point in the history
Coverity CID 104782 (only flagged the deb.c spot)
  • Loading branch information
jhi committed Jun 27, 2015
1 parent c818886 commit 38d7fd8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion deb.c
Expand Up @@ -135,7 +135,7 @@ S_deb_stack_n(pTHX_ SV** stack_base, I32 stack_min, I32 stack_max,
if (markscan <= PL_markstack + mark_max && *markscan < i) {
do {
++markscan;
PerlIO_putc(Perl_debug_log, '*');
(void)PerlIO_putc(Perl_debug_log, '*');
}
while (markscan <= PL_markstack + mark_max && *markscan < i);
PerlIO_printf(Perl_debug_log, " ");
Expand Down
22 changes: 11 additions & 11 deletions dump.c
Expand Up @@ -1106,7 +1106,7 @@ Perl_gv_dump(pTHX_ GV *gv)
Perl_dump_indent(aTHX_ 1, Perl_debug_log, "-> %s",
generic_pv_escape( tmp, name, len, SvUTF8(sv) ));
}
PerlIO_putc(Perl_debug_log, '\n');
(void)PerlIO_putc(Perl_debug_log, '\n');
Perl_dump_indent(aTHX_ 0, Perl_debug_log, "}\n");
}

Expand Down Expand Up @@ -1227,7 +1227,7 @@ Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, const MAGIC *mg, I32 nest, I32
" ???? - " __FILE__
" does not know how to handle this MG_LEN"
);
PerlIO_putc(file, '\n');
(void)PerlIO_putc(file, '\n');
}
if (mg->mg_type == PERL_MAGIC_utf8) {
const STRLEN * const cache = (STRLEN *) mg->mg_ptr;
Expand Down Expand Up @@ -1270,7 +1270,7 @@ Perl_do_hv_dump(pTHX_ I32 level, PerlIO *file, const char *name, HV *sv)
HvNAMELEN(sv), HvNAMEUTF8(sv)));
}
else
PerlIO_putc(file, '\n');
(void)PerlIO_putc(file, '\n');
}

void
Expand All @@ -1285,7 +1285,7 @@ Perl_do_gv_dump(pTHX_ I32 level, PerlIO *file, const char *name, GV *sv)
generic_pv_escape( tmpsv, GvNAME(sv), GvNAMELEN(sv), GvNAMEUTF8(sv) ));
}
else
PerlIO_putc(file, '\n');
(void)PerlIO_putc(file, '\n');
}

void
Expand All @@ -1309,7 +1309,7 @@ Perl_do_gvgv_dump(pTHX_ I32 level, PerlIO *file, const char *name, GV *sv)
generic_pv_escape( tmp, GvNAME(sv), GvNAMELEN(sv), GvNAMEUTF8(sv)));
}
else
PerlIO_putc(file, '\n');
(void)PerlIO_putc(file, '\n');
}

const struct flag_to_name first_sv_flags_names[] = {
Expand Down Expand Up @@ -1567,7 +1567,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
else if (SvIsCOW_normal(sv))
PerlIO_printf(file, " (COW from 0x%"UVxf")", (UV)SvUVX(sv));
#endif
PerlIO_putc(file, '\n');
(void)PerlIO_putc(file, '\n');
}

if ((type >= SVt_PVNV && type != SVt_PVAV && type != SVt_PVHV
Expand Down Expand Up @@ -1660,7 +1660,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
Perl_dump_indent(aTHX_ level, file, " ALLOC = 0x%"UVxf"\n", PTR2UV(AvALLOC(sv)));
}
else
PerlIO_putc(file, '\n');
(void)PerlIO_putc(file, '\n');
Perl_dump_indent(aTHX_ level, file, " FILL = %"IVdf"\n", (IV)AvFILLp(sv));
Perl_dump_indent(aTHX_ level, file, " MAX = %"IVdf"\n", (IV)AvMAX(sv));
Perl_dump_indent(aTHX_ level, file, " ARYLEN = 0x%"UVxf"\n",
Expand Down Expand Up @@ -1721,7 +1721,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
PerlIO_printf(file, ", ");
}
}
PerlIO_putc(file, ')');
(void)PerlIO_putc(file, ')');
/* The "quality" of a hash is defined as the total number of
comparisons needed to access every element once, relative
to the expected number needed for a random hash.
Expand All @@ -1740,10 +1740,10 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
pow2 = pow2 << 1;
theoret = usedkeys;
theoret += theoret * (theoret-1)/pow2;
PerlIO_putc(file, '\n');
(void)PerlIO_putc(file, '\n');
Perl_dump_indent(aTHX_ level, file, " hash quality = %.1"NVff"%%", theoret/sum*100);
}
PerlIO_putc(file, '\n');
(void)PerlIO_putc(file, '\n');
Perl_dump_indent(aTHX_ level, file, " KEYS = %"IVdf"\n", (IV)usedkeys);
{
STRLEN count = 0;
Expand Down Expand Up @@ -1779,7 +1779,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
PerlIO_printf(file, " (LAST = 0x%"UVxf")", (UV)HvLASTRAND_get(sv));
}
#endif
PerlIO_putc(file, '\n');
(void)PerlIO_putc(file, '\n');
}
{
MAGIC * const mg = mg_find(sv, PERL_MAGIC_symtab);
Expand Down
2 changes: 1 addition & 1 deletion regcomp.c
Expand Up @@ -16739,7 +16739,7 @@ Perl_regdump(pTHX_ const regexp *r)
PerlIO_printf(Perl_debug_log, "(SBOL)");
if (r->intflags & PREGf_ANCH_GPOS)
PerlIO_printf(Perl_debug_log, "(GPOS)");
PerlIO_putc(Perl_debug_log, ' ');
(void)PerlIO_putc(Perl_debug_log, ' ');
}
if (r->intflags & PREGf_GPOS_SEEN)
PerlIO_printf(Perl_debug_log, "GPOS:%"UVuf" ", (UV)r->gofs);
Expand Down

0 comments on commit 38d7fd8

Please sign in to comment.