diff options
author | wl <wl> | 2011-10-31 07:25:18 +0000 |
---|---|---|
committer | wl <wl> | 2011-10-31 07:25:18 +0000 |
commit | 826d0960453913eacb9877d858022b48f605831d (patch) | |
tree | 140352c2b0339b542d0d78e75cac9335baa2b984 | |
parent | 8d1beed7085ed4e1d2fbaf9fc77c585f38ac97ad (diff) | |
download | groff-826d0960453913eacb9877d858022b48f605831d.tar.gz |
Fix compiler warnings.
* src/preproc/eqn/main.cpp (do_file), src/roff/troff/env.cpp
(environment::print_env), src/roff/troff/mtsm.cpp
(statem::display_state): Add syntactical sugar.
* src/utils/tfmtodit/tfmtodit.cpp (char_info_word): Use `unsigned
char' for all members.
* src/devices/grohtml/html-text.cpp (html_text::remove_def): Remove
unused variable `q'.
* src/devices/grohtml/post-html.cpp
(html_printer::lookahead_for_tables): Remove unused variable `left'
and `seen_text'.
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | src/devices/grohtml/html-text.cpp | 9 | ||||
-rw-r--r-- | src/devices/grohtml/post-html.cpp | 13 | ||||
-rw-r--r-- | src/preproc/eqn/main.cpp | 6 | ||||
-rw-r--r-- | src/roff/troff/env.cpp | 9 | ||||
-rw-r--r-- | src/roff/troff/mtsm.cpp | 9 | ||||
-rw-r--r-- | src/utils/tfmtodit/tfmtodit.cpp | 10 |
7 files changed, 39 insertions, 34 deletions
@@ -1,3 +1,20 @@ +2011-10-31 Werner LEMBERG <wl@gnu.org> + + Fix compiler warnings. + + * src/preproc/eqn/main.cpp (do_file), src/roff/troff/env.cpp + (environment::print_env), src/roff/troff/mtsm.cpp + (statem::display_state): Add syntactical sugar. + + * src/utils/tfmtodit/tfmtodit.cpp (char_info_word): Use `unsigned + char' for all members. + + * src/devices/grohtml/html-text.cpp (html_text::remove_def): Remove + unused variable `q'. + * src/devices/grohtml/post-html.cpp + (html_printer::lookahead_for_tables): Remove unused variable `left' + and `seen_text'. + 2011-10-23 Ingo Schwarze <schwarze@openbsd.org> [mdoc] Synchronize string tables with the mandoc(1) utility. diff --git a/src/devices/grohtml/html-text.cpp b/src/devices/grohtml/html-text.cpp index cae579b6..1b27ab3a 100644 --- a/src/devices/grohtml/html-text.cpp +++ b/src/devices/grohtml/html-text.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009 +/* Copyright (C) 2000-2005, 2007, 2009, 2011 * Free Software Foundation, Inc. * * Gaius Mulley (gaius@glam.ac.uk) wrote html-text.cpp @@ -873,9 +873,8 @@ void html_text::emit_space (void) void html_text::remove_def (tag_definition *t) { - tag_definition *p = stackptr; - tag_definition *l = 0; - tag_definition *q = 0; + tag_definition *p = stackptr; + tag_definition *l = 0; while ((p != 0) && (p != t)) { l = p; @@ -886,12 +885,10 @@ void html_text::remove_def (tag_definition *t) stackptr = stackptr->next; if (stackptr == NULL) lastptr = NULL; - q = stackptr; } else if (l == 0) { error("stack list pointers are wrong"); } else { l->next = p->next; - q = p->next; if (l->next == NULL) lastptr = l; } diff --git a/src/devices/grohtml/post-html.cpp b/src/devices/grohtml/post-html.cpp index a6acc691..f4656a0d 100644 --- a/src/devices/grohtml/post-html.cpp +++ b/src/devices/grohtml/post-html.cpp @@ -1,6 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, - * 2010 +/* Copyright (C) 2000-2007, 2009-2011 * Free Software Foundation, Inc. * * Gaius Mulley (gaius@glam.ac.uk) wrote post-html.cpp @@ -3614,9 +3613,7 @@ void html_printer::lookahead_for_tables (void) text_glob *start_of_table = NULL; text_glob *last = NULL; colType type_of_col = none; - int left = 0; int found_col = FALSE; - int seen_text = FALSE; int ncol = 0; int colmin = 0; // pacify compiler int colmax = 0; // pacify compiler @@ -3646,9 +3643,7 @@ void html_printer::lookahead_for_tables (void) } start_of_line = g; - seen_text = FALSE; ncol = 0; - left = next_horiz_pos(g, nf); if (found_col) last = g; found_col = FALSE; @@ -3713,14 +3708,10 @@ void html_printer::lookahead_for_tables (void) } else if (! g->is_a_tag()) update_min_max(type_of_col, &colmin, &colmax, g); - if ((! g->is_a_tag()) || g->is_tab()) - seen_text = TRUE; - if ((g->is_col() || g->is_tab() || g->is_tab0()) && (start_of_line != NULL) && (start_of_table == NULL)) { start_of_table = insert_tab_ts(start_of_line); start_of_line = NULL; - seen_text = FALSE; } else if (g->is_ce() && (start_of_table != NULL)) { add_table_end("*** CE ***"); start_of_table->remember_table(tbl); @@ -3782,9 +3773,7 @@ void html_printer::lookahead_for_tables (void) nf = calc_nf(g, nf); } while ((g != NULL) && (g->is_br() || (nf && g->is_eol()))); start_of_line = g; - seen_text = FALSE; ncol = 0; - left = next_horiz_pos(g, nf); if (found_col) last = g; found_col = FALSE; diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp index e784c2c5..167fb4e2 100644 --- a/src/preproc/eqn/main.cpp +++ b/src/preproc/eqn/main.cpp @@ -1,6 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2005, 2007, - 2009 +/* Copyright (C) 1989-1992, 2000-2002, 2005, 2007, 2009, 2011 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -112,13 +111,14 @@ void do_file(FILE *fp, const char *filename) inline_flag = 0; yyparse(); restore_compatibility(); - if (non_empty_flag) + if (non_empty_flag) { if (output_format == mathml) putchar('\n'); else { printf(".lf %d\n", current_lineno - 1); output_string(); } + } if (output_format == troff) printf(".lf %d\n", current_lineno); put_string(linebuf, stdout); diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp index 13672cc5..6d722f5c 100644 --- a/src/roff/troff/env.cpp +++ b/src/roff/troff/env.cpp @@ -1,6 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2009 +/* Copyright (C) 1989-1992, 2000-2006, 2009, 2011 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -3211,7 +3210,7 @@ const char *sptoa(int sp) double factor = 10.0; double val = s; int decimal_point = 0; - do { + do { double v = ceil(s*factor); if (v > INT_MAX) break; @@ -3314,8 +3313,8 @@ void environment::print_env() ? "on" : margin_character_flags == MARGIN_CHARACTER_NEXT ? "next" - : margin_character_flags == MARGIN_CHARACTER_ON - | MARGIN_CHARACTER_NEXT + : margin_character_flags == (MARGIN_CHARACTER_ON + | MARGIN_CHARACTER_NEXT) ? "on, next" : "none"); errprint(" margin character distance: %1u\n", diff --git a/src/roff/troff/mtsm.cpp b/src/roff/troff/mtsm.cpp index 83f1bd21..f13a6be1 100644 --- a/src/roff/troff/mtsm.cpp +++ b/src/roff/troff/mtsm.cpp @@ -479,21 +479,24 @@ void mtsm::flush(FILE *fp, statem *s, string tag_list) void statem::display_state() { fprintf(stderr, " <state "); - if (bool_values[MTSM_BR].is_known) + if (bool_values[MTSM_BR].is_known) { if (bool_values[MTSM_BR].value) fprintf(stderr, "[br]"); else fprintf(stderr, "[!br]"); - if (bool_values[MTSM_EOL].is_known) + } + if (bool_values[MTSM_EOL].is_known) { if (bool_values[MTSM_EOL].value) fprintf(stderr, "[eol]"); else fprintf(stderr, "[!eol]"); - if (int_values[MTSM_SP].is_known) + } + if (int_values[MTSM_SP].is_known) { if (int_values[MTSM_SP].value) fprintf(stderr, "[sp %d]", int_values[MTSM_SP].value); else fprintf(stderr, "[!sp]"); + } fprintf(stderr, ">"); fflush(stderr); } diff --git a/src/utils/tfmtodit/tfmtodit.cpp b/src/utils/tfmtodit/tfmtodit.cpp index 73e5c750..5f5c1d96 100644 --- a/src/utils/tfmtodit/tfmtodit.cpp +++ b/src/utils/tfmtodit/tfmtodit.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989-1992, 2000, 2001, 2004, 2009 +/* Copyright (C) 1989-1992, 2000, 2001, 2004, 2009, 2011 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -66,10 +66,10 @@ extern "C" const char *Version_string; struct char_info_word { unsigned char width_index; - char height_index; - char depth_index; - char italic_index; - char tag; + unsigned char height_index; + unsigned char depth_index; + unsigned char italic_index; + unsigned char tag; unsigned char remainder; }; |