summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwl <wl>2004-10-15 05:08:35 +0000
committerwl <wl>2004-10-15 05:08:35 +0000
commitad6de87c27b848a7fe1dc11751af77b0f5bf8da1 (patch)
tree6c5db772d705ce089442cec9356cdb28b30c46e4
parent6830c4ce4f03f5ffc462c538e6968337c210ee29 (diff)
downloadgroff-ad6de87c27b848a7fe1dc11751af77b0f5bf8da1.tar.gz
* src/devices/grohtml/html-text.cpp (html_text_get_alignment),
src/devices/grohtml/post-html.cpp (make_val, html_printer::handle_state_assertion): Fix compiler warnings. * src/roff/troff/div.cpp: Include `stringclass.h' and `mtsm.h'. (diversion::diversion): Fix order of initializers. * src/roff/troff/div.h: Don't include `mtsm.h'. * src/roff/troff/env.cpp: Include `stringclass.h' and `mtsm.h'. (environment::environment): Fix order of initializers. (environment::make_tag, environment::construct_format_state): Fix compiler warnings. * src/roff/troff/input.cpp: Include `stringclass.h' and `mtsm.h'. (input_iterator::input_iterator, macro::macro): Fix order of initializers. * src/roff/troff/mtsm.cpp: Include only necessary header files. (state_set::add, state_set::val): Fix compiler warnings. * src/roff/troff/mtsm.h: Don't include `stringclass.h'. (bool_value_state, int_value_state, units_value_state, string_value_state): Remove comma after last element which causes an error with g++ 3.3.3. * src/roff/troff/node.cpp: Include `stringclass.h'. (hline_node::hline_node, vline_node::vline_node, space_char_hmotion_node, left_italic_corrected_node): Fix compiler warnings. (zero_width_node::zero_width_node): Fix order of initializers. * src/roff/troff/node.h: Don't include `mtsm.h'. (hmotion_node): Fix compiler warnings. * src/roff/troff/number.cpp: Include `stringclass.h' and `mtsm.h'.
-rw-r--r--ChangeLog39
-rw-r--r--src/devices/grohtml/html-text.cpp2
-rw-r--r--src/devices/grohtml/post-html.cpp6
-rw-r--r--src/roff/troff/div.cpp8
-rw-r--r--src/roff/troff/div.h3
-rw-r--r--src/roff/troff/env.cpp33
-rw-r--r--src/roff/troff/input.cpp16
-rw-r--r--src/roff/troff/mtsm.cpp24
-rw-r--r--src/roff/troff/mtsm.h10
-rw-r--r--src/roff/troff/node.cpp41
-rw-r--r--src/roff/troff/node.h10
-rw-r--r--src/roff/troff/number.cpp2
12 files changed, 110 insertions, 84 deletions
diff --git a/ChangeLog b/ChangeLog
index 14b938ce..6493ae02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,42 @@
+2004-10-13 Werner LEMBERG <wl@gnu.org>
+
+ * src/devices/grohtml/html-text.cpp (html_text_get_alignment),
+ src/devices/grohtml/post-html.cpp (make_val,
+ html_printer::handle_state_assertion): Fix compiler warnings.
+
+ * src/roff/troff/div.cpp: Include `stringclass.h' and `mtsm.h'.
+ (diversion::diversion): Fix order of initializers.
+
+ * src/roff/troff/div.h: Don't include `mtsm.h'.
+
+ * src/roff/troff/env.cpp: Include `stringclass.h' and `mtsm.h'.
+ (environment::environment): Fix order of initializers.
+ (environment::make_tag, environment::construct_format_state): Fix
+ compiler warnings.
+
+ * src/roff/troff/input.cpp: Include `stringclass.h' and `mtsm.h'.
+ (input_iterator::input_iterator, macro::macro): Fix order of
+ initializers.
+
+ * src/roff/troff/mtsm.cpp: Include only necessary header files.
+ (state_set::add, state_set::val): Fix compiler warnings.
+
+ * src/roff/troff/mtsm.h: Don't include `stringclass.h'.
+ (bool_value_state, int_value_state, units_value_state,
+ string_value_state): Remove comma after last element which causes
+ an error with g++ 3.3.3.
+
+ * src/roff/troff/node.cpp: Include `stringclass.h'.
+ (hline_node::hline_node, vline_node::vline_node,
+ space_char_hmotion_node, left_italic_corrected_node): Fix compiler
+ warnings.
+ (zero_width_node::zero_width_node): Fix order of initializers.
+
+ * src/roff/troff/node.h: Don't include `mtsm.h'.
+ (hmotion_node): Fix compiler warnings.
+
+ * src/roff/troff/number.cpp: Include `stringclass.h' and `mtsm.h'.
+
2004-10-12 Gaius Mulley <gaius@glam.ac.uk>
* doc/groff.css: New file.
diff --git a/src/devices/grohtml/html-text.cpp b/src/devices/grohtml/html-text.cpp
index d98d64e1..ba5b03be 100644
--- a/src/devices/grohtml/html-text.cpp
+++ b/src/devices/grohtml/html-text.cpp
@@ -975,7 +975,7 @@ char *html_text::get_alignment (void)
p = p->next;
}
}
- return "";
+ return (char *)"";
}
/*
diff --git a/src/devices/grohtml/post-html.cpp b/src/devices/grohtml/post-html.cpp
index 5a3e48a9..ef7b6b1d 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -4637,9 +4637,9 @@ char *make_val (char *s, int v, char *id, char *f, char *l)
t++;
if (atoi(t) != v) {
if (f == NULL)
- f = "stdin";
+ f = (char *)"stdin";
if (l == NULL)
- l = "<none>";
+ l = (char *)"<none>";
fprintf(stderr, "%s:%s: grohtml assertion failed at id%s expecting %d and was given %s\n",
f, l, id, v, s);
}
@@ -4687,7 +4687,7 @@ void html_printer::handle_state_assertion (text_glob *g)
char *n = (char *)&g->text_string[11];
char *cmd = get_str(n, &n);
char *val = get_str(n, &n);
- char *id = get_str(n, &n); // unused
+ (void)get_str(n, &n); // unused
char *file= get_str(n, &n);
char *line= get_str(n, &n);
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 51d5cffb..7ad7e4ca 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -25,6 +25,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "troff.h"
#include "dictionary.h"
#include "hvunits.h"
+#include "stringclass.h"
+#include "mtsm.h"
#include "env.h"
#include "request.h"
#include "node.h"
@@ -51,9 +53,9 @@ static vunits needed_space;
diversion::diversion(symbol s)
: prev(0), nm(s), vertical_position(V0), high_water_mark(V0),
- no_space_mode(0), needs_push(0), marked_place(V0),
- any_chars_added(0), saved_seen_break(0), saved_seen_space(0),
- saved_seen_eol(0), saved_suppress_next_eol(0)
+ any_chars_added(0), no_space_mode(0), needs_push(0), saved_seen_break(0),
+ saved_seen_space(0), saved_seen_eol(0), saved_suppress_next_eol(0),
+ marked_place(V0)
{
}
diff --git a/src/roff/troff/div.h b/src/roff/troff/div.h
index 7bbe4d29..4afca14b 100644
--- a/src/roff/troff/div.h
+++ b/src/roff/troff/div.h
@@ -21,8 +21,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
void end_diversions();
-#include "mtsm.h"
-
class diversion {
friend void do_divert(int append, int boxing);
friend void end_diversions();
@@ -48,7 +46,6 @@ public:
state_set modified_tag;
vunits marked_place;
diversion(symbol s = NULL_SYMBOL);
-
virtual ~diversion();
virtual void output(node *nd, int retain_size, vunits vs, vunits post_vs,
hunits width) = 0;
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 07ebb633..ae1c1061 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -22,6 +22,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "troff.h"
#include "dictionary.h"
#include "hvunits.h"
+#include "stringclass.h"
+#include "mtsm.h"
#include "env.h"
#include "request.h"
#include "node.h"
@@ -622,10 +624,6 @@ environment::environment(symbol nm)
prev_requested_size(sizescale*10),
char_height(0),
char_slant(0),
- seen_space(0),
- seen_eol(0),
- suppress_next_eol(0),
- seen_break(0),
space_size(12),
sentence_space_size(12),
adjust_mode(ADJUST_BOTH),
@@ -653,7 +651,6 @@ environment::environment(symbol nm)
width_total(0),
space_total(0),
input_line_start(0),
- tabs(units_per_inch/2, TAB_LEFT),
line_tabs(0),
current_tab(TAB_NONE),
leader_node(0),
@@ -684,6 +681,11 @@ environment::environment(symbol nm)
prev_glyph_color(&default_color),
fill_color(&default_color),
prev_fill_color(&default_color),
+ seen_space(0),
+ seen_eol(0),
+ suppress_next_eol(0),
+ seen_break(0),
+ tabs(units_per_inch/2, TAB_LEFT),
name(nm),
control_char('.'),
no_break_control_char('\''),
@@ -714,10 +716,6 @@ environment::environment(const environment *e)
fontno(e->fontno),
prev_family(e->prev_family),
family(e->family),
- seen_space(e->seen_space),
- seen_eol(e->seen_eol),
- suppress_next_eol(e->suppress_next_eol),
- seen_break(e->seen_break),
space_size(e->space_size),
sentence_space_size(e->sentence_space_size),
adjust_mode(e->adjust_mode),
@@ -745,7 +743,6 @@ environment::environment(const environment *e)
width_total(0),
space_total(0),
input_line_start(0),
- tabs(e->tabs),
line_tabs(e->line_tabs),
current_tab(TAB_NONE),
leader_node(0),
@@ -776,6 +773,11 @@ environment::environment(const environment *e)
prev_glyph_color(e->prev_glyph_color),
fill_color(e->fill_color),
prev_fill_color(e->prev_fill_color),
+ seen_space(e->seen_space),
+ seen_eol(e->seen_eol),
+ suppress_next_eol(e->suppress_next_eol),
+ seen_break(e->seen_break),
+ tabs(e->tabs),
name(e->name), // so that eg `.if "\n[.ev]"0"' works
control_char(e->control_char),
no_break_control_char(e->no_break_control_char),
@@ -2194,7 +2196,7 @@ void environment::final_break()
do_break();
}
-node *environment::make_tag(const char *name, int i)
+node *environment::make_tag(const char *nm, int i)
{
if (is_html) {
/*
@@ -2205,7 +2207,7 @@ node *environment::make_tag(const char *name, int i)
topdiv->begin_page();
macro *m = new macro;
m->append_str("html-tag:");
- for (const char *p = name; *p; p++)
+ for (const char *p = nm; *p; p++)
if (!invalid_input_char((unsigned char)*p))
m->append(*p);
m->append(' ');
@@ -2264,7 +2266,8 @@ statem *environment::construct_state(int only_eol)
return NULL;
}
-void environment::construct_format_state(node *n, int was_centered, int fill)
+void environment::construct_format_state(node *n, int was_centered,
+ int filling)
{
if (is_html) {
// find first glyph node which has a state.
@@ -2282,12 +2285,12 @@ void environment::construct_format_state(node *n, int was_centered, int fill)
n->state->add_tag(MTSM_CE, center_lines+1);
else
n->state->add_tag_if_unknown(MTSM_CE, 0);
- n->state->add_tag_if_unknown(MTSM_FI, fill);
+ n->state->add_tag_if_unknown(MTSM_FI, filling);
n = n->next;
while (n != 0) {
if (n->state != 0) {
n->state->sub_tag_ce();
- n->state->add_tag_if_unknown(MTSM_FI, fill);
+ n->state->add_tag_if_unknown(MTSM_FI, filling);
}
n = n->next;
}
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index d43dcea3..600cf26f 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -24,17 +24,19 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "troff.h"
#include "dictionary.h"
#include "hvunits.h"
+#include "stringclass.h"
+#include "mtsm.h"
#include "env.h"
#include "request.h"
#include "node.h"
-#include "reg.h"
#include "token.h"
#include "div.h"
+#include "reg.h"
#include "charinfo.h"
-#include "font.h"
#include "macropath.h"
-#include "defs.h"
#include "input.h"
+#include "defs.h"
+#include "font.h"
#include "unicode.h"
// Needed for getpid() and isatty()
@@ -226,12 +228,12 @@ private:
};
input_iterator::input_iterator()
-: ptr(0), eptr(0), is_diversion(0)
+: is_diversion(0), ptr(0), eptr(0)
{
}
input_iterator::input_iterator(int is_div)
-: ptr(0), eptr(0), is_diversion(is_div)
+: is_diversion(is_div), ptr(0), eptr(0)
{
}
@@ -3158,8 +3160,8 @@ macro::macro()
}
macro::macro(const macro &m)
-: p(m.p), filename(m.filename), lineno(m.lineno), len(m.len),
- empty_macro(m.empty_macro), is_a_diversion(m.is_a_diversion)
+: filename(m.filename), lineno(m.lineno), len(m.len),
+ empty_macro(m.empty_macro), is_a_diversion(m.is_a_diversion), p(m.p)
{
if (p != 0)
p->count++;
diff --git a/src/roff/troff/mtsm.cpp b/src/roff/troff/mtsm.cpp
index e557295a..cecb6a66 100644
--- a/src/roff/troff/mtsm.cpp
+++ b/src/roff/troff/mtsm.cpp
@@ -23,26 +23,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern int debug_state;
#include "troff.h"
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include "dictionary.h"
#include "hvunits.h"
-#include "env.h"
-#include "request.h"
-#include "node.h"
-#include "token.h"
-#include "charinfo.h"
-#include "font.h"
-#include "reg.h"
-#include "input.h"
-#include "div.h"
-#include "geometry.h"
+#include "stringclass.h"
#include "mtsm.h"
-
-#include "nonposix.h"
+#include "env.h"
static int no_of_statems = 0; // debugging aid
@@ -637,12 +621,12 @@ int state_set::is_in(string_value_state s)
return (stringset & (1 << (int)s) != 0);
}
-void state_set::add(units_value_state i, int n)
+void state_set::add(units_value_state, int n)
{
unitsset += n;
}
-units state_set::val(units_value_state i)
+units state_set::val(units_value_state)
{
return unitsset;
}
diff --git a/src/roff/troff/mtsm.h b/src/roff/troff/mtsm.h
index 4c4d901a..f9fc1ecf 100644
--- a/src/roff/troff/mtsm.h
+++ b/src/roff/troff/mtsm.h
@@ -26,8 +26,6 @@ You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "stringclass.h"
-
struct int_value {
int value;
int is_known;
@@ -68,25 +66,25 @@ struct string_value {
enum bool_value_state {
MTSM_EOL,
MTSM_BR,
- LAST_BOOL,
+ LAST_BOOL
};
enum int_value_state {
MTSM_FI,
MTSM_RJ,
MTSM_CE,
MTSM_SP,
- LAST_INT,
+ LAST_INT
};
enum units_value_state {
MTSM_IN,
MTSM_LL,
MTSM_PO,
MTSM_TI,
- LAST_UNITS,
+ LAST_UNITS
};
enum string_value_state {
MTSM_TA,
- LAST_STRING,
+ LAST_STRING
};
struct statem {
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 94485706..6c44b393 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -29,17 +29,18 @@ extern int debug_state;
#include "dictionary.h"
#include "hvunits.h"
+#include "stringclass.h"
+#include "mtsm.h"
#include "env.h"
#include "request.h"
#include "node.h"
#include "token.h"
+#include "div.h"
+#include "reg.h"
#include "charinfo.h"
#include "font.h"
-#include "reg.h"
#include "input.h"
-#include "div.h"
#include "geometry.h"
-#include "mtsm.h"
#include "nonposix.h"
@@ -2916,13 +2917,13 @@ hline_node::~hline_node()
delete n;
}
-hline_node::hline_node(hunits i, node *c, node *next)
-: node(next), x(i), n(c)
+hline_node::hline_node(hunits i, node *c, node *nxt)
+: node(nxt), x(i), n(c)
{
}
-hline_node::hline_node(hunits i, node *c, statem *s, int pop, node *next)
-: node(next, s, pop), x(i), n(c)
+hline_node::hline_node(hunits i, node *c, statem *s, int pop, node *nxt)
+: node(nxt, s, pop), x(i), n(c)
{
}
@@ -2936,13 +2937,13 @@ hunits hline_node::width()
return x < H0 ? H0 : x;
}
-vline_node::vline_node(vunits i, node *c, node *next)
-: node(next), x(i), n(c)
+vline_node::vline_node(vunits i, node *c, node *nxt)
+: node(nxt), x(i), n(c)
{
}
-vline_node::vline_node(vunits i, node *c, statem *s, int pop, node *next)
-: node(next, s, pop), x(i), n(c)
+vline_node::vline_node(vunits i, node *c, statem *s, int pop, node *nxt)
+: node(nxt, s, pop), x(i), n(c)
{
}
@@ -2963,7 +2964,7 @@ hunits vline_node::width()
}
zero_width_node::zero_width_node(node *nd, statem *s, int pop)
-: n(nd), node(0, s, pop)
+: node(0, s, pop), n(nd)
{
}
@@ -3559,14 +3560,14 @@ void hmotion_node::asciify(macro *m)
space_char_hmotion_node::space_char_hmotion_node(hunits i, color *c,
statem *s, int pop,
- node *next)
-: hmotion_node(i, c, s, pop, next)
+ node *nxt)
+: hmotion_node(i, c, s, pop, nxt)
{
}
space_char_hmotion_node::space_char_hmotion_node(hunits i, color *c,
- node *next)
-: hmotion_node(i, c, 0, 0, next)
+ node *nxt)
+: hmotion_node(i, c, 0, 0, nxt)
{
}
@@ -5327,14 +5328,14 @@ int italic_corrected_node::is_tag()
return 0;
}
-left_italic_corrected_node::left_italic_corrected_node(node *x)
-: node(x), n(0)
+left_italic_corrected_node::left_italic_corrected_node(node *xx)
+: node(xx), n(0)
{
}
left_italic_corrected_node::left_italic_corrected_node(statem *s, int pop,
- node *x)
-: node(x, s, pop), n(0)
+ node *xx)
+: node(xx, s, pop), n(0)
{
}
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index e14886f3..a3a304f6 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -19,8 +19,6 @@ You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "mtsm.h"
-
struct hyphen_list {
unsigned char hyphen;
unsigned char breakable;
@@ -317,11 +315,11 @@ protected:
public:
hmotion_node(hunits i, color *c, node *nxt = 0)
: node(nxt), n(i), was_tab(0), unformat(0), col(c) {}
- hmotion_node(hunits i, color *c, statem *s, int divlevel, node *next = 0)
- : node(next, s, divlevel), n(i), was_tab(0), unformat(0), col(c) {}
+ hmotion_node(hunits i, color *c, statem *s, int divlevel, node *nxt = 0)
+ : node(nxt, s, divlevel), n(i), was_tab(0), unformat(0), col(c) {}
hmotion_node(hunits i, int flag1, int flag2, color *c, statem *s,
- int divlevel, node *next = 0)
- : node(next, s, divlevel), n(i), was_tab(flag1), unformat(flag2),
+ int divlevel, node *nxt = 0)
+ : node(nxt, s, divlevel), n(i), was_tab(flag1), unformat(flag2),
col(c) {}
hmotion_node(hunits i, int flag1, int flag2, color *c, node *nxt = 0)
: node(nxt), n(i), was_tab(flag1), unformat(flag2), col(c) {}
diff --git a/src/roff/troff/number.cpp b/src/roff/troff/number.cpp
index 8a5c7e44..34932e03 100644
--- a/src/roff/troff/number.cpp
+++ b/src/roff/troff/number.cpp
@@ -22,6 +22,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "troff.h"
#include "hvunits.h"
+#include "stringclass.h"
+#include "mtsm.h"
#include "env.h"
#include "token.h"
#include "div.h"