From 3a563dc01b73686eb3c0b4931dee9a334e17715e Mon Sep 17 00:00:00 2001 From: Werner LEMBERG Date: Thu, 8 Apr 2004 20:43:28 +0000 Subject: [PATCH] * src/libs/libgroff/glyphuni.cpp (glyph_to_unicode_list), src/libs/libgroff/uniglyph.cpp (unicode_to_glyph_list), src/libs/libgroff/uniuni.cpp (unicode_decompose_list), src/preproc/eqn/box.cpp (param_table), src/preproc/grn/hgraph.cpp (polyfill), src/preproc/grn/main.cpp (polyfill), src/preproc/refer/command.cpp (command_table), src/utils/tfmtodit.cpp (lig_table): Don't use anonymous types (which gcc 3.5 doesn't like). Removing many compiler warnings. groff should now compile with a C++ compiler used for C files also. [Simple variable renamings to avoid shadowing aren't logged in detail.] * src/devices/grodvi/dvi.cpp: Some local variable renamings. (draw_dvi_printer::draw) ['c']: Enclose in block. * src/devices/grohtml/post-html.cpp: Some local variable renamings. (page::add_line): Fix typos. * src/devices/grohtml/html-text.cpp: Some local variable renamings. * src/devices/grolbp/lbp.cpp: Don't define _GNU_SOURCE. Some local variable renamings. * src/devices/grolbp/lbp.h: Some local variable renamings. * src/devices/grolj4/lj4.cpp, src/devices/grotty/tty.cpp: Some local variable renamings. * src/libs/libbib/index.cpp (index_search_item_iterator::get_tag): Remove redundant local variable declaration. * src/libs/libbib/map.c (mapread, unmap): Don't use K&R style. Don't use `caddr_t' but `void *'. Enclose functions with `extern "C"' for C++. * src/libs/libdriver/input.cpp (remember_filename, remember_source_filename): Use cast for string constant. * src/libs/libgroff/font.cpp, src/libs/libgroff/fontfile.cpp, src/libs/libgroff/nametoindex.cpp, src/libs/libgroff/paper.cpp, src/libs/libgroff/geometry.cpp: Some local variable renamings. * src/libs/libgroff/iftoa.c, src/libs/libgroff/itoa.c: Don't use K&R style. Enclose functions with `extern "C"' for C++. * src/libs/libgroff/quotearg.c (TRUE,FALSE): Define as macros. (needs_quoting): Return `int'. (quote_arg): Add proper casts to malloc and realloc. * src/libs/libgroff/spawnvp.c: Compile code only for MS-DOS and various MS Windows environments. (spawnvp_wrapper): Add proper cast to malloc. * src/preproc/eqn/box.h: Remove redundant declarations of `make_script_box', `make_mark_box' and `make_lineup_box'. * src/preproc/eqn/eqn.y: Remove redundant declaration of `strsave'. * src/preproc/eqn/script.cpp, src/preproc/eqn/pile.cpp: Some local variable renamings. * src/preproc/grn/hpoint.cpp: Some local variable renamings. * src/preproc/grn/hgraph.cpp: Some local variable renamings. (dx, dy): Renamed functions to... (deltax, deltay): This. * src/preproc/grn/main.cpp: Some local variable renamings. (deffont): Add `const'. (initpic, conv): Use cast for string constant. * src/preproc/html/pre-html.cpp: Some local variable renamings. (makeFileName, alterDeviceTo, addZ): Use cast for string constant. (char_buffer::run_output_filter): Second argument is unused. * src/preproc/html/pushback.cpp: Some local variable renamings. * src/preproc/pic/pic.y: Remove redundant declaration of `do_copy'. * src/preproc/pic/object.cpp: Some local variable renamings. * src/preproc/refer/label.y (lookup_label): Remove redundant declaration of local variable. * src/preproc/soelim.cpp: Remove redundant declaration of `interpret_lf_args'. * src/preproc/tbl/main.cpp: Some local variable renamings. * src/roff/groff/groff.cpp (main): Use cast for string constant. * src/roff/groff/pipeline.c: Enclose declarations of `error', `c_fatal', and `i_to_a' with `extern "C"' for C++. Don't use C++-style comments. * src/roff/troff/env.h: Remove redundant declaration of `title'. * src/roff/troff/node.h, src/roff/troff/env.cpp, src/roff/troff/div.cpp, src/roff/troff/node.cpp: Some local variable renamings. * src/roff/troff/div.h: Remove redundant declaration of `end_diversions'. * src/roff/troff/troff.h: Remove redundant declaration of `cleanup_and_exit' * src/roff/troff/input.cpp: Remove redundant declaration of `handle_first_page_transition' and `process_input_stack'. * src/utils/hpftodit.cpp: Some local variable renamings. * src/utils/indxbib/signal.c: Enclose functions with `extern "C"' for C++. Don't define RETSIGTYPE. * src/utils/indxbib/indxbib.cpp: Some local variable renamings. * src/utils/pfbtops/pfbtops.cpp: Don't use K&R style. (error): Use `const' in argument. (main): Remove redundant declaration of `optind'. Move declaration of `Version_string' to top-level. * PROBLEMS: Document difficulties compiling signal.c if a C++ compiler is used for C. * Makefile.sub (DISTCLEANFILES): Add `test-groff'. --- ChangeLog | 114 +++++++++++++++++++++++++ Makefile.sub | 1 + PROBLEMS | 24 ++++++ src/devices/grodvi/dvi.cpp | 42 ++++----- src/devices/grohtml/html-text.cpp | 15 ++-- src/devices/grohtml/post-html.cpp | 101 +++++++++++----------- src/devices/grolbp/lbp.cpp | 10 +-- src/devices/grolbp/lbp.h | 173 +++++++++++++++++++------------------- src/devices/grolj4/lj4.cpp | 4 +- src/devices/grotty/tty.cpp | 7 +- src/libs/libbib/index.cpp | 8 +- src/libs/libbib/map.c | 38 +++++---- src/libs/libdriver/input.cpp | 22 ++--- src/libs/libgroff/font.cpp | 36 ++++---- src/libs/libgroff/fontfile.cpp | 8 +- src/libs/libgroff/geometry.cpp | 24 +++--- src/libs/libgroff/glyphuni.cpp | 4 +- src/libs/libgroff/iftoa.c | 14 ++- src/libs/libgroff/itoa.c | 16 ++-- src/libs/libgroff/nametoindex.cpp | 8 +- src/libs/libgroff/paper.cpp | 10 +-- src/libs/libgroff/quotearg.c | 8 +- src/libs/libgroff/spawnvp.c | 8 +- src/libs/libgroff/uniglyph.cpp | 4 +- src/libs/libgroff/uniuni.cpp | 4 +- src/preproc/eqn/box.cpp | 5 +- src/preproc/eqn/box.h | 5 +- src/preproc/eqn/eqn.y | 3 +- src/preproc/eqn/pile.cpp | 16 ++-- src/preproc/eqn/script.cpp | 15 ++-- src/preproc/grn/hgraph.cpp | 76 ++++++++--------- src/preproc/grn/hpoint.cpp | 22 ++--- src/preproc/grn/main.cpp | 16 ++-- src/preproc/html/pre-html.cpp | 30 +++---- src/preproc/html/pushback.cpp | 10 +-- src/preproc/pic/object.cpp | 16 ++-- src/preproc/pic/pic.y | 3 +- src/preproc/refer/command.cpp | 4 +- src/preproc/refer/label.y | 7 +- src/preproc/soelim/soelim.cpp | 4 +- src/preproc/tbl/main.cpp | 16 ++-- src/roff/groff/groff.cpp | 2 +- src/roff/groff/pipeline.c | 11 ++- src/roff/troff/div.cpp | 16 ++-- src/roff/troff/div.h | 3 +- src/roff/troff/env.cpp | 58 +++++++------ src/roff/troff/env.h | 1 - src/roff/troff/input.cpp | 12 ++- src/roff/troff/node.cpp | 81 +++++++++--------- src/roff/troff/node.h | 14 +-- src/roff/troff/troff.h | 2 - src/utils/hpftodit/hpftodit.cpp | 26 +++--- src/utils/indxbib/indxbib.cpp | 32 +++---- src/utils/indxbib/signal.c | 17 ++-- src/utils/pfbtops/pfbtops.c | 21 ++--- src/utils/tfmtodit/tfmtodit.cpp | 4 +- tmac/doc-common | 48 +++++++---- tmac/doc-syms | 2 + 58 files changed, 747 insertions(+), 554 deletions(-) diff --git a/ChangeLog b/ChangeLog index 439ed896..0a880c07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,117 @@ +2004-04-08 Art Haas + + * src/libs/libgroff/glyphuni.cpp (glyph_to_unicode_list), + src/libs/libgroff/uniglyph.cpp (unicode_to_glyph_list), + src/libs/libgroff/uniuni.cpp (unicode_decompose_list), + src/preproc/eqn/box.cpp (param_table), src/preproc/grn/hgraph.cpp + (polyfill), src/preproc/grn/main.cpp (polyfill), + src/preproc/refer/command.cpp (command_table), + src/utils/tfmtodit.cpp (lig_table): Don't use anonymous types (which + gcc 3.5 doesn't like). + +2004-04-08 Werner Lemberg + + Removing many compiler warnings. groff should now compile with + a C++ compiler used for C files also. [Simple variable renamings + to avoid shadowing aren't logged in detail.] + + * src/devices/grodvi/dvi.cpp: Some local variable renamings. + (draw_dvi_printer::draw) ['c']: Enclose in block. + + * src/devices/grohtml/post-html.cpp: Some local variable renamings. + (page::add_line): Fix typos. + * src/devices/grohtml/html-text.cpp: Some local variable renamings. + + * src/devices/grolbp/lbp.cpp: Don't define _GNU_SOURCE. + Some local variable renamings. + * src/devices/grolbp/lbp.h: Some local variable renamings. + + * src/devices/grolj4/lj4.cpp, src/devices/grotty/tty.cpp: Some local + variable renamings. + + * src/libs/libbib/index.cpp (index_search_item_iterator::get_tag): + Remove redundant local variable declaration. + * src/libs/libbib/map.c (mapread, unmap): Don't use K&R style. + Don't use `caddr_t' but `void *'. + Enclose functions with `extern "C"' for C++. + + * src/libs/libdriver/input.cpp (remember_filename, + remember_source_filename): Use cast for string constant. + + * src/libs/libgroff/font.cpp, src/libs/libgroff/fontfile.cpp, + src/libs/libgroff/nametoindex.cpp, src/libs/libgroff/paper.cpp, + src/libs/libgroff/geometry.cpp: Some local variable renamings. + * src/libs/libgroff/iftoa.c, src/libs/libgroff/itoa.c: Don't use K&R + style. + Enclose functions with `extern "C"' for C++. + * src/libs/libgroff/quotearg.c (TRUE,FALSE): Define as macros. + (needs_quoting): Return `int'. + (quote_arg): Add proper casts to malloc and realloc. + * src/libs/libgroff/spawnvp.c: Compile code only for MS-DOS and + various MS Windows environments. + (spawnvp_wrapper): Add proper cast to malloc. + + * src/preproc/eqn/box.h: Remove redundant declarations of + `make_script_box', `make_mark_box' and `make_lineup_box'. + * src/preproc/eqn/eqn.y: Remove redundant declaration of `strsave'. + * src/preproc/eqn/script.cpp, src/preproc/eqn/pile.cpp: Some local + variable renamings. + + * src/preproc/grn/hpoint.cpp: Some local variable renamings. + * src/preproc/grn/hgraph.cpp: Some local variable renamings. + (dx, dy): Renamed functions to... + (deltax, deltay): This. + * src/preproc/grn/main.cpp: Some local variable renamings. + (deffont): Add `const'. + (initpic, conv): Use cast for string constant. + + * src/preproc/html/pre-html.cpp: Some local variable renamings. + (makeFileName, alterDeviceTo, addZ): Use cast for string constant. + (char_buffer::run_output_filter): Second argument is unused. + * src/preproc/html/pushback.cpp: Some local variable renamings. + + * src/preproc/pic/pic.y: Remove redundant declaration of `do_copy'. + * src/preproc/pic/object.cpp: Some local variable renamings. + + * src/preproc/refer/label.y (lookup_label): Remove redundant + declaration of local variable. + + * src/preproc/soelim.cpp: Remove redundant declaration of + `interpret_lf_args'. + + * src/preproc/tbl/main.cpp: Some local variable renamings. + + * src/roff/groff/groff.cpp (main): Use cast for string constant. + * src/roff/groff/pipeline.c: Enclose declarations of `error', + `c_fatal', and `i_to_a' with `extern "C"' for C++. + Don't use C++-style comments. + + * src/roff/troff/env.h: Remove redundant declaration of `title'. + * src/roff/troff/node.h, src/roff/troff/env.cpp, + src/roff/troff/div.cpp, src/roff/troff/node.cpp: Some local variable + renamings. + * src/roff/troff/div.h: Remove redundant declaration of + `end_diversions'. + * src/roff/troff/troff.h: Remove redundant declaration of + `cleanup_and_exit' + * src/roff/troff/input.cpp: Remove redundant declaration of + `handle_first_page_transition' and `process_input_stack'. + + * src/utils/hpftodit.cpp: Some local variable renamings. + + * src/utils/indxbib/signal.c: Enclose functions with `extern "C"' + for C++. + Don't define RETSIGTYPE. + * src/utils/indxbib/indxbib.cpp: Some local variable renamings. + + * src/utils/pfbtops/pfbtops.cpp: Don't use K&R style. + (error): Use `const' in argument. + (main): Remove redundant declaration of `optind'. + Move declaration of `Version_string' to top-level. + + * PROBLEMS: Document difficulties compiling signal.c if a C++ + compiler is used for C. + 2004-04-07 Werner Lemberg * Makefile.sub (DISTCLEANFILES): Add `test-groff'. diff --git a/Makefile.sub b/Makefile.sub index 2b30877f..cf123eb7 100644 --- a/Makefile.sub +++ b/Makefile.sub @@ -4,6 +4,7 @@ DISTCLEANFILES=\ config.cache \ stamp-h \ Makefile \ + test-groff \ src/xditview/Imakefile \ src/xditview/Makefile \ src/xditview/*.o \ diff --git a/PROBLEMS b/PROBLEMS index c7a996b8..144ff076 100644 --- a/PROBLEMS +++ b/PROBLEMS @@ -719,6 +719,30 @@ byacc. ---------------------------------------------------------------------- +* My compiler fails to build src/utils/indxbib/signal.c, giving + messages like + + signal.c: cannot convert `int (*)(int)' to `void (*)(int)' + for argument `2' to `void (* signal(int, void (*)(int)))(int)' + + I use a C++ compiler for compiling C programs. + +The current version of the configure script doesn't handle C++ very +well if used as a substitute for a C compiler. In this particular +case, it failed to recognize the proper return type of signal handlers. +An easy fix is to manually edit the file `src/include/config.h' +(created by configure), changing the line + + #define RETSIGTYPE int + +to + + #define RETSIGTYPE void + +Say `make clean' before restarting compilation. + +---------------------------------------------------------------------- + * There are many empty `Makefile.dep' files. Is this a bug? No. Real dependency files are created with a `make depend' call. diff --git a/src/devices/grodvi/dvi.cpp b/src/devices/grodvi/dvi.cpp index 9a07cdc1..fb3636ec 100644 --- a/src/devices/grodvi/dvi.cpp +++ b/src/devices/grodvi/dvi.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003 +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -340,12 +340,12 @@ void dvi_printer::set_color(color *col) do_special(buf); } -void dvi_printer::set_char(int index, font *f, const environment *env, +void dvi_printer::set_char(int idx, font *f, const environment *env, int w, const char *) { if (*env->col != cur_color) set_color(env->col); - int code = f->get_code(index); + int code = f->get_code(idx); if (env->size != cur_point_size || f != cur_font) { cur_font = f; cur_point_size = env->size; @@ -384,7 +384,7 @@ void dvi_printer::set_char(int index, font *f, const environment *env, } possibly_begin_line(); end_h = env->hpos + w; - cur_h += scale(f->get_width(index, UNITWIDTH)/MULTIPLIER, + cur_h += scale(f->get_width(idx, UNITWIDTH)/MULTIPLIER, cur_point_size*RES_7227); if (cur_h > max_h) max_h = cur_h; @@ -709,24 +709,26 @@ void draw_dvi_printer::draw(int code, int *p, int np, const environment *env) fill_flag = 1; // fall through case 'c': - // troff adds an extra argument to C - if (np != 1 && !(code == 'C' && np == 2)) { - error("1 argument required for circle"); + { + // troff adds an extra argument to C + if (np != 1 && !(code == 'C' && np == 2)) { + error("1 argument required for circle"); + break; + } + moveto(env->hpos+p[0]/2, env->vpos); + if (fill_flag) + fill_next(env); + else + set_line_thickness(env); + int rad; + rad = milliinches(p[0]/2); + sprintf(buf, "%s 0 0 %d %d 0 6.28319", + (fill_flag ? "ia" : "ar"), + rad, + rad); + do_special(buf); break; } - moveto(env->hpos+p[0]/2, env->vpos); - if (fill_flag) - fill_next(env); - else - set_line_thickness(env); - int rad; - rad = milliinches(p[0]/2); - sprintf(buf, "%s 0 0 %d %d 0 6.28319", - (fill_flag ? "ia" : "ar"), - rad, - rad); - do_special(buf); - break; case 'l': if (np != 2) { error("2 arguments required for line"); diff --git a/src/devices/grohtml/html-text.cpp b/src/devices/grohtml/html-text.cpp index 21a79eb3..0a56a4ec 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 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. * * Gaius Mulley (gaius@glam.ac.uk) wrote html-text.cpp * @@ -654,15 +654,16 @@ void html_text::do_para (const char *arg) } void html_text::do_para (simple_output *op, const char *arg1, - int indentation, int pageoffset, int linelength) + int indentation_value, int page_offset, + int line_length) { - html_indent *indent; + html_indent *ind; - if (indentation == 0) - indent = NULL; + if (indentation_value == 0) + ind = NULL; else - indent = new html_indent(op, indentation, pageoffset, linelength); - do_para(arg1, indent); + ind = new html_indent(op, indentation_value, page_offset, line_length); + do_para(arg1, ind); } /* diff --git a/src/devices/grohtml/post-html.cpp b/src/devices/grohtml/post-html.cpp index 83382f1e..18a1d8eb 100644 --- a/src/devices/grohtml/post-html.cpp +++ b/src/devices/grohtml/post-html.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. * * Gaius Mulley (gaius@glam.ac.uk) wrote post-html.cpp * but it owes a huge amount of ideas and raw code from @@ -507,11 +507,11 @@ text_glob::text_glob (style *s, const char *str, int length, int max_vertical, int max_horizontal, bool is_troff_command, bool is_auto_image, bool is_special_command, - bool is_a_line, int line_thickness) + bool is_a_line_flag, int line_thickness) : text_style(*s), text_string(str), text_length(length), minv(min_vertical), minh(min_horizontal), maxv(max_vertical), maxh(max_horizontal), is_tag(is_troff_command), is_img_auto(is_auto_image), is_special(is_special_command), - is_line(is_a_line), thickness(line_thickness), tab(NULL) + is_line(is_a_line_flag), thickness(line_thickness), tab(NULL) { } @@ -567,11 +567,11 @@ void text_glob::text_glob_special (style *s, char *str, int length, void text_glob::text_glob_line (style *s, int min_vertical , int min_horizontal, int max_vertical , int max_horizontal, - int thickness) + int thickness_value) { text_glob *g = new text_glob(s, "", 0, min_vertical, min_horizontal, max_vertical, max_horizontal, - FALSE, FALSE, FALSE, TRUE, thickness); + FALSE, FALSE, FALSE, TRUE, thickness_value); *this = *g; delete g; } @@ -1286,15 +1286,18 @@ void page::add_tag (style *s, const string &str, void page::add_line (style *s, int line_number, - int x1, int y1, int x2, int y2, + int x_1, int y_1, int x_2, int y_2, int thickness) { - if (y1 == y2) { + if (y_1 == y_2) { text_glob *g = new text_glob(); g->text_glob_line(s, - min(y1, y2), min(x1, y2), max(y1, y2), max(x1, x2), + min(y_1, y_2), min(x_1, x_2), + max(y_1, y_2), max(x_1, x_2), thickness); - glyphs.add(g, line_number, min(y1, y2), min(x1, y2), max(y1, y2), max(x1, x2)); + glyphs.add(g, line_number, + min(y_1, y_2), min(x_1, x_2), + max(y_1, y_2), max(x_1, x_2)); } } @@ -1351,10 +1354,10 @@ void page::add_and_encode (style *s, const string &str, if (html_glyph) html_string += html_glyph; else { - int index=s->f->name_to_index((troff_charname + '\0').contents()); + int idx=s->f->name_to_index((troff_charname + '\0').contents()); - if (s->f->contains(index) && (index != 0)) - html_string += s->f->get_code(index); + if (s->f->contains(idx) && (idx != 0)) + html_string += s->f->get_code(idx); } } } else @@ -2885,7 +2888,7 @@ void html_printer::lookahead_for_tables (void) int ncol = 0; int colmin; int colmax; - html_table *table = new html_table(&html, -1); + html_table *tbl = new html_table(&html, -1); const char *tab_defs = NULL; char align = 'L'; int nf = FALSE; @@ -2914,11 +2917,11 @@ void html_printer::lookahead_for_tables (void) if (type_of_col == tab_tag && start_of_table != NULL) { page_contents->glyphs.move_left(); insert_tab_te(); - start_of_table->remember_table(table); - table = new html_table(&html, -1); + start_of_table->remember_table(tbl); + tbl = new html_table(&html, -1); page_contents->insert_tag(string("*** TAB -> COL ***")); if (tab_defs != NULL) - table->tab_stops->init(tab_defs); + tbl->tab_stops->init(tab_defs); start_of_table = NULL; last = NULL; } @@ -2932,28 +2935,28 @@ void html_printer::lookahead_for_tables (void) type_of_col = tab_tag; colmin = g->get_tab_args(&align); align = 'L'; // for now as 'C' and 'R' are broken - ncol = table->find_tab_column(colmin); + ncol = tbl->find_tab_column(colmin); colmin += pageoffset + indentation; - colmax = table->get_tab_pos(ncol+1); + colmax = tbl->get_tab_pos(ncol+1); if (colmax > 0) colmax += pageoffset + indentation; } else if (g->is_tab0()) { if (type_of_col == col_tag && start_of_table != NULL) { page_contents->glyphs.move_left(); insert_tab_te(); - start_of_table->remember_table(table); - table = new html_table(&html, -1); + start_of_table->remember_table(tbl); + tbl = new html_table(&html, -1); page_contents->insert_tag(string("*** COL -> TAB ***")); start_of_table = NULL; last = NULL; } if (tab_defs != NULL) - table->tab_stops->init(tab_defs); + tbl->tab_stops->init(tab_defs); type_of_col = tab0_tag; ncol = 1; colmin = 0; - colmax = table->get_tab_pos(2) + pageoffset + indentation; + colmax = tbl->get_tab_pos(2) + pageoffset + indentation; } else if (! g->is_a_tag()) update_min_max(type_of_col, &colmin, &colmax, g); @@ -2967,34 +2970,34 @@ void html_printer::lookahead_for_tables (void) seen_text = FALSE; } else if (g->is_ce() && (start_of_table != NULL)) { add_table_end("*** CE ***"); - start_of_table->remember_table(table); + start_of_table->remember_table(tbl); start_of_table = NULL; last = NULL; } else if (g->is_ta()) { tab_defs = g->text_string; - if (!table->tab_stops->compatible(tab_defs)) { + if (!tbl->tab_stops->compatible(tab_defs)) { if (start_of_table != NULL) { add_table_end("*** TABS ***"); - start_of_table->remember_table(table); - table = new html_table(&html, -1); + start_of_table->remember_table(tbl); + tbl = new html_table(&html, -1); start_of_table = NULL; type_of_col = none; last = NULL; } - table->tab_stops->init(tab_defs); + tbl->tab_stops->init(tab_defs); } } if (((! g->is_a_tag()) || g->is_tab()) && (start_of_table != NULL)) { // we are in a table and have a glyph - if ((ncol == 0) || (! table->add_column(ncol, colmin, colmax, align))) { + if ((ncol == 0) || (! tbl->add_column(ncol, colmin, colmax, align))) { if (ncol == 0) add_table_end("*** NCOL == 0 ***"); else add_table_end("*** CROSSED COLS ***"); - start_of_table->remember_table(table); - table = new html_table(&html, -1); + start_of_table->remember_table(tbl); + tbl = new html_table(&html, -1); start_of_table = NULL; type_of_col = none; last = NULL; @@ -3038,13 +3041,13 @@ void html_printer::lookahead_for_tables (void) page_contents->glyphs.move_left(); insert_tab_te(); - start_of_table->remember_table(table); - table = NULL; + start_of_table->remember_table(tbl); + tbl = NULL; page_contents->insert_tag(string("*** LAST ***")); } } - if (table != NULL) - delete table; + if (tbl != NULL) + delete tbl; // and reset the registers pageoffset = old_pageoffset; @@ -3498,17 +3501,17 @@ html_printer::html_printer() * add_to_sbuf - adds character code or name to the sbuf. */ -void html_printer::add_to_sbuf (int index, const string &s) +void html_printer::add_to_sbuf (int idx, const string &s) { if (sbuf_style.f == NULL) return; char *html_glyph = NULL; - unsigned int code = sbuf_style.f->get_code(index); + unsigned int code = sbuf_style.f->get_code(idx); if (s.empty()) { - if (sbuf_style.f->contains(index)) - html_glyph = (char *)sbuf_style.f->get_special_device_encoding(index); + if (sbuf_style.f->contains(idx)) + html_glyph = (char *)sbuf_style.f->get_special_device_encoding(idx); else html_glyph = NULL; @@ -3524,7 +3527,7 @@ void html_printer::add_to_sbuf (int index, const string &s) sbuf += html_glyph; } -int html_printer::sbuf_continuation (int index, const char *name, +int html_printer::sbuf_continuation (int idx, const char *name, const environment *env, int w) { /* @@ -3534,7 +3537,7 @@ int html_printer::sbuf_continuation (int index, const char *name, || ((sbuf_prev_hpos < sbuf_end_hpos) && (env->hpos < sbuf_end_hpos) && ((sbuf_end_hpos-env->hpos < env->hpos-sbuf_prev_hpos)))) { - add_to_sbuf(index, name); + add_to_sbuf(idx, name); sbuf_prev_hpos = sbuf_end_hpos; sbuf_end_hpos += w + sbuf_kern; return TRUE; @@ -3546,7 +3549,7 @@ int html_printer::sbuf_continuation (int index, const char *name, */ if (env->hpos-sbuf_end_hpos < space_width) { - add_to_sbuf(index, name); + add_to_sbuf(idx, name); sbuf_prev_hpos = sbuf_end_hpos; sbuf_end_hpos = env->hpos + w; return TRUE; @@ -3563,18 +3566,18 @@ int html_printer::sbuf_continuation (int index, const char *name, char *get_html_translation (font *f, const string &name) { - int index; + int idx; if ((f == 0) || name.empty()) return NULL; else { - index = f->name_to_index((char *)(name + '\0').contents()); - if (index == 0) { + idx = f->name_to_index((char *)(name + '\0').contents()); + if (idx == 0) { error("character `%s' not found", (name + '\0').contents()); return NULL; } else - if (f->contains(index)) - return (char *)f->get_special_device_encoding(index); + if (f->contains(idx)) + return (char *)f->get_special_device_encoding(idx); else return NULL; } @@ -3587,7 +3590,7 @@ char *get_html_translation (font *f, const string &name) * is flushed. */ -int html_printer::overstrike(int index, const char *name, const environment *env, int w) +int html_printer::overstrike(int idx, const char *name, const environment *env, int w) { if ((env->hpos < sbuf_end_hpos) || ((sbuf_kern != 0) && (sbuf_end_hpos - sbuf_kern < env->hpos))) { @@ -3597,7 +3600,7 @@ int html_printer::overstrike(int index, const char *name, const environment *env if (overstrike_detected) { /* already detected, remove previous glyph and use this glyph */ sbuf.set_length(last_sbuf_length); - add_to_sbuf(index, name); + add_to_sbuf(idx, name); sbuf_end_hpos = env->hpos + w; return TRUE; } else { @@ -3606,7 +3609,7 @@ int html_printer::overstrike(int index, const char *name, const environment *env if (! is_bold(sbuf_style.f)) flush_sbuf(); overstrike_detected = TRUE; - add_to_sbuf(index, name); + add_to_sbuf(idx, name); sbuf_end_hpos = env->hpos + w; return TRUE; } diff --git a/src/devices/grolbp/lbp.cpp b/src/devices/grolbp/lbp.cpp index 1fb6fcc8..af5e2883 100644 --- a/src/devices/grolbp/lbp.cpp +++ b/src/devices/grolbp/lbp.cpp @@ -1,5 +1,6 @@ // -*- C++ -*- -/* Copyright (C) 1994, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1994, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. Written by Francisco Andrés Verdú with many ideas taken from the other groff drivers. @@ -25,9 +26,6 @@ TODO - Add X command to include bitmaps */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif #include "driver.h" #include "lbp.h" @@ -294,10 +292,10 @@ char *lbp_printer::font_name(const lbp_font *f, const int siz) return bfont_name; } -void lbp_printer::set_char(int index, font *f, const environment *env, +void lbp_printer::set_char(int idx, font *f, const environment *env, int w, const char *) { - int code = f->get_code(index); + int code = f->get_code(idx); unsigned char ch = code & 0xff; unsigned short symbol_set = code >> 8; if (f != cur_font) { diff --git a/src/devices/grolbp/lbp.h b/src/devices/grolbp/lbp.h index 6bb8f48e..0604af27 100644 --- a/src/devices/grolbp/lbp.h +++ b/src/devices/grolbp/lbp.h @@ -59,33 +59,33 @@ lbpputc(unsigned char c) static inline void -lbpsavestatus(int index ) +lbpsavestatus(int idx ) { - fprintf(lbpoutput,"\033[%d%%y",index); + fprintf(lbpoutput,"\033[%d%%y",idx); }; static inline void -lbprestorestatus(int index ) +lbprestorestatus(int idx ) { - fprintf(lbpoutput,"\033[%d%cz",index ,'%'); + fprintf(lbpoutput,"\033[%d%cz",idx ,'%'); }; static inline void -lbpsavepos(int index) +lbpsavepos(int idx) { - fprintf(lbpoutput,"\033[1;%d;0x",index); + fprintf(lbpoutput,"\033[1;%d;0x",idx); }; static inline void -lbprestorepos(int index) +lbprestorepos(int idx) { - fprintf(lbpoutput,"\033[0;%d;0x",index); + fprintf(lbpoutput,"\033[0;%d;0x",idx); }; static inline void -lbprestoreposx(int index) +lbprestoreposx(int idx) { - fprintf(lbpoutput,"\033[0;%d;1x",index); + fprintf(lbpoutput,"\033[0;%d;1x",idx); }; static inline void @@ -407,102 +407,105 @@ splinerel(double px,double py,int flush) * The following code to draw splines is adapted from the transfig package */ static void -quadratic_spline(double a1,double b1, double a2, double b2, \ - double a3, double b3, double a4, double b4) -{ - double x1, y1, x4, y4; - double xmid, ymid; - - x1 = a1; y1 = b1; - x4 = a4; y4 = b4; - xmid = (a2 + a3)/2.0; - ymid = (b2 + b3)/2.0; - if ((fabs(x1 - xmid) < THRESHOLD) && (fabs(y1 - ymid) < THRESHOLD)) { - splinerel(xmid,ymid,0); -/* fprintf(tfp, "PA%.4f,%.4f;\n", xmid, ymid);*/ +quadratic_spline(double a_1, double b_1, double a_2, double b_2, \ + double a_3, double b_3, double a_4, double b_4) +{ + double x_1, y_1, x_4, y_4; + double x_mid, y_mid; + + x_1 = a_1; y_1 = b_1; + x_4 = a_4; y_4 = b_4; + x_mid = (a_2 + a_3)/2.0; + y_mid = (b_2 + b_3)/2.0; + if ((fabs(x_1 - x_mid) < THRESHOLD) + && (fabs(y_1 - y_mid) < THRESHOLD)) { + splinerel(x_mid, y_mid, 0); +/* fprintf(tfp, "PA%.4f,%.4f;\n", x_mid, y_mid);*/ } else { - quadratic_spline(x1, y1, ((x1+a2)/2.0), ((y1+b2)/2.0), - ((3.0*a2+a3)/4.0), ((3.0*b2+b3)/4.0), xmid, ymid); - } + quadratic_spline(x_1, y_1, ((x_1+a_2)/2.0), ((y_1+b_2)/2.0), + ((3.0*a_2+a_3)/4.0), ((3.0*b_2+b_3)/4.0), x_mid, y_mid); + } - if ((fabs(xmid - x4) < THRESHOLD) && (fabs(ymid - y4) < THRESHOLD)) { - splinerel(x4,y4,0); -/* fprintf(tfp, "PA%.4f,%.4f;\n", x4, y4);*/ + if ((fabs(x_mid - x_4) < THRESHOLD) + && (fabs(y_mid - y_4) < THRESHOLD)) { + splinerel(x_4, y_4, 0); +/* fprintf(tfp, "PA%.4f,%.4f;\n", x_4, y_4);*/ } else { - quadratic_spline(xmid, ymid, ((a2+3.0*a3)/4.0), ((b2+3.0*b3)/4.0), - ((a3+x4)/2.0), ((b3+y4)/2.0), x4, y4); - }; + quadratic_spline(x_mid, y_mid, + ((a_2+3.0*a_3)/4.0), ((b_2+3.0*b_3)/4.0), + ((a_3+x_4)/2.0), ((b_3+y_4)/2.0), x_4, y_4); + }; }; /* quadratic_spline */ #define XCOORD(i) numbers[(2*i)] #define YCOORD(i) numbers[(2*i)+1] static void -vdmspline(int numpoints, int ox,int oy, int *numbers) +vdmspline(int numpoints, int o_x, int o_y, int *numbers) { - double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4; - double x1, y1, x2, y2; + double cx_1, cy_1, cx_2, cy_2, cx_3, cy_3, cx_4, cy_4; + double x_1, y_1, x_2, y_2; char xcoord[4],ycoord[4]; int i; /*p = s->points; - x1 = p->x/ppi;*/ - x1 = ox; - y1 = oy; + x_1 = p->x/ppi;*/ + x_1 = o_x; + y_1 = o_y; /* p = p->next; - x2 = p->x/ppi; - y2 = p->y/ppi;*/ - x2 = ox + XCOORD(0); - y2 = oy + YCOORD(0); - cx1 = (x1 + x2)/2.0; - cy1 = (y1 + y2)/2.0; - cx2 = (x1 + 3.0*x2)/4.0; - cy2 = (y1 + 3.0*y2)/4.0; - -/* fprintf(stderr,"Spline %d (%d,%d)\n",numpoints,(int)x1,(int)y1);*/ - vdmprintf("1%s%s",vdmnum((int)x1,xcoord),vdmnum((int)y1,ycoord)); - splinerel(x1,y1,-1); - splinerel(cx1,cy1,0); + x_2 = p->x/ppi; + y_2 = p->y/ppi;*/ + x_2 = o_x + XCOORD(0); + y_2 = o_y + YCOORD(0); + cx_1 = (x_1 + x_2)/2.0; + cy_1 = (y_1 + y_2)/2.0; + cx_2 = (x_1 + 3.0*x_2)/4.0; + cy_2 = (y_1 + 3.0*y_2)/4.0; + +/* fprintf(stderr,"Spline %d (%d,%d)\n",numpoints,(int)x_1,(int)y_1);*/ + vdmprintf("1%s%s",vdmnum((int)x_1,xcoord),vdmnum((int)y_1,ycoord)); + splinerel(x_1,y_1,-1); + splinerel(cx_1,cy_1,0); /* fprintf(tfp, "PA%.4f,%.4f;PD%.4f,%.4f;\n", - x1, y1, cx1, cy1);*/ + x_1, y_1, cx_1, cy_1);*/ /*for (p = p->next; p != NULL; p = p->next) {*/ for (i = 1; i < (numpoints); i++) { - x1 = x2; - y1 = y2; -/* x2 = p->x/ppi; - y2 = p->y/ppi;*/ - x2 = x1 + XCOORD(i); - y2 = y1 + YCOORD(i); - cx3 = (3.0*x1 + x2)/4.0; - cy3 = (3.0*y1 + y2)/4.0; - cx4 = (x1 + x2)/2.0; - cy4 = (y1 + y2)/2.0; - /* fprintf(stderr,"Point (%d,%d) - (%d,%d)\n",(int)x1,(int)(y1),(int)x2,(int)y2);*/ - quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4); - cx1 = cx4; - cy1 = cy4; - cx2 = (x1 + 3.0*x2)/4.0; - cy2 = (y1 + 3.0*y2)/4.0; - } - x1 = x2; - y1 = y2; -/* p = s->points->next; - x2 = p->x/ppi; - y2 = p->y/ppi;*/ - x2 = ox + XCOORD(0); - y2 = oy + YCOORD(0); - cx3 = (3.0*x1 + x2)/4.0; - cy3 = (3.0*y1 + y2)/4.0; - cx4 = (x1 + x2)/2.0; - cy4 = (y1 + y2)/2.0; - splinerel(x1,y1,0); - splinerel(x1,y1,1); - /*vdmprintf("%s%s",vdmnum((int)(x1-lx),xcoord),\ - vdmnum((int)(y1-ly),ycoord));*/ + x_1 = x_2; + y_1 = y_2; +/* x_2 = p->x/ppi; + y_2 = p->y/ppi;*/ + x_2 = x_1 + XCOORD(i); + y_2 = y_1 + YCOORD(i); + cx_3 = (3.0*x_1 + x_2)/4.0; + cy_3 = (3.0*y_1 + y_2)/4.0; + cx_4 = (x_1 + x_2)/2.0; + cy_4 = (y_1 + y_2)/2.0; + /* fprintf(stderr,"Point (%d,%d) - (%d,%d)\n",(int)x_1,(int)(y_1),(int)x_2,(int)y_2);*/ + quadratic_spline(cx_1, cy_1, cx_2, cy_2, cx_3, cy_3, cx_4, cy_4); + cx_1 = cx_4; + cy_1 = cy_4; + cx_2 = (x_1 + 3.0*x_2)/4.0; + cy_2 = (y_1 + 3.0*y_2)/4.0; + } + x_1 = x_2; + y_1 = y_2; +/* p = s->points->next; + x_2 = p->x/ppi; + y_2 = p->y/ppi;*/ + x_2 = o_x + XCOORD(0); + y_2 = o_y + YCOORD(0); + cx_3 = (3.0*x_1 + x_2)/4.0; + cy_3 = (3.0*y_1 + y_2)/4.0; + cx_4 = (x_1 + x_2)/2.0; + cy_4 = (y_1 + y_2)/2.0; + splinerel(x_1, y_1, 0); + splinerel(x_1, y_1, 1); + /*vdmprintf("%s%s",vdmnum((int)(x_1-lx),xcoord),\ + vdmnum((int)(y_1-ly),ycoord));*/ vdmprintf("\x1e\n"); -/* fprintf(tfp, "PA%.4f,%.4f;PU;\n", x1, y1);*/ +/* fprintf(tfp, "PA%.4f,%.4f;PU;\n", x_1, y_1);*/ }; /* vdmspline */ diff --git a/src/devices/grolj4/lj4.cpp b/src/devices/grolj4/lj4.cpp index 83bb877b..a6287abd 100644 --- a/src/devices/grolj4/lj4.cpp +++ b/src/devices/grolj4/lj4.cpp @@ -278,10 +278,10 @@ int is_unprintable(unsigned char c) return c < 32 && (c == 0 || (7 <= c && c <= 15) || c == 27); } -void lj4_printer::set_char(int index, font *f, const environment *env, +void lj4_printer::set_char(int idx, font *f, const environment *env, int w, const char *) { - int code = f->get_code(index); + int code = f->get_code(idx); unsigned char ch = code & 0xff; unsigned short symbol_set = code >> 8; diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp index aab195d0..20225c54 100644 --- a/src/devices/grotty/tty.cpp +++ b/src/devices/grotty/tty.cpp @@ -1,5 +1,6 @@ // -*- C++ -*- -/* Copyright (C) 1989-2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -264,9 +265,9 @@ int tty_printer::tty_color(unsigned int r, return unknown_color; } -tty_printer::tty_printer(const char *device) : cached_v(0) +tty_printer::tty_printer(const char *dev) : cached_v(0) { - is_utf8 = !strcmp(device, "utf8"); + is_utf8 = !strcmp(dev, "utf8"); if (is_utf8) { hline_char = 0x2500; vline_char = 0x2502; diff --git a/src/libs/libbib/index.cpp b/src/libs/libbib/index.cpp index 3633df1c..016e4fd3 100644 --- a/src/libs/libbib/index.cpp +++ b/src/libs/libbib/index.cpp @@ -1,5 +1,6 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2004 + Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -349,7 +350,7 @@ int index_search_item_iterator::next(const linear_searcher &, } int index_search_item_iterator::get_tag(int tagno, - const linear_searcher &searcher, + const linear_searcher &searchr, const char **pp, int *lenp, reference_id *ridp) { @@ -389,7 +390,6 @@ int index_search_item_iterator::get_tag(int tagno, int length = tp->length; int err = 0; if (length == 0) { - struct stat sb; if (fstat(fileno(fp), &sb) < 0) { error("can't stat `%1': %2", filename, strerror(errno)); err = 1; @@ -426,7 +426,7 @@ int index_search_item_iterator::get_tag(int tagno, buf[didx] = buf[sidx]; } buf[length + 1] = '\n'; - res = searcher.search(buf + 1, buf + 2 + length, pp, lenp); + res = searchr.search(buf + 1, buf + 2 + length, pp, lenp); if (res && ridp) *ridp = reference_id(indx->filename_id + tp->filename_index, tp->start); diff --git a/src/libs/libbib/map.c b/src/libs/libbib/map.c index 4d878a24..a03280d4 100644 --- a/src/libs/libbib/map.c +++ b/src/libs/libbib/map.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001 +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -34,11 +34,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define MAP_FILE 0 #endif -char *mapread(fd, nbytes) - int fd; - int nbytes; +#ifdef __cplusplus +extern "C" { +#endif + +char *mapread(int fd, int nbytes) { - char *p = (char *)mmap((caddr_t)0, (size_t)nbytes, PROT_READ, + char *p = (char *)mmap((void *)0, (size_t)nbytes, PROT_READ, MAP_FILE|MAP_PRIVATE, fd, (off_t)0); if (p == (char *)-1) return 0; @@ -48,31 +50,37 @@ char *mapread(fd, nbytes) return p; } -int unmap(p, len) - char *p; - int len; +int unmap(char *p, int len) { - return munmap((caddr_t)p, len); + return munmap((void *)p, len); } +#ifdef __cplusplus +} +#endif + #else /* not HAVE_MMAP */ #include -char *mapread(fd, nbytes) - int fd; - int nbytes; +#ifdef __cplusplus +extern "C" { +#endif + +char *mapread(int fd, int nbytes) { errno = ENODEV; return 0; } -int unmap(p, len) - char *p; - int len; +int unmap(char *p, int len) { errno = EINVAL; return -1; } +#ifdef __cplusplus +} +#endif + #endif /* not HAVE_MMAP */ diff --git a/src/libs/libdriver/input.cpp b/src/libs/libdriver/input.cpp index acb6f137..810163db 100644 --- a/src/libs/libdriver/input.cpp +++ b/src/libs/libdriver/input.cpp @@ -2,7 +2,7 @@ // /src/libs/libdriver/input.cpp -/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003 +/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -280,7 +280,7 @@ public: } void append(IntArg); const IntArg * const - get_data(void) const { return (IntArg *) data; } + get_data(void) const { return (IntArg *)data; } const size_t len(void) const { return num_stored; } }; @@ -442,7 +442,7 @@ EnvStack::EnvStack(void) { num_allocated = 4; // allocate pointer to array of num_allocated pointers to environment - data = (environment **) malloc(envp_size * num_allocated); + data = (environment **)malloc(envp_size * num_allocated); if (data == 0) fatal("could not allocate environment data"); num_stored = 0; @@ -475,7 +475,7 @@ EnvStack::push(environment *e) if (num_stored >= num_allocated) { environment **old_data = data; num_allocated *= 2; - data = (environment **) malloc(envp_size * num_allocated); + data = (environment **)malloc(envp_size * num_allocated); if (data == 0) fatal("could not allocate data"); for (size_t i = 0; i < num_stored; i++) @@ -1034,13 +1034,13 @@ remember_filename(const char *filename) { char *fname; if (strcmp(filename, "-") == 0) - fname = ""; + fname = (char *)""; else - fname = (char *) filename; + fname = (char *)filename; size_t len = strlen(fname) + 1; if (current_filename != 0) free((char *)current_filename); - current_filename = (const char *) malloc(len); + current_filename = (const char *)malloc(len); if (current_filename == 0) fatal("can't malloc space for filename"); strncpy((char *)current_filename, (char *)fname, len); @@ -1060,13 +1060,13 @@ remember_source_filename(const char *filename) { char *fname; if (strcmp(filename, "-") == 0) - fname = ""; + fname = (char *)""; else - fname = (char *) filename; + fname = (char *)filename; size_t len = strlen(fname) + 1; if (current_source_filename != 0) free((char *)current_source_filename); - current_source_filename = (const char *) malloc(len); + current_source_filename = (const char *)malloc(len); if (current_source_filename == 0) fatal("can't malloc space for filename"); strncpy((char *)current_source_filename, (char *)fname, len); @@ -1083,7 +1083,7 @@ void send_draw(const Char subcmd, const IntArray * const args) { EnvInt n = (EnvInt) args->len(); - pr->draw((int) subcmd, (IntArg *) args->get_data(), n, current_env); + pr->draw((int) subcmd, (IntArg *)args->get_data(), n, current_env); } ////////////////////////////////////////////////////////////////////// diff --git a/src/libs/libgroff/font.cpp b/src/libs/libgroff/font.cpp index c633cc82..582085d8 100644 --- a/src/libs/libgroff/font.cpp +++ b/src/libs/libgroff/font.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003 +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -397,12 +397,12 @@ const char *font::get_special_device_encoding(int c) return( ch[ch_index[c]].special_device_coding ); } -void font::alloc_ch_index(int index) +void font::alloc_ch_index(int idx) { if (nindices == 0) { nindices = 128; - if (index >= nindices) - nindices = index + 10; + if (idx >= nindices) + nindices = idx + 10; ch_index = new short[nindices]; for (int i = 0; i < nindices; i++) ch_index[i] = -1; @@ -410,8 +410,8 @@ void font::alloc_ch_index(int index) else { int old_nindices = nindices; nindices *= 2; - if (index >= nindices) - nindices = index + 10; + if (idx >= nindices) + nindices = idx + 10; short *old_ch_index = ch_index; ch_index = new short[nindices]; memcpy(ch_index, old_ch_index, sizeof(short)*old_nindices); @@ -458,16 +458,16 @@ void font::compact() } } -void font::add_entry(int index, const font_char_metric &metric) +void font::add_entry(int idx, const font_char_metric &metric) { - assert(index >= 0); - if (index >= nindices) - alloc_ch_index(index); - assert(index < nindices); + assert(idx >= 0); + if (idx >= nindices) + alloc_ch_index(idx); + assert(idx < nindices); if (ch_used + 1 >= ch_size) extend_ch(); assert(ch_used + 1 < ch_size); - ch_index[index] = ch_used; + ch_index[idx] = ch_used; ch[ch_used++] = metric; } @@ -704,12 +704,12 @@ int font::load(int *not_found) t.error("unnamed character cannot be duplicate"); return 0; } - int index = name_to_index(nm); - if (index < 0) { + int idx = name_to_index(nm); + if (idx < 0) { t.error("invalid character `%1'", nm); return 0; } - copy_entry(index, last_index); + copy_entry(idx, last_index); } else { font_char_metric metric; @@ -758,9 +758,9 @@ int font::load(int *not_found) metric.special_device_coding = NULL; } else { - char *name = new char[strlen(p) + 1]; - strcpy(name, p); - metric.special_device_coding = name; + char *nam = new char[strlen(p) + 1]; + strcpy(nam, p); + metric.special_device_coding = nam; } if (strcmp(nm, "---") == 0) { last_index = number_to_index(metric.code); diff --git a/src/libs/libgroff/fontfile.cpp b/src/libs/libgroff/fontfile.cpp index 8502d12f..0f245518 100644 --- a/src/libs/libgroff/fontfile.cpp +++ b/src/libs/libgroff/fontfile.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002 +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -57,10 +57,10 @@ void font::command_line_font_dir(const char *dir) font_path.command_line_dir(dir); } -FILE *font::open_file(const char *name, char **pathp) +FILE *font::open_file(const char *nm, char **pathp) { - char *filename = new char[strlen(name) + strlen(device) + 5]; - sprintf(filename, "dev%s/%s", device, name); + char *filename = new char[strlen(nm) + strlen(device) + 5]; + sprintf(filename, "dev%s/%s", device, nm); FILE *fp = font_path.open_file(filename, pathp); a_delete filename; return fp; diff --git a/src/libs/libgroff/geometry.cpp b/src/libs/libgroff/geometry.cpp index 2bb89e41..c61876ef 100644 --- a/src/libs/libgroff/geometry.cpp +++ b/src/libs/libgroff/geometry.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003 +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Gaius Mulley using adjust_arc_center() from printer.cpp, written by James Clark. @@ -115,25 +115,25 @@ int printer::adjust_arc_center(const int *p, double *c) * max/min limits. The arc is drawn clockwise. */ -void check_output_arc_limits(int x1, int y1, - int xv1, int yv1, - int xv2, int yv2, - double c0, double c1, +void check_output_arc_limits(int x_1, int y_1, + int xv_1, int yv_1, + int xv_2, int yv_2, + double c_0, double c_1, int *minx, int *maxx, int *miny, int *maxy) { - int radius = (int)sqrt(c0 * c0 + c1 * c1); + int radius = (int)sqrt(c_0 * c_0 + c_1 * c_1); // clockwise direction - int xcenter = x1 + xv1; - int ycenter = y1 + yv1; - int xend = xcenter + xv2; - int yend = ycenter + yv2; + int xcenter = x_1 + xv_1; + int ycenter = y_1 + yv_1; + int xend = xcenter + xv_2; + int yend = ycenter + yv_2; // for convenience, transform to counterclockwise direction, // centered at the origin int xs = xend - xcenter; int ys = yend - ycenter; - int xe = x1 - xcenter; - int ye = y1 - ycenter; + int xe = x_1 - xcenter; + int ye = y_1 - ycenter; *minx = *maxx = xs; *miny = *maxy = ys; if (xe > *maxx) diff --git a/src/libs/libgroff/glyphuni.cpp b/src/libs/libgroff/glyphuni.cpp index 72258aae..979d6e22 100644 --- a/src/libs/libgroff/glyphuni.cpp +++ b/src/libs/libgroff/glyphuni.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 2002, 2003 +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Written by Werner Lemberg @@ -34,7 +34,7 @@ implement_ptable(glyph_to_unicode) PTABLE(glyph_to_unicode) glyph_to_unicode_table; -struct { +struct S { const char *key; const char *value; } glyph_to_unicode_list[] = { diff --git a/src/libs/libgroff/iftoa.c b/src/libs/libgroff/iftoa.c index 29a3d894..2d232824 100644 --- a/src/libs/libgroff/iftoa.c +++ b/src/libs/libgroff/iftoa.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2004 + Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -19,8 +20,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define INT_DIGITS 19 /* enough for 64-bit integer */ -char *if_to_a(i, decimal_point) - int i, decimal_point; +#ifdef __cplusplus +extern "C" { +#endif + +char *if_to_a(int i, int decimal_point) { /* room for a -, INT_DIGITS digits, a decimal point, and a terminating '\0' */ static char buf[INT_DIGITS + 3]; @@ -63,3 +67,7 @@ char *if_to_a(i, decimal_point) } return p; } + +#ifdef __cplusplus +} +#endif diff --git a/src/libs/libgroff/itoa.c b/src/libs/libgroff/itoa.c index 245c7dfe..0d035d06 100644 --- a/src/libs/libgroff/itoa.c +++ b/src/libs/libgroff/itoa.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2002 +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2002, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -21,8 +21,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define INT_DIGITS 19 /* enough for 64 bit integer */ #define UINT_DIGITS 20 -char *i_to_a(i) - int i; +#ifdef __cplusplus +extern "C" { +#endif + +char *i_to_a(int i) { /* Room for INT_DIGITS digits, - and '\0' */ static char buf[INT_DIGITS + 2]; @@ -44,8 +47,7 @@ char *i_to_a(i) return p; } -char *ui_to_a(i) - unsigned int i; +char *ui_to_a(unsigned int i) { /* Room for UINT_DIGITS digits and '\0' */ static char buf[UINT_DIGITS + 1]; @@ -56,3 +58,7 @@ char *ui_to_a(i) } while (i != 0); return p; } + +#ifdef __cplusplus +} +#endif diff --git a/src/libs/libgroff/nametoindex.cpp b/src/libs/libgroff/nametoindex.cpp index def26b32..5557f5dc 100644 --- a/src/libs/libgroff/nametoindex.cpp +++ b/src/libs/libgroff/nametoindex.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003 +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -107,9 +107,9 @@ int font::name_to_index(const char *s) return indexer.ascii_char_index(s[0]); /* char128 and \200 are synonyms */ if (s[0] == 'c' && s[1] == 'h' && s[2] == 'a' && s[3] == 'r') { - char *res; - long n = strtol(s + 4, &res, 10); - if (res != s + 4 && *res == '\0' && n >= 0 && n < 256) + char *val; + long n = strtol(s + 4, &val, 10); + if (val != s + 4 && *val == '\0' && n >= 0 && n < 256) return indexer.ascii_char_index((unsigned char)n); } return indexer.named_char_index(s); diff --git a/src/libs/libgroff/paper.cpp b/src/libs/libgroff/paper.cpp index db8f5bcf..94b0a737 100644 --- a/src/libs/libgroff/paper.cpp +++ b/src/libs/libgroff/paper.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 2002, 2003 +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Written by Werner Lemberg (wl@gnu.org) @@ -49,14 +49,14 @@ static void add_iso_paper(char series, int offset, } // length and width in inch -static void add_american_paper(const char *name, int index, +static void add_american_paper(const char *name, int idx, double length, double width ) { char *p = new char[strlen(name) + 1]; strcpy(p, name); - papersizes[index].name = p; - papersizes[index].length = length; - papersizes[index].width = width; + papersizes[idx].name = p; + papersizes[idx].length = length; + papersizes[idx].width = width; } int papersize_init::initialised = 0; diff --git a/src/libs/libgroff/quotearg.c b/src/libs/libgroff/quotearg.c index 728a29ea..1aedf51a 100644 --- a/src/libs/libgroff/quotearg.c +++ b/src/libs/libgroff/quotearg.c @@ -47,8 +47,10 @@ extern char *program_name; /* main program must define this */ #undef FALSE #undef TRUE +#define FALSE 0 +#define TRUE 1 -static enum {FALSE=0, TRUE} +static int needs_quoting(const char *string) { /* Scan `string' to see whether it needs quoting for MSVC `spawn'/`exec' @@ -98,7 +100,7 @@ quote_arg(char *string) * plus two enclosing quotes and one `\0' terminator. */ - if ((quoted = malloc(2 * strlen(string) + 3)) == NULL) { + if ((quoted = (char *)malloc(2 * strlen(string) + 3)) == NULL) { /* Couldn't get a buffer for the quoted string, * so complain, and bail out gracefully. */ @@ -169,7 +171,7 @@ quote_arg(char *string) *++q = '"'; *++q = '\0'; - if ((string = realloc(quoted, strlen(quoted) + 1)) == NULL) { + if ((string = (char *)realloc(quoted, strlen(quoted) + 1)) == NULL) { /* but bail out gracefully, on error */ REPORT_ERROR(QUOTE_ARG_REALLOC_ERROR); diff --git a/src/libs/libgroff/spawnvp.c b/src/libs/libgroff/spawnvp.c index e185ec30..f070b77f 100644 --- a/src/libs/libgroff/spawnvp.c +++ b/src/libs/libgroff/spawnvp.c @@ -29,6 +29,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # include #endif +#if defined(__MSDOS__) \ + || (defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN__)) \ + || defined(__EMX__) + #define SPAWN_FUNCTION_WRAPPERS 1 /* Define the default mechanism, and messages, for error reporting @@ -80,7 +84,7 @@ spawnvp_wrapper(int mode, char *path, char **argv) * We will use a copy of the `argv', in which to do the quoting, * so we must allocate space for it. */ - if ((quoted_argv = malloc(++argc * sizeof(char **))) == NULL) { + if ((quoted_argv = (char **)malloc(++argc * sizeof(char **))) == NULL) { /* If we didn't get enough space, * then complain, and bail out gracefully. */ @@ -113,4 +117,6 @@ spawnvp_wrapper(int mode, char *path, char **argv) return status; } +#endif /* __MSDOS__ || _WIN32 */ + /* spawnvp.c: end of file */ diff --git a/src/libs/libgroff/uniglyph.cpp b/src/libs/libgroff/uniglyph.cpp index aec65678..69d89e1f 100644 --- a/src/libs/libgroff/uniglyph.cpp +++ b/src/libs/libgroff/uniglyph.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 2002, 2003 +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Written by Werner Lemberg @@ -34,7 +34,7 @@ implement_ptable(unicode_to_glyph) PTABLE(unicode_to_glyph) unicode_to_glyph_table; -struct { +struct S { const char *key; const char *value; } unicode_to_glyph_list[] = { diff --git a/src/libs/libgroff/uniuni.cpp b/src/libs/libgroff/uniuni.cpp index 3f4baa42..dd5f760b 100644 --- a/src/libs/libgroff/uniuni.cpp +++ b/src/libs/libgroff/uniuni.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 2002, 2003 +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Written by Werner Lemberg @@ -39,7 +39,7 @@ PTABLE(unicode_decompose) unicode_decompose_table; // the first digit in the composite string gives the number of composites -struct { +struct S { const char *key; const char *value; } unicode_decompose_list[] = { diff --git a/src/preproc/eqn/box.cpp b/src/preproc/eqn/box.cpp index 41d8dff4..d407090a 100644 --- a/src/preproc/eqn/box.cpp +++ b/src/preproc/eqn/box.cpp @@ -1,5 +1,6 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004 + Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -80,7 +81,7 @@ int matrix_side_sep = 17; // = thin space int nroff = 0; // should we grok ndefine or tdefine? -struct { +struct S { const char *name; int *ptr; } param_table[] = { diff --git a/src/preproc/eqn/box.h b/src/preproc/eqn/box.h index 01bfe96a..fc4ac2d9 100644 --- a/src/preproc/eqn/box.h +++ b/src/preproc/eqn/box.h @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -238,9 +238,6 @@ public: }; box *split_text(char *); -box *make_script_box(box *, box *, box *); -box *make_mark_box(box *); -box *make_lineup_box(box *); box *make_delim_box(char *, box *, char *); box *make_sqrt_box(box *); box *make_prime_box(box *); diff --git a/src/preproc/eqn/eqn.y b/src/preproc/eqn/eqn.y index 833a0f01..c145b098 100644 --- a/src/preproc/eqn/eqn.y +++ b/src/preproc/eqn/eqn.y @@ -1,4 +1,4 @@ -/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -24,7 +24,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "lib.h" #include "box.h" extern int non_empty_flag; -char *strsave(const char *); int yylex(); void yyerror(const char *); %} diff --git a/src/preproc/eqn/pile.cpp b/src/preproc/eqn/pile.cpp index 0df5241f..e641b7ff 100644 --- a/src/preproc/eqn/pile.cpp +++ b/src/preproc/eqn/pile.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -114,13 +114,13 @@ void pile_box::debug_print() int matrix_box::compute_metrics(int style) { int i, j; - int maxlen = 0; + int max_len = 0; int space = 0; for (i = 0; i < len; i++) { for (j = 0; j < p[i]->len; j++) p[i]->p[j]->compute_metrics(style); - if (p[i]->len > maxlen) - maxlen = p[i]->len; + if (p[i]->len > max_len) + max_len = p[i]->len; if (p[i]->space > space) space = p[i]->space; } @@ -145,7 +145,7 @@ int matrix_box::compute_metrics(int style) printf("/\\n(.V+(\\n(.V/2)*\\n(.V\n"); printf(".nr " SUP_RAISE_FORMAT " \\n[" BASELINE_SEP_FORMAT "]*%d/2" "+%dM\n", - uid, uid, maxlen-1, axis_height - shift_down); + uid, uid, max_len-1, axis_height - shift_down); printf(".nr " HEIGHT_FORMAT " 0\\n[" SUP_RAISE_FORMAT "]+(0", uid, uid); for (i = 0; i < len; i++) @@ -153,10 +153,10 @@ int matrix_box::compute_metrics(int style) printf(")>?0\n"); printf(".nr " DEPTH_FORMAT " \\n[" BASELINE_SEP_FORMAT "]*%d-\\n[" SUP_RAISE_FORMAT "]+(0", - uid, uid, maxlen-1, uid); + uid, uid, max_len-1, uid); for (i = 0; i < len; i++) - if (p[i]->len == maxlen) - printf(">?\\n[" DEPTH_FORMAT "]", p[i]->p[maxlen-1]->uid); + if (p[i]->len == max_len) + printf(">?\\n[" DEPTH_FORMAT "]", p[i]->p[max_len-1]->uid); printf(")>?0\n"); return FOUND_NOTHING; } diff --git a/src/preproc/eqn/script.cpp b/src/preproc/eqn/script.cpp index 62a05b4f..7d038309 100644 --- a/src/preproc/eqn/script.cpp +++ b/src/preproc/eqn/script.cpp @@ -1,5 +1,6 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004 + Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -103,20 +104,20 @@ int script_box::compute_metrics(int style) else { // sup != 0 // 18c - int p; + int pos; if (style == DISPLAY_STYLE) - p = sup1; + pos = sup1; else if (style & 1) // not cramped - p = sup2; + pos = sup2; else - p = sup3; + pos = sup3; printf(".nr " SUP_RAISE_FORMAT " \\n[" SUP_RAISE_FORMAT "]>?%dM>?(\\n[" DEPTH_FORMAT "]+(%dM/4))\n", - uid, uid, p, sup->uid, x_height); + uid, uid, pos, sup->uid, x_height); // 18d if (sub != 0) { printf(".nr " SUB_LOWER_FORMAT " \\n[" SUB_LOWER_FORMAT "]>?%dM\n", - uid, uid, sub2); + uid, uid, sub2); // 18e printf(".nr " TEMP_REG " \\n[" DEPTH_FORMAT "]-\\n[" SUP_RAISE_FORMAT "]+\\n[" HEIGHT_FORMAT "]-\\n[" diff --git a/src/preproc/grn/hgraph.cpp b/src/preproc/grn/hgraph.cpp index d124c6c0..9952683a 100644 --- a/src/preproc/grn/hgraph.cpp +++ b/src/preproc/grn/hgraph.cpp @@ -43,7 +43,7 @@ extern int ytop; extern int ybottom; extern int xleft; extern int xright; -extern enum { +extern enum E { OUTLINE, FILL, BOTH } polyfill; @@ -62,8 +62,8 @@ void tmove(POINT * ptr); void cr(); void drawwig(POINT * ptr, int type); void HGtline(int x1, int y1); -void dx(double x); -void dy(double y); +void deltax(double x); +void deltay(double y); void HGArc(register int cx, register int cy, int px, int py, int angle); void picurve(register int *x, register int *y, int npts); void HGCurve(int *x, int *y, int numpoints); @@ -223,8 +223,8 @@ HGPrintElt(ELT *element, while (!Nullpoint((PTNextPoint(p1)))) { p1 = PTNextPoint(p1); - dx((double) p1->x); - dy((double) p1->y); + deltax((double) p1->x); + deltay((double) p1->y); if (length++ > LINELENGTH) { length = 0; printf("\\\n"); @@ -233,8 +233,8 @@ HGPrintElt(ELT *element, /* close polygon if not done so by user */ if ((firstx != p1->x) || (firsty != p1->y)) { - dx((double) firstx); - dy((double) firsty); + deltax((double) firstx); + deltay((double) firsty); } putchar('\''); cr(); @@ -412,7 +412,7 @@ HGSetBrush(int mode) /*----------------------------------------------------------------------------* - | Routine: dx (x_destination) + | Routine: deltax (x_destination) | | Results: Scales and outputs a number for delta x (with a leading | space) given `lastx' and x_destination. @@ -421,7 +421,7 @@ HGSetBrush(int mode) *----------------------------------------------------------------------------*/ void -dx(double x) +deltax(double x) { register int ix = (int) (x * troffscale); @@ -431,7 +431,7 @@ dx(double x) /*----------------------------------------------------------------------------* - | Routine: dy (y_destination) + | Routine: deltay (y_destination) | | Results: Scales and outputs a number for delta y (with a leading | space) given `lastyline' and y_destination. @@ -441,7 +441,7 @@ dx(double x) *----------------------------------------------------------------------------*/ void -dy(double y) +deltay(double y) { register int iy = (int) (y * troffscale); @@ -970,11 +970,11 @@ change(register int x, *----------------------------------------------------------------------------*/ void -HGtline(int x1, - int y1) +HGtline(int x_1, + int y_1) { - register int x0 = lastx; - register int y0 = lasty; + register int x_0 = lastx; + register int y_0 = lasty; register int dx; register int dy; register int oldcoord; @@ -986,7 +986,7 @@ HGtline(int x1, register int dotcounter; if (linmod == SOLID) { - line(x1, y1); + line(x_1, y_1); return; } @@ -995,11 +995,11 @@ HGtline(int x1, xinc = 1; yinc = 1; - if ((dx = x1 - x0) < 0) { + if ((dx = x_1 - x_0) < 0) { xinc = -xinc; dx = -dx; } - if ((dy = y1 - y0) < 0) { + if ((dy = y_1 - y_0) < 0) { yinc = -yinc; dy = -dy; } @@ -1007,48 +1007,48 @@ HGtline(int x1, res2 = 0; visible = 0; if (dx >= dy) { - oldcoord = y0; - while (x0 != x1) { - if ((x0 & dotcounter) && !visible) { - change(x0, y0, 0); + oldcoord = y_0; + while (x_0 != x_1) { + if ((x_0 & dotcounter) && !visible) { + change(x_0, y_0, 0); visible = 1; - } else if (visible && !(x0 & dotcounter)) { - change(x0 - xinc, oldcoord, 1); + } else if (visible && !(x_0 & dotcounter)) { + change(x_0 - xinc, oldcoord, 1); visible = 0; } if (res1 > res2) { - oldcoord = y0; + oldcoord = y_0; res2 += dx - res1; res1 = 0; - y0 += yinc; + y_0 += yinc; } res1 += dy; - x0 += xinc; + x_0 += xinc; } } else { - oldcoord = x0; - while (y0 != y1) { - if ((y0 & dotcounter) && !visible) { - change(x0, y0, 0); + oldcoord = x_0; + while (y_0 != y_1) { + if ((y_0 & dotcounter) && !visible) { + change(x_0, y_0, 0); visible = 1; - } else if (visible && !(y0 & dotcounter)) { - change(oldcoord, y0 - yinc, 1); + } else if (visible && !(y_0 & dotcounter)) { + change(oldcoord, y_0 - yinc, 1); visible = 0; } if (res1 > res2) { - oldcoord = x0; + oldcoord = x_0; res2 += dy - res1; res1 = 0; - x0 += xinc; + x_0 += xinc; } res1 += dx; - y0 += yinc; + y_0 += yinc; } } if (visible) - change(x1, y1, 1); + change(x_1, y_1, 1); else - change(x1, y1, 0); + change(x_1, y_1, 0); } /* EOF */ diff --git a/src/preproc/grn/hpoint.cpp b/src/preproc/grn/hpoint.cpp index f4e1ca82..8ef32494 100644 --- a/src/preproc/grn/hpoint.cpp +++ b/src/preproc/grn/hpoint.cpp @@ -28,22 +28,22 @@ PTMakePoint(float x, float y, POINT **pplist) { - register POINT *point; + register POINT *pt; - if (Nullpoint(point = *pplist)) { /* empty list */ + if (Nullpoint(pt = *pplist)) { /* empty list */ *pplist = (POINT *) malloc(sizeof(POINT)); - point = *pplist; + pt = *pplist; } else { - while (!Nullpoint(point->nextpt)) - point = point->nextpt; - point->nextpt = (POINT *) malloc(sizeof(POINT)); - point = point->nextpt; + while (!Nullpoint(pt->nextpt)) + pt = pt->nextpt; + pt->nextpt = (POINT *) malloc(sizeof(POINT)); + pt = pt->nextpt; } - point->x = x; - point->y = y; - point->nextpt = PTInit(); - return (point); + pt->x = x; + pt->y = y; + pt->nextpt = PTInit(); + return (pt); } /* end PTMakePoint */ /* EOF */ diff --git a/src/preproc/grn/main.cpp b/src/preproc/grn/main.cpp index 150b78f5..605049e1 100644 --- a/src/preproc/grn/main.cpp +++ b/src/preproc/grn/main.cpp @@ -125,7 +125,7 @@ int lastyline; /* A line's vertical position is NOT the */ /* `default' command and are reset each time the */ /* start of a picture (.GS) is found. */ -char *deffont[] = +const char *deffont[] = {"R", "I", "B", "S"}; int defsize[] = {10, 16, 24, 36}; @@ -160,7 +160,7 @@ int style[STYLES] = double scale = 1.0; /* no scaling, default */ int defpoint = 0; /* flag for pointsize scaling */ char *defstipple = (char *) 0; -enum { +enum E { OUTLINE, FILL, BOTH } polyfill; @@ -430,7 +430,7 @@ initpic() thick[i] = defthick[i]; } for (i = 0; i < FONTS; i++) { /* font name defaults */ - tfont[i] = deffont[i]; + tfont[i] = (char *)deffont[i]; } for (i = 0; i < SIZES; i++) { /* font size defaults */ tsize[i] = defsize[i]; @@ -518,7 +518,7 @@ conv(register FILE *fp, if (stipple == (char *) NULL) /* if user forgot stipple */ if (has_polygon(PICTURE)) /* and picture has a polygon */ - stipple = DEFSTIPPLE; /* then set the default */ + stipple = (char *)DEFSTIPPLE; /* then set the default */ if ((temp = bottompoint - toppoint) < 0.1) temp = 0.1; @@ -781,17 +781,17 @@ interpret(char *line) case 'l': /* l */ if (isdigit(str1[1])) { /* set stipple index */ - int index = atoi(str1 + 1), val; + int idx = atoi(str1 + 1), val; - if (index < 0 || index > NSTIPPLES) { - error("bad stipple number %1 at line %2", index, linenum); + if (idx < 0 || idx > NSTIPPLES) { + error("bad stipple number %1 at line %2", idx, linenum); break; } if (!defstipple_index) defstipple_index = other_stipple_index; val = atoi(str2); if (val >= 0 && val < 256) - stipple_index[index] = val; + stipple_index[idx] = val; else error("bad stipple index value at line %1", linenum); break; diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp index 0eb0772e..b0e1ed13 100644 --- a/src/preproc/html/pre-html.cpp +++ b/src/preproc/html/pre-html.cpp @@ -515,7 +515,7 @@ static void makeFileName(void) } if (image_dir == NULL) - image_dir = ""; + image_dir = (char *)""; else if (strlen(image_dir) > 0 && image_dir[strlen(image_dir) - 1] != '/') { image_dir = make_message("%s/", image_dir); @@ -676,15 +676,15 @@ void char_buffer::write_upto_newline(char_block **t, int *i, int is_html) * can_see - Return TRUE if we can see string in t->buffer[i] onwards. */ -int char_buffer::can_see(char_block **t, int *i, const char *string) +int char_buffer::can_see(char_block **t, int *i, const char *str) { int j = 0; - int l = strlen(string); + int l = strlen(str); int k = *i; char_block *s = *t; while (s) { - while (k < s->used && j < l && s->buffer[k] == string[j]) { + while (k < s->used && j < l && s->buffer[k] == str[j]) { j++; k++; } @@ -693,7 +693,7 @@ int char_buffer::can_see(char_block **t, int *i, const char *string) *t = s; return TRUE; } - else if (k < s->used && s->buffer[k] != string[j]) + else if (k < s->used && s->buffer[k] != str[j]) return( FALSE ); s = s->next; k = 0; @@ -774,11 +774,11 @@ void char_buffer::emit_troff_output(int device_format_selector) // Buffer data is written to the output stream // with no translation, for image file creation in the post-processor. - int index = 0; + int idx = 0; char_block *element = head; while (element != NULL) - write_upto_newline(&element, &index, device_format_selector); + write_upto_newline(&element, &idx, device_format_selector); #if 0 if (close(stdoutfd) < 0) @@ -1095,9 +1095,9 @@ static imageList listOfImages; // List of images defined by the region file. * image. */ -static void generateImages(char *regionFileName) +static void generateImages(char *region_file_name) { - pushBackBuffer *f=new pushBackBuffer(regionFileName); + pushBackBuffer *f=new pushBackBuffer(region_file_name); while (f->putPB(f->getPB()) != eof) { if (f->isString("grohtml-info:page")) { @@ -1199,18 +1199,18 @@ static void alterDeviceTo(int argc, char *argv[], int toImage) if (toImage) { while (i < argc) { if (strcmp(argv[i], "-Thtml") == 0) - argv[i] = IMAGE_DEVICE; + argv[i] = (char *)IMAGE_DEVICE; i++; } - argv[troff_arg] = "groff"; /* rather than troff */ + argv[troff_arg] = (char *)"groff"; /* rather than troff */ } else { while (i < argc) { if (strcmp(argv[i], IMAGE_DEVICE) == 0) - argv[i] = "-Thtml"; + argv[i] = (char *)"-Thtml"; i++; } - argv[troff_arg] = "groff"; /* use groff -Z */ + argv[troff_arg] = (char *)"groff"; /* use groff -Z */ } } @@ -1230,7 +1230,7 @@ char **addZ(int argc, char *argv[]) new_argv[i] = argv[i]; i++; } - new_argv[i] = "-Z"; + new_argv[i] = (char *)"-Z"; while (i < argc) { new_argv[i + 1] = argv[i]; i++; @@ -1275,7 +1275,7 @@ void dump_args(int argc, char *argv[]) fprintf(stderr, "\n"); } -int char_buffer::run_output_filter(int filter, int argc, char **argv) +int char_buffer::run_output_filter(int filter, int /* argc */, char **argv) { int pipedes[2]; PID_T child_pid; diff --git a/src/preproc/html/pushback.cpp b/src/preproc/html/pushback.cpp index 07a15e36..dd63032f 100644 --- a/src/preproc/html/pushback.cpp +++ b/src/preproc/html/pushback.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc. Written by Gaius Mulley (gaius@glam.ac.uk). This file is part of groff. @@ -312,7 +312,7 @@ float pushBackBuffer::readNumber (void) char *pushBackBuffer::readString (void) { char buffer[MAXPUSHBACKSTACK]; - char *string = 0; + char *str = 0; int i=0; char ch=getPB(); @@ -326,8 +326,8 @@ char *pushBackBuffer::readString (void) } if (i < MAXPUSHBACKSTACK) { buffer[i] = (char)0; - string = (char *)malloc(strlen(buffer)+1); - strcpy(string, buffer); + str = (char *)malloc(strlen(buffer)+1); + strcpy(str, buffer); } - return( string ); + return( str ); } diff --git a/src/preproc/pic/object.cpp b/src/preproc/pic/object.cpp index d5c0d6c0..a14d022a 100644 --- a/src/preproc/pic/object.cpp +++ b/src/preproc/pic/object.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003 +/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -716,9 +716,9 @@ void closed_object::set_fill(double f) fill = f; } -void closed_object::set_fill_color(char *fill) +void closed_object::set_fill_color(char *f) { - color_fill = strsave(fill); + color_fill = strsave(f); } class box_object : public closed_object { @@ -1587,21 +1587,21 @@ void arc_object::update_bounding_box(bounding_box *p) start_quad += 4.0; while (end_quad <= start_quad) end_quad += 4.0; - double radius = max(hypot(start_offset), hypot(end_offset)); + double r = max(hypot(start_offset), hypot(end_offset)); for (int q = int(start_quad) + 1; q < end_quad; q++) { position offset; switch (q % 4) { case 0: - offset.x = radius; + offset.x = r; break; case 1: - offset.y = radius; + offset.y = r; break; case 2: - offset.x = -radius; + offset.x = -r; break; case 3: - offset.y = -radius; + offset.y = -r; break; } p->encompass(cent + offset); diff --git a/src/preproc/pic/pic.y b/src/preproc/pic/pic.y index 81e0bb7e..0bd85c40 100644 --- a/src/preproc/pic/pic.y +++ b/src/preproc/pic/pic.y @@ -1,4 +1,4 @@ -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003 +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -23,7 +23,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "object.h" extern int delim_flag; -extern void do_copy(const char *); extern void copy_rest_thru(const char *, const char *); extern void copy_file_thru(const char *, const char *, const char *); extern void push_body(const char *); diff --git a/src/preproc/refer/command.cpp b/src/preproc/refer/command.cpp index a7c6bfb8..6f0e08be 100644 --- a/src/preproc/refer/command.cpp +++ b/src/preproc/refer/command.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002 +/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -632,7 +632,7 @@ a single field, ? means that the previous argument is optional, * means that the previous argument can occur any number of times. */ -struct { +struct S { const char *name; command_t func; const char *arg_types; diff --git a/src/preproc/refer/label.y b/src/preproc/refer/label.y index 2648b985..9446f19d 100644 --- a/src/preproc/refer/label.y +++ b/src/preproc/refer/label.y @@ -1,5 +1,6 @@ /* -*- C++ -*- - Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc. + Copyright (C) 1989, 1990, 1991, 1992, 2000, 2004 + Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -970,8 +971,8 @@ label_info *lookup_label(const string &label) label_table[i] = 0; for (i = 0; i < old_size; i++) if (old_table[i]) { - unsigned h = hash_string(label_pool.contents() + old_table[i]->start, - old_table[i]->length); + h = hash_string(label_pool.contents() + old_table[i]->start, + old_table[i]->length); label_info **p; for (p = label_table + (h % label_table_size); *p != 0; diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp index ec9ee6bc..733fe3c6 100644 --- a/src/preproc/soelim/soelim.cpp +++ b/src/preproc/soelim/soelim.cpp @@ -1,5 +1,6 @@ // -*- C++ -*- -/* Copyright (C) 1989-1992, 2000, 2001, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1989-1992, 2000, 2001, 2003, 2004 + Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -37,7 +38,6 @@ int compatible_flag = 0; int raw_flag = 0; int tex_flag = 0; -extern int interpret_lf_args(const char *); extern "C" const char *Version_string; int do_file(const char *filename); diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp index 8984786e..2cda7066 100644 --- a/src/preproc/tbl/main.cpp +++ b/src/preproc/tbl/main.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003 +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -1223,9 +1223,9 @@ table *process_data(table_input &in, format *f, options *opt) format_index = f->nrows - 1; // A format row that is all lines doesn't use up a data line. while (format_index < f->nrows - 1) { - int c; - for (c = 0; c < ncolumns; c++) { - entry_format *e = f->entry[format_index] + c; + int cnt; + for (cnt = 0; cnt < ncolumns; cnt++) { + entry_format *e = f->entry[format_index] + cnt; if (e->type != FORMAT_HLINE && e->type != FORMAT_DOUBLE_HLINE // Unfortunately tbl treats a span as needing data. @@ -1233,11 +1233,11 @@ table *process_data(table_input &in, format *f, options *opt) ) break; } - if (c < ncolumns) + if (cnt < ncolumns) break; - for (c = 0; c < ncolumns; c++) - tbl->add_entry(current_row, c, input_entry, - f->entry[format_index] + c, current_filename, + for (cnt = 0; cnt < ncolumns; cnt++) + tbl->add_entry(current_row, cnt, input_entry, + f->entry[format_index] + cnt, current_filename, current_lineno); tbl->add_vlines(current_row, f->vline[format_index]); format_index++; diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp index 0205fc9a..e1aae62b 100644 --- a/src/roff/groff/groff.cpp +++ b/src/roff/groff/groff.cpp @@ -304,7 +304,7 @@ int main(int argc, char **argv) const char *real_driver = 0; if (Xflag) { real_driver = postdriver; - postdriver = GXDITVIEW; + postdriver = (char *)GXDITVIEW; commands[TROFF_INDEX].append_arg("-r" XREG "=", "1"); } if (postdriver) diff --git a/src/roff/groff/pipeline.c b/src/roff/groff/pipeline.c index b51ed50e..952655f4 100644 --- a/src/roff/groff/pipeline.c +++ b/src/roff/groff/pipeline.c @@ -78,12 +78,21 @@ extern char *strerror(); #include "pipeline.h" #define error c_error + +#ifdef __cplusplus +extern "C" { +#endif + extern void error(const char *, const char *, const char *, const char *); extern void c_fatal(const char *, const char *, const char *, const char *); +extern const char *i_to_a(int); /* from libgroff */ + +#ifdef __cplusplus +} +#endif static void sys_fatal(const char *); static const char *xstrsignal(int); -const char *i_to_a(int); // from libgroff #if defined(__MSDOS__) \ diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp index 084d0b03..ae8a30ce 100644 --- a/src/roff/troff/div.cpp +++ b/src/roff/troff/div.cpp @@ -468,7 +468,7 @@ trap::trap(symbol s, vunits n, trap *p) { } -void top_level_diversion::add_trap(symbol nm, vunits pos) +void top_level_diversion::add_trap(symbol nam, vunits pos) { trap *first_free_slot = 0; trap **p; @@ -478,22 +478,22 @@ void top_level_diversion::add_trap(symbol nm, vunits pos) first_free_slot = *p; } else if ((*p)->position == pos) { - (*p)->nm = nm; + (*p)->nm = nam; return; } } if (first_free_slot) { - first_free_slot->nm = nm; + first_free_slot->nm = nam; first_free_slot->position = pos; } else - *p = new trap(nm, pos, 0); + *p = new trap(nam, pos, 0); } -void top_level_diversion::remove_trap(symbol nm) +void top_level_diversion::remove_trap(symbol nam) { for (trap *p = page_trap_list; p; p = p->next) - if (p->nm == nm) { + if (p->nm == nam) { p->nm = NULL_SYMBOL; return; } @@ -508,10 +508,10 @@ void top_level_diversion::remove_trap_at(vunits pos) } } -void top_level_diversion::change_trap(symbol nm, vunits pos) +void top_level_diversion::change_trap(symbol nam, vunits pos) { for (trap *p = page_trap_list; p; p = p->next) - if (p->nm == nm) { + if (p->nm == nam) { p->position = pos; return; } diff --git a/src/roff/troff/div.h b/src/roff/troff/div.h index bde41a8f..90755aa2 100644 --- a/src/roff/troff/div.h +++ b/src/roff/troff/div.h @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002 +/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -154,6 +154,5 @@ void continue_page_eject(); void handle_first_page_transition(); void blank_line(); void begin_page(); -void end_diversions(); extern void cleanup_and_exit(int); diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp index b78ebd5c..9a3dc171 100644 --- a/src/roff/troff/env.cpp +++ b/src/roff/troff/env.cpp @@ -113,7 +113,8 @@ int pending_output_line::output() return 1; } -void environment::output(node *nd, int no_fill, vunits vs, vunits post_vs, +void environment::output(node *nd, int no_fill_flag, + vunits vs, vunits post_vs, hunits width) { #ifdef WIDOW_CONTROL @@ -131,29 +132,30 @@ void environment::output(node *nd, int no_fill, vunits vs, vunits post_vs, #endif /* WIDOW_CONTROL */ if (!trap_sprung_flag && !pending_lines #ifdef WIDOW_CONTROL - && (!widow_control || no_fill) + && (!widow_control || no_fill_flag) #endif /* WIDOW_CONTROL */ ) { - curdiv->output(nd, no_fill, vs, post_vs, width); + curdiv->output(nd, no_fill_flag, vs, post_vs, width); emitted_node = 1; } else { pending_output_line **p; for (p = &pending_lines; *p; p = &(*p)->next) ; - *p = new pending_output_line(nd, no_fill, vs, post_vs, width); + *p = new pending_output_line(nd, no_fill_flag, vs, post_vs, width); } } // a line from .tl goes at the head of the queue -void environment::output_title(node *nd, int no_fill, vunits vs, - vunits post_vs, hunits width) +void environment::output_title(node *nd, int no_fill_flag, + vunits vs, vunits post_vs, + hunits width) { if (!trap_sprung_flag) - curdiv->output(nd, no_fill, vs, post_vs, width); + curdiv->output(nd, no_fill_flag, vs, post_vs, width); else - pending_lines = new pending_output_line(nd, no_fill, vs, post_vs, width, - pending_lines); + pending_lines = new pending_output_line(nd, no_fill_flag, vs, post_vs, + width, pending_lines); } void environment::output_pending_lines() @@ -2145,7 +2147,7 @@ void environment::final_break() * the key troff commands */ -void environment::add_html_tag(int force, const char *name) +void environment::add_html_tag(int force, const char *nm) { if (!force && (curdiv != topdiv)) return; @@ -2159,11 +2161,11 @@ void environment::add_html_tag(int force, const char *name) 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); curdiv->output(new special_node(*m), 1, 0, 0, 0); - if (strcmp(name, ".nf") == 0) + if (strcmp(nm, ".nf") == 0) curenv->ignore_next_eol = 1; } } @@ -2174,7 +2176,7 @@ void environment::add_html_tag(int force, const char *name) * of i. */ -void environment::add_html_tag(int force, const char *name, int i) +void environment::add_html_tag(int force, const char *nm, int i) { if (!force && (curdiv != topdiv)) return; @@ -2188,7 +2190,7 @@ void environment::add_html_tag(int force, 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(' '); @@ -2242,7 +2244,7 @@ void environment::add_html_tag_tabs(int force) } } -node *environment::make_html_tag(const char *name, int i) +node *environment::make_html_tag(const char *nm, int i) { if (is_html) { /* @@ -2253,7 +2255,7 @@ node *environment::make_html_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(' '); @@ -2263,7 +2265,7 @@ node *environment::make_html_tag(const char *name, int i) return 0; } -node *environment::make_html_tag(const char *name) +node *environment::make_html_tag(const char *nm) { if (is_html) { /* @@ -2274,7 +2276,7 @@ node *environment::make_html_tag(const char *name) 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); return new special_node(*m); @@ -2282,7 +2284,7 @@ node *environment::make_html_tag(const char *name) return 0; } -void environment::do_break(int spread) +void environment::do_break(int do_spread) { if (curdiv == topdiv && topdiv->before_first_page) { topdiv->begin_page(); @@ -2294,7 +2296,7 @@ void environment::do_break(int spread) // this is so that hyphenation works line = new space_node(H0, get_fill_color(), line); space_total++; - possibly_break_line(0, spread); + possibly_break_line(0, do_spread); } while (line != 0 && line->discardable()) { width_total -= line->width(); @@ -2388,8 +2390,8 @@ void title() tem->next = n; n = tem; } - hunits title_length(curenv->title_length); - hunits f = title_length - part_width[1]; + hunits length_title(curenv->title_length); + hunits f = length_title - part_width[1]; hunits f2 = f/2; n = new hmotion_node(f2 - part_width[2], curenv->get_fill_color(), n); p = part[1]; @@ -2408,7 +2410,7 @@ void title() n = tem; } curenv->output_title(n, !curenv->fill, curenv->vertical_spacing, - curenv->total_post_vertical_spacing(), title_length); + curenv->total_post_vertical_spacing(), length_title); curenv->hyphen_line_count = 0; tok.next(); } @@ -2858,25 +2860,25 @@ node *environment::make_tab_node(hunits d, node *next) void environment::handle_tab(int is_leader) { hunits d; - hunits abs; + hunits absolute; if (current_tab) wrap_up_tab(); charinfo *ci = is_leader ? leader_char : tab_char; delete leader_node; leader_node = ci ? make_char_node(ci) : 0; - tab_type t = distance_to_next_tab(&d, &abs); + tab_type t = distance_to_next_tab(&d, &absolute); switch (t) { case TAB_NONE: return; case TAB_LEFT: add_node(make_tab_node(d)); - add_node(make_html_tag("tab L", abs.to_units())); + add_node(make_html_tag("tab L", absolute.to_units())); return; case TAB_RIGHT: - add_node(make_html_tag("tab R", abs.to_units())); + add_node(make_html_tag("tab R", absolute.to_units())); break; case TAB_CENTER: - add_node(make_html_tag("tab C", abs.to_units())); + add_node(make_html_tag("tab C", absolute.to_units())); break; default: assert(0); diff --git a/src/roff/troff/env.h b/src/roff/troff/env.h index 902ff037..1c276182 100644 --- a/src/roff/troff/env.h +++ b/src/roff/troff/env.h @@ -359,7 +359,6 @@ extern void push_env(int); void init_environments(); void read_hyphen_file(const char *name); -void title(); extern double spread_limit; diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp index b055b758..66368f99 100644 --- a/src/roff/troff/input.cpp +++ b/src/roff/troff/input.cpp @@ -71,14 +71,12 @@ void init_column_requests(); static node *read_draw_node(); static void read_color_draw_node(token &); -void handle_first_page_transition(); static void push_token(const token &); void copy_file(); #ifdef COLUMN void vjustify(); #endif /* COLUMN */ void transparent_file(); -void process_input_stack(); token tok; int break_flag = 0; @@ -1910,11 +1908,11 @@ void token::next() if (s == 0) s = get_charinfo(cc == 'l' ? "ru" : "br"); type = TOKEN_NODE; - node *n = curenv->make_char_node(s); + node *char_node = curenv->make_char_node(s); if (cc == 'l') - nd = new hline_node(x, n); + nd = new hline_node(x, char_node); else - nd = new vline_node(x, n); + nd = new vline_node(x, char_node); return; } case 'm': @@ -3623,8 +3621,8 @@ int macro::empty() return empty_macro == 1; } -macro_iterator::macro_iterator(symbol s, macro &m, const char *how_invoked) -: string_iterator(m, how_invoked, s), args(0), argc(0) +macro_iterator::macro_iterator(symbol s, macro &m, const char *how_called) +: string_iterator(m, how_called, s), args(0), argc(0) { } diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp index fd263756..ef818ed7 100644 --- a/src/roff/troff/node.cpp +++ b/src/roff/troff/node.cpp @@ -399,11 +399,11 @@ symbol get_font_name(int fontno, environment *env) return f; } -hunits font_info::get_space_width(font_size fs, int space_size) +hunits font_info::get_space_width(font_size fs, int space_sz) { if (is_constant_spaced == CONSTANT_SPACE_NONE) return scale(hunits(fm->get_space_width(fs.to_scaled_points())), - space_size, 12); + space_sz, 12); else if (is_constant_spaced == CONSTANT_SPACE_ABSOLUTE) return constant_space; else @@ -2437,9 +2437,9 @@ hunits dbreak_node::width() node *dbreak_node::last_char_node() { for (node *n = none; n; n = n->next) { - node *last = n->last_char_node(); - if (last) - return last; + node *last_node = n->last_char_node(); + if (last_node) + return last_node; } return 0; } @@ -2482,7 +2482,7 @@ public: int force_tprint(); }; -node *node::add_italic_correction(hunits *width) +node *node::add_italic_correction(hunits *wd) { hunits ic = italic_correction(); if (ic.is_zero()) @@ -2490,7 +2490,7 @@ node *node::add_italic_correction(hunits *width) else { node *next1 = next; next = 0; - *width += ic; + *wd += ic; return new italic_corrected_node(this, ic, next1); } } @@ -2881,16 +2881,16 @@ bracket_node::~bracket_node() node *bracket_node::copy() { bracket_node *on = new bracket_node; - node *last = 0; + node *last_node = 0; node *tem; if (list) list->last = 0; for (tem = list; tem; tem = tem->next) { if (tem->next) tem->next->last = tem; - last = tem; + last_node = tem; } - for (tem = last; tem; tem = tem->last) + for (tem = last_node; tem; tem = tem->last) on->bracket(tem->copy()); return on; } @@ -2994,20 +2994,20 @@ void node::spread_space(int*, hunits*) { } -void space_node::spread_space(int *nspaces, hunits *desired_space) +void space_node::spread_space(int *n_spaces, hunits *desired_space) { if (!set) { - assert(*nspaces > 0); - if (*nspaces == 1) { + assert(*n_spaces > 0); + if (*n_spaces == 1) { n += *desired_space; *desired_space = H0; } else { - hunits extra = *desired_space / *nspaces; + hunits extra = *desired_space / *n_spaces; *desired_space -= extra; n += extra; } - *nspaces -= 1; + *n_spaces -= 1; set = 1; } } @@ -3338,8 +3338,8 @@ void hmotion_node::asciify(macro *m) } space_char_hmotion_node::space_char_hmotion_node(hunits i, color *c, - node *next) -: hmotion_node(i, c, next) + node *nxt) +: hmotion_node(i, c, nxt) { } @@ -3393,14 +3393,14 @@ int node::nbreaks() return 0; } -breakpoint *space_node::get_breakpoints(hunits width, int ns, +breakpoint *space_node::get_breakpoints(hunits wd, int ns, breakpoint *rest, int is_inner) { if (next && next->discardable()) return rest; breakpoint *bp = new breakpoint; bp->next = rest; - bp->width = width; + bp->width = wd; bp->nspaces = ns; bp->hyphenated = 0; if (is_inner) { @@ -3437,12 +3437,12 @@ static breakpoint *node_list_get_breakpoints(node *p, hunits *widthp, return rest; } -breakpoint *dbreak_node::get_breakpoints(hunits width, int ns, +breakpoint *dbreak_node::get_breakpoints(hunits wd, int ns, breakpoint *rest, int is_inner) { breakpoint *bp = new breakpoint; bp->next = rest; - bp->width = width; + bp->width = wd; for (node *tem = pre; tem != 0; tem = tem->next) bp->width += tem->width(); bp->nspaces = ns; @@ -3456,7 +3456,7 @@ breakpoint *dbreak_node::get_breakpoints(hunits width, int ns, bp->nd = this; bp->index = 0; } - return node_list_get_breakpoints(none, &width, ns, bp); + return node_list_get_breakpoints(none, &wd, ns, bp); } int dbreak_node::nbreaks() @@ -3983,10 +3983,10 @@ node *reverse_node_list(node *n) return r; } -void composite_node::vertical_extent(vunits *min, vunits *max) +void composite_node::vertical_extent(vunits *minimum, vunits *maximum) { n = reverse_node_list(n); - node_list_vertical_extent(n, min, max); + node_list_vertical_extent(n, minimum, maximum); n = reverse_node_list(n); } @@ -4778,9 +4778,9 @@ int hmotion_node::force_tprint() return 0; } -node *hmotion_node::add_self(node *n, hyphen_list **p) +node *hmotion_node::add_self(node *nd, hyphen_list **p) { - next = n; + next = nd; hyphen_list *pp = *p; *p = (*p)->next; delete pp; @@ -4808,9 +4808,9 @@ int space_char_hmotion_node::force_tprint() return 0; } -node *space_char_hmotion_node::add_self(node *n, hyphen_list **p) +node *space_char_hmotion_node::add_self(node *nd, hyphen_list **p) { - next = n; + next = nd; hyphen_list *pp = *p; *p = (*p)->next; delete pp; @@ -4935,8 +4935,8 @@ int italic_corrected_node::force_tprint() 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) { } @@ -5011,12 +5011,13 @@ hunits left_italic_corrected_node::width() return n ? n->width() + x : H0; } -void left_italic_corrected_node::vertical_extent(vunits *min, vunits *max) +void left_italic_corrected_node::vertical_extent(vunits *minimum, + vunits *maximum) { if (n) - n->vertical_extent(min, max); + n->vertical_extent(minimum, maximum); else - node::vertical_extent(min, max); + node::vertical_extent(minimum, maximum); } hunits left_italic_corrected_node::skew() @@ -5305,9 +5306,9 @@ const char *unbreakable_space_node::type() return "unbreakable_space_node"; } -node *unbreakable_space_node::add_self(node *n, hyphen_list **p) +node *unbreakable_space_node::add_self(node *nd, hyphen_list **p) { - next = n; + next = nd; hyphen_list *pp = *p; *p = (*p)->next; delete pp; @@ -5555,13 +5556,13 @@ void font_family::invalidate_fontno(int n) { assert(n >= 0 && n < font_table_size); dictionary_iterator iter(family_dictionary); - symbol nm; + symbol nam; font_family *fam; - while (iter.get(&nm, (void **)&fam)) { - int map_size = fam->map_size; - if (n < map_size) + while (iter.get(&nam, (void **)&fam)) { + int mapsize = fam->map_size; + if (n < mapsize) fam->map[n] = -1; - for (int i = 0; i < map_size; i++) + for (int i = 0; i < mapsize; i++) if (fam->map[i] == n) fam->map[i] = -1; } diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h index 86382b7f..09ab6050 100644 --- a/src/roff/troff/node.h +++ b/src/roff/troff/node.h @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003 +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -286,10 +286,10 @@ protected: unsigned char unformat; color *col; /* for grotty */ public: - hmotion_node(hunits i, color *c, node *next = 0) - : node(next), n(i), was_tab(0), unformat(0), col(c) {} - hmotion_node(hunits i, int flag1, int flag2, color *c, node *next = 0) - : node(next), n(i), was_tab(flag1), unformat(flag2), col(c) {} + hmotion_node(hunits i, color *c, node *nxt = 0) + : node(nxt), n(i), was_tab(0), unformat(0), 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) {} node *copy(); int reread(int *); int set_unformat_flag(); @@ -337,7 +337,7 @@ class hline_node : public node { hunits x; node *n; public: - hline_node(hunits i, node *c, node *next = 0) : node(next), x(i), n(c) {} + hline_node(hunits i, node *c, node *nxt = 0) : node(nxt), x(i), n(c) {} ~hline_node(); node *copy(); hunits width(); @@ -351,7 +351,7 @@ class vline_node : public node { vunits x; node *n; public: - vline_node(vunits i, node *c, node *next= 0) : node(next), x(i), n(c) {} + vline_node(vunits i, node *c, node *nxt = 0) : node(nxt), x(i), n(c) {} ~vline_node(); node *copy(); void tprint(troff_output_file *); diff --git a/src/roff/troff/troff.h b/src/roff/troff/troff.h index 736c7e26..f2400553 100644 --- a/src/roff/troff/troff.h +++ b/src/roff/troff/troff.h @@ -33,8 +33,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "device.h" #include "searchpath.h" -void cleanup_and_exit(int n); - typedef int units; extern units scale(units n, units x, units y); // scale n by x/y diff --git a/src/utils/hpftodit/hpftodit.cpp b/src/utils/hpftodit/hpftodit.cpp index 718af5aa..3315cf78 100644 --- a/src/utils/hpftodit/hpftodit.cpp +++ b/src/utils/hpftodit/hpftodit.cpp @@ -608,11 +608,11 @@ read_symbol_sets(File &f) break; if (j < n_symbol_sets) { for (int k = 0; k < 256; k++) { - uint16 index = symbol_set_table[j].index[k]; - if (index != NO_GLYPH - && char_table[index].symbol_set == NO_SYMBOL_SET) { - char_table[index].symbol_set = symbol_set_table[j].select; - char_table[index].code = k; + uint16 idx = symbol_set_table[j].index[k]; + if (idx != NO_GLYPH + && char_table[idx].symbol_set == NO_SYMBOL_SET) { + char_table[idx].symbol_set = symbol_set_table[j].select; + char_table[idx].code = k; } } } @@ -630,11 +630,11 @@ read_symbol_sets(File &f) break; if (j < n_symbol_sets) { for (int k = 0; k < 256; k++) { - uint16 index = symbol_set_table[j].index[k]; - if (index != NO_GLYPH - && char_table[index].symbol_set == NO_SYMBOL_SET) { - char_table[index].symbol_set = symbol_set_table[j].select; - char_table[index].code = k; + uint16 idx = symbol_set_table[j].index[k]; + if (idx != NO_GLYPH + && char_table[idx].symbol_set == NO_SYMBOL_SET) { + char_table[idx].symbol_set = symbol_set_table[j].select; + char_table[idx].code = k; } } } @@ -1176,9 +1176,9 @@ static void dump_symbol_sets(File &f) { uint32 symbol_set_dir_length = tag_info(symbol_set_tag).count; - uint32 n_symbol_sets = symbol_set_dir_length / 14; + uint32 num_symbol_sets = symbol_set_dir_length / 14; - for (uint32 i = 0; i < n_symbol_sets; i++) { + for (uint32 i = 0; i < num_symbol_sets; i++) { f.seek(tag_info(symbol_set_tag).value + i * 14); (void)f.get_uint32(); // offset to symbol set name uint32 off1 = f.get_uint32(); // offset to selection string @@ -1189,7 +1189,7 @@ dump_symbol_sets(File &f) if ('0' <= c && c <= '9') putchar(c); else if ('A' <= c && c <= 'Z') - printf(i < n_symbol_sets - 1 ? "%c," : "%c", c); + printf(i < num_symbol_sets - 1 ? "%c," : "%c", c); } } } diff --git a/src/utils/indxbib/indxbib.cpp b/src/utils/indxbib/indxbib.cpp index 2a60c156..d8a53b6d 100644 --- a/src/utils/indxbib/indxbib.cpp +++ b/src/utils/indxbib/indxbib.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989-1992, 2000, 2001, 2002, 2003 +/* Copyright (C) 1989-1992, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -119,7 +119,7 @@ int main(int argc, char **argv) static char stderr_buf[BUFSIZ]; setbuf(stderr, stderr_buf); - const char *basename = 0; + const char *base_name = 0; typedef int (*parser_t)(const char *); parser_t parser = do_file; const char *directory = 0; @@ -164,7 +164,7 @@ int main(int argc, char **argv) check_integer_arg('n', optarg, 0, &n_ignore_words); break; case 'o': - basename = optarg; + base_name = optarg; break; case 't': check_integer_arg('t', optarg, 1, &truncate_len); @@ -202,33 +202,33 @@ int main(int argc, char **argv) store_filename(ignore_fields); key_buffer = new char[truncate_len]; read_common_words_file(); - if (!basename) - basename = optind < argc ? argv[optind] : DEFAULT_INDEX_NAME; - const char *p = strrchr(basename, DIR_SEPS[0]), *p1; + if (!base_name) + base_name = optind < argc ? argv[optind] : DEFAULT_INDEX_NAME; + const char *p = strrchr(base_name, DIR_SEPS[0]), *p1; const char *sep = &DIR_SEPS[1]; while (*sep) { - p1 = strrchr(basename, *sep); + p1 = strrchr(base_name, *sep); if (p1 && (!p || p1 > p)) p = p1; sep++; } size_t name_max; if (p) { - char *dir = strsave(basename); - dir[p - basename] = '\0'; + char *dir = strsave(base_name); + dir[p - base_name] = '\0'; name_max = file_name_max(dir); a_delete dir; } else name_max = file_name_max("."); - const char *filename = p ? p + 1 : basename; + const char *filename = p ? p + 1 : base_name; if (strlen(filename) + sizeof(INDEX_SUFFIX) - 1 > name_max) fatal("`%1.%2' is too long for a filename", filename, INDEX_SUFFIX); if (p) { p++; - temp_index_file = new char[p - basename + sizeof(TEMP_INDEX_TEMPLATE)]; - memcpy(temp_index_file, basename, p - basename); - strcpy(temp_index_file + (p - basename), TEMP_INDEX_TEMPLATE); + temp_index_file = new char[p - base_name + sizeof(TEMP_INDEX_TEMPLATE)]; + memcpy(temp_index_file, base_name, p - base_name); + strcpy(temp_index_file + (p - base_name), TEMP_INDEX_TEMPLATE); } else { temp_index_file = strsave(TEMP_INDEX_TEMPLATE); @@ -281,8 +281,8 @@ int main(int argc, char **argv) write_hash_table(); if (fclose(indxfp) < 0) fatal("error closing temporary index file: %1", strerror(errno)); - char *index_file = new char[strlen(basename) + sizeof(INDEX_SUFFIX)]; - strcpy(index_file, basename); + char *index_file = new char[strlen(base_name) + sizeof(INDEX_SUFFIX)]; + strcpy(index_file, base_name); strcat(index_file, INDEX_SUFFIX); #ifdef HAVE_RENAME #ifdef __EMX__ @@ -293,7 +293,7 @@ int main(int argc, char **argv) #ifdef __MSDOS__ // RENAME could fail on plain MSDOS filesystems because // INDEX_FILE is an invalid filename, e.g. it has multiple dots. - char *fname = p ? index_file + (p - basename) : 0; + char *fname = p ? index_file + (p - base_name) : 0; char *dot = 0; // Replace the dot with an underscore and try again. diff --git a/src/utils/indxbib/signal.c b/src/utils/indxbib/signal.c index 2f7886ad..a8ab257f 100644 --- a/src/utils/indxbib/signal.c +++ b/src/utils/indxbib/signal.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 2001, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1992, 2001, 2003, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -30,14 +30,13 @@ that is correct for C++, so we implement all signal handling in C. */ #include #endif -#ifndef RETSIGTYPE -#define RETSIGTYPE void +#ifdef __cplusplus +extern "C" { #endif -extern void cleanup(); +extern void cleanup(void); -static RETSIGTYPE handle_fatal_signal(signum) - int signum; +static RETSIGTYPE handle_fatal_signal(int signum) { signal(signum, SIG_DFL); cleanup(); @@ -50,7 +49,7 @@ static RETSIGTYPE handle_fatal_signal(signum) #endif } -void catch_fatal_signals() +void catch_fatal_signals(void) { #ifdef SIGHUP signal(SIGHUP, handle_fatal_signal); @@ -59,6 +58,10 @@ void catch_fatal_signals() signal(SIGTERM, handle_fatal_signal); } +#ifdef __cplusplus +} +#endif + #ifndef HAVE_RENAME void ignore_fatal_signals() diff --git a/src/utils/pfbtops/pfbtops.c b/src/utils/pfbtops/pfbtops.c index 094d9ddf..72a100e5 100644 --- a/src/utils/pfbtops/pfbtops.c +++ b/src/utils/pfbtops/pfbtops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 2001, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1992, 2001, 2003, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -35,10 +35,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define MAX_LINE_LENGTH 78 #define HEX_DIGITS "0123456789abcdef" +extern const char *Version_string; + static char *program_name; -static void error(s) - char *s; +static void error(const char *s) { fprintf(stderr, "%s: %s\n", program_name, s); exit(2); @@ -160,12 +161,9 @@ static void get_binary(int n) putchar('\n'); } -int main(argc, argv) - int argc; - char **argv; +int main(int argc, char **argv) { int opt; - extern int optind; static const struct option long_options[] = { { "help", no_argument, 0, CHAR_MAX + 1 }, { "version", no_argument, 0, 'v' }, @@ -177,12 +175,9 @@ int main(argc, argv) while ((opt = getopt_long(argc, argv, "v", long_options, NULL)) != EOF) { switch (opt) { case 'v': - { - extern const char *Version_string; - printf("GNU pfbtops (groff) version %s\n", Version_string); - exit(0); - break; - } + printf("GNU pfbtops (groff) version %s\n", Version_string); + exit(0); + break; case CHAR_MAX + 1: /* --help */ usage(stdout); exit(0); diff --git a/src/utils/tfmtodit/tfmtodit.cpp b/src/utils/tfmtodit/tfmtodit.cpp index 9fbbe25f..1c1ba914 100644 --- a/src/utils/tfmtodit/tfmtodit.cpp +++ b/src/utils/tfmtodit/tfmtodit.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989-1992, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1989-1992, 2000, 2001, 2004 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -670,7 +670,7 @@ enum { CH_f, CH_i, CH_l, CH_ff, CH_fi, CH_fl, CH_ffi, CH_ffl }; // Each possible ligature appears in this table. -struct { +struct S { unsigned char c1, c2, res; const char *ch; } lig_table[] = { diff --git a/tmac/doc-common b/tmac/doc-common index 0d819ced..f39fbdfb 100644 --- a/tmac/doc-common +++ b/tmac/doc-common @@ -384,24 +384,34 @@ .als doc-operating-system-BSD-4.3r doc-operating-system-BSD-4.3R .ds doc-operating-system-BSD-4.4 4.4BSD . -.ds doc-operating-system-NetBSD-0.8 0.8 -.ds doc-operating-system-NetBSD-0.8a 0.8A -.ds doc-operating-system-NetBSD-0.9 0.9 -.ds doc-operating-system-NetBSD-0.9a 0.9A -.ds doc-operating-system-NetBSD-1.0 1.0 -.ds doc-operating-system-NetBSD-1.0a 1.0A -.ds doc-operating-system-NetBSD-1.1 1.1 -.ds doc-operating-system-NetBSD-1.2 1.2 -.ds doc-operating-system-NetBSD-1.2a 1.2A -.ds doc-operating-system-NetBSD-1.2b 1.2B -.ds doc-operating-system-NetBSD-1.2c 1.2C -.ds doc-operating-system-NetBSD-1.2d 1.2D -.ds doc-operating-system-NetBSD-1.2e 1.2E -.ds doc-operating-system-NetBSD-1.3 1.3 -.ds doc-operating-system-NetBSD-1.3a 1.3A -.ds doc-operating-system-NetBSD-1.4 1.4 -.ds doc-operating-system-NetBSD-1.5 1.5 -.ds doc-operating-system-NetBSD-1.6 1.6 +.ds doc-operating-system-NetBSD-0.8 0.8 +.ds doc-operating-system-NetBSD-0.8a 0.8A +.ds doc-operating-system-NetBSD-0.9 0.9 +.ds doc-operating-system-NetBSD-0.9a 0.9A +.ds doc-operating-system-NetBSD-1.0 1.0 +.ds doc-operating-system-NetBSD-1.0a 1.0A +.ds doc-operating-system-NetBSD-1.1 1.1 +.ds doc-operating-system-NetBSD-1.2 1.2 +.ds doc-operating-system-NetBSD-1.2a 1.2A +.ds doc-operating-system-NetBSD-1.2b 1.2B +.ds doc-operating-system-NetBSD-1.2c 1.2C +.ds doc-operating-system-NetBSD-1.2d 1.2D +.ds doc-operating-system-NetBSD-1.2e 1.2E +.ds doc-operating-system-NetBSD-1.3 1.3 +.ds doc-operating-system-NetBSD-1.3a 1.3A +.ds doc-operating-system-NetBSD-1.4 1.4 +.ds doc-operating-system-NetBSD-1.4.1 1.4.1 +.ds doc-operating-system-NetBSD-1.4.2 1.4.2 +.ds doc-operating-system-NetBSD-1.4.3 1.4.3 +.ds doc-operating-system-NetBSD-1.5 1.5 +.ds doc-operating-system-NetBSD-1.5.1 1.5.1 +.ds doc-operating-system-NetBSD-1.5.2 1.5.2 +.ds doc-operating-system-NetBSD-1.5.3 1.5.3 +.ds doc-operating-system-NetBSD-1.6 1.6 +.ds doc-operating-system-NetBSD-1.6.1 1.6.1 +.ds doc-operating-system-NetBSD-1.6.2 1.6.2 +.ds doc-operating-system-NetBSD-2.0 2.1 +.ds doc-operating-system-NetBSD-2.1 2.1 . .ds doc-operating-system-FreeBSD-1.0 1.0 .ds doc-operating-system-FreeBSD-1.1 1.1 @@ -438,6 +448,8 @@ .ds doc-operating-system-FreeBSD-4.7 4.7 .ds doc-operating-system-FreeBSD-4.8 4.8 .ds doc-operating-system-FreeBSD-5.0 5.0 +.ds doc-operating-system-FreeBSD-5.1 5.1 +.ds doc-operating-system-FreeBSD-5.2 5.2 . .de Os . ie "\$1"" \ diff --git a/tmac/doc-syms b/tmac/doc-syms index 2c4d56b2..60777486 100644 --- a/tmac/doc-syms +++ b/tmac/doc-syms @@ -210,6 +210,8 @@ .as doc-str-At-V.1 " \*[doc-Tn-font-size]UNIX\*[doc-str-At] .ds doc-str-At-V.2 \*[doc-Tn-font-size]AT&T\*[doc-str-At] System\~V.2 .as doc-str-At-V.2 " \*[doc-Tn-font-size]UNIX\*[doc-str-At] +.ds doc-str-At-V.3 \*[doc-Tn-font-size]AT&T\*[doc-str-At] System\~V.3 +.as doc-str-At-V.3 " \*[doc-Tn-font-size]UNIX\*[doc-str-At] .ds doc-str-At-V.4 \*[doc-Tn-font-size]AT&T\*[doc-str-At] System\~V.4 .as doc-str-At-V.4 " \*[doc-Tn-font-size]UNIX\*[doc-str-At] . -- 2.11.4.GIT