Quiesce warnings -Wdangling-else

Thanks to jilles for some reviews and tips.
This commit is contained in:
Sean Bruno 2013-10-28 18:10:35 +00:00
parent da276a9179
commit b51b786d73
3 changed files with 15 additions and 11 deletions
contrib/groff/src/roff/troff

@ -2789,18 +2789,19 @@ void process_input_stack()
case token::TOKEN_TRANSPARENT: case token::TOKEN_TRANSPARENT:
{ {
if (bol) { if (bol) {
if (possibly_handle_first_page_transition()) if (possibly_handle_first_page_transition()) {
; ;
else { } else {
int cc; int cc;
do { do {
node *n; node *n;
cc = get_copy(&n); cc = get_copy(&n);
if (cc != EOF) if (cc != EOF) {
if (cc != '\0') if (cc != '\0')
curdiv->transparent_output(transparent_translate(cc)); curdiv->transparent_output(transparent_translate(cc));
else else
curdiv->transparent_output(n); curdiv->transparent_output(n);
}
} while (cc != '\n' && cc != EOF); } while (cc != '\n' && cc != EOF);
if (cc == EOF) if (cc == EOF)
curdiv->transparent_output('\n'); curdiv->transparent_output('\n');
@ -2811,9 +2812,9 @@ void process_input_stack()
case token::TOKEN_NEWLINE: case token::TOKEN_NEWLINE:
{ {
if (bol && !old_have_input if (bol && !old_have_input
&& !curenv->get_prev_line_interrupted()) && !curenv->get_prev_line_interrupted()) {
trapping_blank_line(); trapping_blank_line();
else { } else {
curenv->newline(); curenv->newline();
bol = 1; bol = 1;
} }

@ -482,21 +482,24 @@ void mtsm::flush(FILE *fp, statem *s, string tag_list)
void statem::display_state() void statem::display_state()
{ {
fprintf(stderr, " <state "); fprintf(stderr, " <state ");
if (bool_values[MTSM_BR].is_known) if (bool_values[MTSM_BR].is_known) {
if (bool_values[MTSM_BR].value) if (bool_values[MTSM_BR].value)
fprintf(stderr, "[br]"); fprintf(stderr, "[br]");
else else
fprintf(stderr, "[!br]"); fprintf(stderr, "[!br]");
if (bool_values[MTSM_EOL].is_known) }
if (bool_values[MTSM_EOL].is_known) {
if (bool_values[MTSM_EOL].value) if (bool_values[MTSM_EOL].value)
fprintf(stderr, "[eol]"); fprintf(stderr, "[eol]");
else else
fprintf(stderr, "[!eol]"); fprintf(stderr, "[!eol]");
if (int_values[MTSM_SP].is_known) }
if (int_values[MTSM_SP].is_known) {
if (int_values[MTSM_SP].value) if (int_values[MTSM_SP].value)
fprintf(stderr, "[sp %d]", int_values[MTSM_SP].value); fprintf(stderr, "[sp %d]", int_values[MTSM_SP].value);
else else
fprintf(stderr, "[!sp]"); fprintf(stderr, "[!sp]");
}
fprintf(stderr, ">"); fprintf(stderr, ">");
fflush(stderr); fflush(stderr);
} }

@ -4600,14 +4600,14 @@ void hline_node::tprint(troff_output_file *out)
} }
else { else {
hunits rem = x - w*i; hunits rem = x - w*i;
if (rem > H0) if (rem > H0) {
if (n->overlaps_horizontally()) { if (n->overlaps_horizontally()) {
if (out->is_on()) if (out->is_on())
n->tprint(out); n->tprint(out);
out->right(rem - w); out->right(rem - w);
} } else
else
out->right(rem); out->right(rem);
}
while (--i >= 0) while (--i >= 0)
if (out->is_on()) if (out->is_on())
n->tprint(out); n->tprint(out);