summaryrefslogtreecommitdiff
path: root/src/roff/troff/div.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix Savannah #63589.G. Branden Robinson2023-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct numerous typos and solecisms throughout the source tree. * ChangeLog: * ChangeLog.115: * ChangeLog.116: * ChangeLog.117: * ChangeLog.118: * ChangeLog.119: * ChangeLog.121: * ChangeLog.122: * Makefile.am: * NEWS: * PROBLEMS: * README: * contrib/chem/chem.am: * contrib/chem/chem.pl: * contrib/glilypond/README.txt: * contrib/glilypond/glilypond.pl: * contrib/hdtbl/groff_hdtbl.7.man: * contrib/mm/ChangeLog: * contrib/mm/m.tmac: * contrib/pdfmark/pdfmark.ms: * doc/automake.mom: * doc/groff.texi: * doc/me-revisions: * doc/webpage.ms: * m4/lib-link.m4: * man/groff.7.man: * man/groff_diff.7.man: * man/roff.7.man: * src/devices/grohtml/post-html.cpp: * src/devices/grolbp/lbp.h: * src/devices/gropdf/TODO: * src/devices/gropdf/gropdf.1.man: * src/devices/gropdf/gropdf.pl: * src/devices/xditview/ChangeLog: * src/devices/xditview/xditview.c: * src/libs/libdriver/input.cpp: * src/libs/libgroff/glyphuni.cpp: * src/preproc/eqn/eqn.1.man: * src/preproc/grn/gprint.h: * src/preproc/grn/main.cpp: * src/preproc/html/pre-html.cpp: * src/preproc/preconv/preconv.cpp: * src/preproc/tbl/table.cpp: * src/roff/groff/pipeline.c: * src/roff/groff/tests/substring_works.sh: * src/roff/groff/tests/use_point_size_escape_with_single_digit_arg.sh: * src/roff/troff/div.cpp: * src/roff/troff/input.cpp: * src/roff/troff/troff.1.man: * src/utils/grog/grog.pl: * src/utils/indxbib/indxbib.cpp: * src/utils/tfmtodit/tfmtodit.1.man: * tmac/doc-old.tmac: * tmac/doc.tmac: * tmac/groff_man.7.man.in: * tmac/hyphen.fr: Do it. Fixes <https://savannah.gnu.org/bugs/?63589>. Thanks to Bjarni Ingi Gislason for the report. * ANNOUNCE: Update bug counts. I also killed some pointless white space, refilled affected lines at 72 columns where convenient and non-disruptive to existing text flow, and corrected a misspelling of Ralph Corderoy's surname.
* [troff, man]: Tweak comments.G. Branden Robinson2022-12-121-0/+2
| | | | | | tmac/an.tmac: Fix terminological nit in comment. src/roff/troff/div.cpp: Identify a chunk that should be refactored out.
* [troff]: Trivially refactor ("constant_int_reg").G. Branden Robinson2022-12-071-2/+2
| | | | | | | | | | | | Rename class `constant_int_reg` to `readonly_register`. Say "readonly" instead of "const" to try to avoid confusion with C++ constness. Drop "int" because integer-valued registers are the norm, not the exception. * src/roff/troff/column.cpp (init_column_requests): * src/roff/troff/div.cpp (init_div_requests): * src/roff/troff/input.cpp (top level, init_input_requests): * src/roff/troff/node.cpp (init_node_requests): * src/roff/troff/reg.h: Do it.
* [troff]: Trivially refactor ("number_reg_dic...").G. Branden Robinson2022-12-071-18/+18
| | | | | | | | | | | | | | | | | | Rename `number_reg_dictionary` to `register_dictionary`. It's shorter _and_ non-abbreviated _and_ matches our documentation. * src/roff/troff/column.cpp (init_column_requests): * src/roff/troff/div.cpp (page_number, init_div_requests): * src/roff/troff/env.cpp (print_env, init_env_requests) (init_hyphen_requests): * src/roff/troff/input.cpp (length_request, interpolate_number_format) (do_register, do_if_request, main, init_registers) (init_input_requests): * src/roff/troff/node.cpp (get_register, init_node_requests): * src/roff/troff/reg.cpp (top level, define_number_reg (inline_define_reg, alter_format, remove_reg, alias_reg, rename_reg) (print_number_regs): * src/roff/troff/reg.h: Do it.
* [troff]: Quieten "transparent" error diagnostics.G. Branden Robinson2022-03-061-1/+2
| | | | | | | | | | * src/roff/troff/div.cpp (top_level_diversion::transparent_output): * src/roff/troff/input.cpp (transparent_translate): Suppress two troublesome (i.e., more or less spurious) error diagnostics about transparent output/throughput unless the environment variable `GROFF_ENABLE_TRANSPARENCY_WARNINGS` is present. This is a bit of a bodge until we get diversion sanitization worked out. See Savannah #61407.
* [troff]: Slightly refactor.G. Branden Robinson2021-12-281-6/+6
| | | | | | | | * src/roff/troff/div.cpp: * src/roff/troff/div.h: * src/roff/troff/input.cpp: Rename variables to reduce confusion between "end macros" and "end-of-input macros". Call the latter "eoi" macros for brevity.
* [troff]: Slightly refactor (boolify).G. Branden Robinson2021-12-251-8/+9
| | | | | | | | | | | | | * src/roff/troff/div.cpp: * src/roff/troff/env.cpp: * src/roff/troff/input.cpp: Rename variables and demote from `int` to `bool`. Initialize and assign them using Boolean literals. The new names try harder to express a logical predicate, and start with verbs to resist interpretation as noun phrases. - exit_started -> is_exit_underway - done_end_macro -> is_end_macro_finished - seen_last_page_ejector (demoted but not renamed) - began_page_in_end_macro (demoted but not renamed)
* [troff]: Update exit status literals.G. Branden Robinson2021-09-071-2/+2
| | | | | | | | * src/roff/troff/div.cpp (top_level_diversion::begin_page): * src/roff/troff/input.cpp (exit_troff, abort_request, do_error, fatal_with_file_and_line): Use standard C library preprocessor symbols `EXIT_SUCCESS` and `EXIT_FAILURE` instead of 0 and 1 literals, respectively.
* [troff]: Boolify members of `token` class.G. Branden Robinson2021-09-061-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/roff/troff/token.h (class token): Demote return type of several member functions from `int` to `bool` and rename them. - `backspace` -> `is_backspace` - `delimiter` -> `usable_as_delimiter` - `dummy` -> `is_dummy` - `eof` -> `is_eof` - `horizontal_space` -> `is_horizontal_space` - `hyphen_indicator` -> `is_hyphen_indicator` - `leader` -> `is_leader` - `left_brace` -> `is_left_brace` - `newline` -> `is_newline` - `page_ejector` -> `is_page_ejector` - `right_brace` -> `is_right_brace` - `space` -> `is_space` - `special` -> `is_special` - `stretchable_space` -> `is_stretchable_space` - `tab` -> `is_tab` - `transparent_dummy` -> `is_transparent_dummy` - `transparent` -> `is_transparent` - `unstretchable_space` -> `is_unstretchable_space` - `white_space` -> `is_white_space` - `zero_width_break` -> `is_zero_width_break` (class token): Drop 1991 comment anticipating that member function `nspaces` could return "2" for a "double space"; this was apparently never implemented. (class token): Drop parameter names from declarations; the prevailing style (familiar from Stroustrup) is not to use them. (token::is_special): Simplify implementation. * src/roff/troff/input.cpp (has_arg, token::usable_as_delimiter): Update definitions of above member functions not defined in token.h. * src/roff/troff/div.cpp (begin_page, space_request, need_space, output_saved_vertical_space, flush_output): * src/roff/troff/env.cpp (fill, no_fill, center, right_justify, indent, temporary_indent, margin_character, number_lines, do_break_request, hyphen_word): * src/roff/troff/input.cpp (next_file, do_overstrike, do_bracket, do_name_test, do_expr_test, do_zero_width, token::skip, has_arg, skip_line, empty_name_warning, non_empty_name_warning, do_get_long_name, process_input_stack, flush_pending_lines, decode_args, read_request, do_define_string, do_define_character, remove_character, do_define_macro, length_request, get_delim_number, get_line_arg, read_size, get_delim_name, do_register, do_width, read_title_parts, encode_char, do_special, device_request, output_request, skip_alternative, begin_alternative, nop_request, do_if_request, do_source, pipe_source, ps_bbox_request, tag, taga, do_terminal, do_translate, hyphenation_code, hyphenation_patterns_file_code, define_class, get_optional_char, check_missing_character, abort_request, copy_file, transparent_file, do_macro_source, charinfo_to_node_list, read_draw_node, read_color_draw_node): * src/roff/troff/node.cpp (get_fontno, remove_font_special_character, bold_font): * src/roff/troff/number.cpp (start_number, parse_term): * src/roff/troff/reg.cpp (define_number_reg, alter_format): Update call sites to use new names. * src/roff/troff/input.cpp (token::usable_as_delimiter, read_draw_node): Return Boolean, not integer, literals. Also add editor aid comments to ends of files lacking them. Remove old-style Emacs file-local local variable at file beginnings. Also fix white space nits.
* [troff]: Refactor `get_value` member functions.G. Branden Robinson2021-07-291-26/+26
| | | | | | | | | | | | | | | | | | | Given their names and popular "getter/setter" paradigms from many OO languages, the return type is misleading. Change it from `int` to `bool` since it returns only a success/failure status and modifies an argument (passed by reference) to deliver the requested data. * src/roff/troff/reg.h (reg, variable_reg): * src/roff/troff/div.cpp (page_offset_reg, page_length_reg, vertical_position_reg, high_water_mark_reg, distance_to_next_trap_reg, page_number_reg, no_space_mode_reg): * src/roff/troff/env.cpp (int_env_reg, vunits_env_reg, hunits_env_reg, horizontal_place_reg): * src/roff/troff/input.cpp (writable_lineno_reg): * src/roff/troff/reg.cpp (reg, number_reg, variable_reg): Update class and member function definitions to reflect the new type. Update member function definitions to return appropriate Boolean literals instead of 0 and 1.
* [troff]: Slightly refactor.G. Branden Robinson2021-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the source code slightly more accessible by using a `bool` type for a function's default parameter used as a Boolean, and comment it at call sites where the default is overridden. See also commit d56e0f1d, 25 June. * src/roff/troff/token.h (get_name, get_long_name): Change type of parameter from `int` to `bool` and default from 0 to `false`. * src/roff/troff/input.cpp (do_get_long_name, empty_name_warning, get_name, get_long_name): Change type of parameter from `int` to `bool` in declarations and definitions. * src/roff/troff/column.cpp (column_justify): * src/roff/troff/div.cpp (diversion_trap): * src/roff/troff/env.cpp (environment_switch, environment_copy, do_input_trap, set_hyphenation_language, do_hyphenation_patterns_file): * src/roff/troff/input.cpp (define_color, composite_request, do_define_string, do_define_macro, rename_macro, alias_macro, chop_macro, do_string_case_transform, substring_request, length_request, asciify_macro, unformat_macro, do_register, device_macro_request, do_if_request, do_source, ps_bbox_request, do_open, close_request, do_write_request, write_macro_request, define_class, copy_file, vjustify, transparent_file, do_macro_source): * src/roff/troff/node.cpp (font_translate, font_position, style, get_fontno): * src/roff/troff/reg.cpp (define_number_reg, inline_define_reg, alter_format, alias_reg, rename_reg): Update call sites. Add comment indicating meaning of parameter.
* Lower new unplanted trap error to 'mac' warning.G. Branden Robinson2020-12-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | * src/roff/troff/div.cpp (top_level_diversion::change_trap): Change error upon invalid attempt to move an unplanted trap into a warning of type 'mac'. This somewhat stretches the documented semantics of the 'mac' warning type, so recast them to accommodate the new instance. * doc/groff.texi (Warnings): * src/roff/troff/troff.1.man (Warnings): Recast description of 'mac' warning type to include the above scenario. Recast to mention boxes as well as traditional diversions. Refer to macros, strings, diversions, and boxes collectively as "objects" instead of "macros", avoiding synecdoche. Use complete sentences. Thanks to Bjarni Ingi Gislason for reporting the diagnostic arising in real life, and to Peter Schaffter for the discussion and recommendation. Some bike sheds get painted quickly! Fixes <https://savannah.gnu.org/bugs/?59573>.
* src/roff/troff/div.cpp: Error on meaningless .ch.G. Branden Robinson2020-11-181-1/+2
| | | | | | | | | * src/roff/troff/div.cpp (top_level_diversion::change_trap): Emit error diagnostic if an attempt is made to move an unplanted macro. This could have been a warning, as it's pretty harmless (though possibly a big surprise to anyone who was wondering why their .ch was a no-op), but there's no good warning category for this kind of problem and I am not about to start a bike shed discussion about it right now.
* Update copyright1.23.0.rc1Bertrand Garrigues2020-11-111-1/+1
| | | | | | | | * update-copyright.sh: use gnulib's 'update-copyright' script. Pass this script in directories 'arch', 'contrib', 'font', 'man', 'tmac', 'src' and on a list of extra files. * FOR-RELEASE: mention this point.
* Revert "Update copyright"Bertrand Garrigues2020-10-251-1/+1
| | | | | | This reverts commit a2e955e07354c83939fabffebcf720d3333d1f6b. Some files (COPYING, FDL, bootstrap) should not have been updated
* Update copyrightBertrand Garrigues2020-10-251-1/+1
| | | | | | | | Use gnulib's update-copyright script. * src/roff/groff/groff.cpp: update the printf displayed when 'groff -v' is invoked. * FOR-RELEASE: mention this point.
* Update editor aids in some C++ source files.G. Branden Robinson2020-10-081-1/+6
| | | | | | | | Assist Vim as well as Emacs, and set fill-column/textwidth to 72, like other groff source files. Use Vim settings that work well with GNU indentation style. Drop short-form Emacs Local Variable setting.
* Fix SEGV arising from recursing destructor.G. Branden Robinson2020-09-291-1/+4
| | | | | | | | | | | | | | | | * src/roff/troff/node.h (output_file): Add class member `is_dying` to track whether destructor has already been entered; initialize false. * src/roff/troff/node.cpp (real_output_file::~real_output_file): Set `is_dying` true when destructor entered. * src/roff/troff/div.cpp (cleanup_and_exit): Only delete `the_output` object if it is not already being destroyed. Thanks to "hackerb9" for reporting the problem. Problem appears to date back to groff 1.02 (June 1991) or earlier. Fixes <https://savannah.gnu.org/bugs/index.php?59202>.
* src/roff/troff/div.cpp: Fix misleading diagnostic.G. Branden Robinson2020-09-251-1/+1
| | | | | | | | src/roff/troff/div.cpp (top_level_diversion::clear_diversion_trap): Fix copy and paste error in diagnostic, which wrongly reported that a top-level diversion trap couldn't be "set" when "clear"ed was meant. Dates back to 1991-06-21 or earlier.
* Update copyright (use gnulib's update-copyright script)Bertrand Garrigues2018-07-031-1/+1
|
* src: Fix `quote style' in comments and plaintext.G. Branden Robinson2017-11-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/include/include.am: * src/libs/libbib/libbib.am: * src/libs/libdriver/libdriver.am: * src/libs/libgroff/libgroff.am: * src/libs/libxutil/libxutil.am: * src/roff/groff/groff.am: * src/roff/grog/grog.am: * src/roff/troff/troff.am: * src/utils/addftinfo/addftinfo.am: * src/utils/afmtodit/afmtodit.am: * src/utils/hpftodit/hpftodit.am: + Update and parallelize editor aid comments. * src/include/font.h: * src/libs/libdriver/input.cpp: * src/libs/libgroff/glyphuni.cpp * src/libs/libgroff/quotearg.c: * src/libs/libgroff/spawnvp.c: * src/preproc/grn/main.cpp: * src/preproc/pic/object.cpp: * src/roff/troff/dictionary.cpp: * src/roff/troff/div.cpp: * src/roff/troff/token.h: * src/roff/troff/troff.am: + Remove trailing whitespace from lines near other changes. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com>
* src: Migrate diagnostics away from `these quotes'.G. Branden Robinson2017-11-091-1/+1
| | | | | | Fix bug https://savannah.gnu.org/bugs/?52374. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com>
* Put two spaces between sentences in GPL notice.G. Branden Robinson2017-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fixes half of Savannah #51609 but applies it much more generally. This is a wide-ranging change, but it makes these notices consistent with modern copies of the GPLv3 text. (Some of these files are not GPLv3, but that's where the boilerplate comes from; GPLv2 and LGPLv2.x used semicolons to separate these clauses instead.) If the next resync with Autotools regresses some of these, well, that's a bug in Autotools. I checked with wc -L, and no file grew its longest line to 81 characters due to this change. contrib/hdtbl/hdmisc.tmac-u only: Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is> Blame me for the rest. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com>
* Use "e.g." correctly in documentation, comments.G. Branden Robinson2017-10-221-2/+2
| | | | | | | | | | | | The Latin phrase "exempli gratia" is abbreviated "e.g." in English, and means "for example", so it gets set off with commas just as the latter would. Stay within 80 columns in files that respect that limit. Kill nearby useless trailing whitespace where it was obvious. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/*: Improve the license information.Bernd Warken2014-09-181-2/+1
|
* Update copyright year.Werner LEMBERG2009-01-051-1/+1
|
* * */*: Update GPL2 to GPL3.Werner LEMBERG2009-01-041-5/+4
|
* * doc/groff.texinfo (Page Location Traps) [.wh]: Give more detailsWerner LEMBERG2006-11-131-4/+6
| | | | on negative trap positions.
* * All affected files: Update postal address of FSF.Werner LEMBERG2005-05-261-1/+1
|
* * tmac/doc-common (Dd), tmac/doc-ditroff (gX, doc-setup-header):Werner LEMBERG2005-01-191-2/+3
| | | | | | | | Remove dead code. * src/roff/troff/div.cpp (top_level_diversion::space): Protect against division by zero.
* * src/devices/grohtml/html-text.cpp (html_text_get_alignment),Werner LEMBERG2004-10-151-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/devices/grohtml/post-html.cpp (make_val, html_printer::handle_state_assertion): Fix compiler warnings. * src/roff/troff/div.cpp: Include `stringclass.h' and `mtsm.h'. (diversion::diversion): Fix order of initializers. * src/roff/troff/div.h: Don't include `mtsm.h'. * src/roff/troff/env.cpp: Include `stringclass.h' and `mtsm.h'. (environment::environment): Fix order of initializers. (environment::make_tag, environment::construct_format_state): Fix compiler warnings. * src/roff/troff/input.cpp: Include `stringclass.h' and `mtsm.h'. (input_iterator::input_iterator, macro::macro): Fix order of initializers. * src/roff/troff/mtsm.cpp: Include only necessary header files. (state_set::add, state_set::val): Fix compiler warnings. * src/roff/troff/mtsm.h: Don't include `stringclass.h'. (bool_value_state, int_value_state, units_value_state, string_value_state): Remove comma after last element which causes an error with g++ 3.3.3. * src/roff/troff/node.cpp: Include `stringclass.h'. (hline_node::hline_node, vline_node::vline_node, space_char_hmotion_node, left_italic_corrected_node): Fix compiler warnings. (zero_width_node::zero_width_node): Fix order of initializers. * src/roff/troff/node.h: Don't include `mtsm.h'. (hmotion_node): Fix compiler warnings. * src/roff/troff/number.cpp: Include `stringclass.h' and `mtsm.h'.
* * src/roff/troff/column.cpp (vjustify_node::copy): Updated.Werner LEMBERG2004-10-101-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/roff/troff/div.h: Include `mtsm.h'. (diversion): New variables `any_chars_added', `needs_push', `saved_seen_break', `saved_seen_space', `saved_seen_eol', `saved_suppress_next_eol', `modified_tag'. New virtual member function `is_diversion'. Update all descendants. * src/roff/troff/div.cpp (diversion::diversion, macro_diversion::macro_diversion): Updated. (do_divert): Handle `seen_break', `seen_space', `seen_eol', `suppress_next_eol'. (top_level_diversion::space): Handle `curenv->seen_space'. (page_offset): Update tag handling. (space_request, blank_line, flush_output): Don't call `add_html_tag'. * src/roff/troff/env.h (environment): Make `tabs' public. Remove `ignore_next_eol', `emitted_node'. Update `output_line', `output'. New variables `seen_space', `seen_eol', `suppress_next_eol', `seen_break'. New member functions `construct_state', `make_tag', `construct_format_state, `construct_new_line_state, `dump_troff_state'. Remove `add_html_tag', `make_html_tag'. * src/roff/troff/env.cpp: New externs `suppress_push', `get_diversion_state', `global_diverted_space'. (pending_output_line): New variable `was_centered'. Update constructor and all callers. (pending_output_line::output): Call `curenv->construct_format_state'. (environment::environment, environment::copy): Updated. (environment::output): Handle `was_centered'. (environment::add_char): Handle construct and diversion state. (environment::add_node): Handle construct state. (environment::newline): Handle `was_centered'. (environment::output_line): Updated. (environment::possibly_break_line): Updated. Update tag handling. (environment::add_html_tag): Replaced with... (environment::make_tag): New function. (environment::add_html_tag_tabs, environment::make_html_tag): Removed. (environment::dump_troff_state): New debugging function. (environment::construct_state, environment::construct_format_state, environment::construct_new_line_state): New functions. (environment::do_break): Updated. Handle `global_diverted_space'. (environment::handle_tag): Update tag handling. (point_size, fill, do_break_request): Don't call `add_html_tag'. (no_fill): Don't call `add_html_tag'. Set `suppress_next_eol'. (center, right_justify, line_length, indent, temporary_indent, set_tabs): Update tag handling. * src/roff/troff/input.cpp: Don't include `stringclass.h'. (input_iterator): New variables `is_diversion', `diversion_state'. Update constructors. (input_stack): New member functions `get_div_level', `get_diversion_state', `check_end_diversion'. New variables `div_level', `diversion_state'. Initialize them. (suppress_push, global_diverted_space): New global variables. (input_stack::finish_get, input_stack::finish_peek, input_stack::remove_boundary, input_stack::end_file, input_stack::clear, input_stack::pop_macro): Call `check_end_diversion'. (input_stack::push): Handle `div_level' and `diversion_state'. (get_diversion_state): New function. (diverted_space_node::reread): Handle `global_diverted_space'. (macro::macro): Update constructors. (macro::is_diversion): New function. (macro::operator=): Set `is_a_diversion'. (string_iterator): New member function `is_diversion'. (string_iterator::string_iterator): Update constructors. (string_iterator::fill): Set `div_nest_level'. (macro_iterator): New member function `is_diversion'. (do_if_request): Handle `suppress_push'. (tag, taga): New functions. (init_input_requests): Add `tag' and `taga' requests.
* * src/include/font.h (font): Use `int' for ch_index.Werner LEMBERG2004-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/libs/libgroff/font.cpp (font::alloc_ch_index, font::compact): Updated. * src/roff/groff/pipeline.c (run_pipeline) [_WIN32]: Fix compiler warnings. * src/roff/troff/div.cpp (begin_page), src/roff/troff/env.cpp (hyphen_word): Fix compiler warnings. * src/roff/troff/input.cpp (get_char_for_escape_name): Return `char'. Update all callers. (get_delim_number, get_line_arg): Change second argument type to `unsigned char'. (macro_header::copy, token::next, do_define_string, do_define_character, substring_request, asciify_macro, unformat_macro, read_size, non_interpreted_node::interpret, while_request, main: Fix compiler warnings. (read_color_draw_node): Initialize `col'. * src/preproc/tbl/table.cpp (horizontal_span, table_entry): Make `start_col' and `end_col' of type `int'. (vertical_rule): Make `col' of type `int'. * src/preproc/grn/hdb.cpp (DBRead): Protect call to getc with check for EOF. * src/preproc/refer/label.y (uppercase_array, lowercase_array): New arrays. (format_serial): Use them to remove dependency on ASCII. * src/devices/grops/ps.cpp (ps_printer::define_encoding): Fix compiler warning. * src/devices/grops/psrm.cpp (resource_manager::supply_resource): Ditto. * src/devices/grotty/tty.cpp (tty_font::load_tty_font): Fix compiler warnings. (glyph): Change type of `hpos' to `int'. * src/devices/lbp/lbp.cpp (strsep): Removed. Unused. * src/devices/lbp/lbp.h (splinerel): Fix compiler warnings. * src/utils/tfmtodit.cpp (gf::load): Fix compiler warnings. * src/utils/pfbtops/pfbtops.c (get_text): Fix compiler warning.
* * src/libs/libgroff/glyphuni.cpp (glyph_to_unicode_list),Werner LEMBERG2004-04-081-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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'.
* * src/roff/troff/div.cpp: Include nonposix.h after troff.h toWerner LEMBERG2004-02-201-2/+2
| | | | avoid warnings w.r.t. redefinition of P_tmpdir for some compilers.
* * font/devlj4/Makefile.sub (DEVFILES): Updated to contain allWerner LEMBERG2004-02-191-0/+3
| | | | | | | | | | | new font and mapping files. * src/include/nonposix.h (FLUSH_INPUT_PIPE): New macro to empty an input pipe. This is needed for the MSVC compiler to make troff's `-o' option work. * src/roff/troff/div.cpp: Include nonposix.h. (cleanup_and_exit): Call FLUSH_INPUT_PIPE.
* Implement string-valued registers \n[.m] and \n[.M] to return theWerner LEMBERG2004-01-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | name of the current drawing and background color, respectively. * src/roff/troff/symbol.h: Moved to... * src/include/symbol.h: Here. Small fixes to make it work outside of the `troff' directory. * src/roff/troff/symbol.cpp: Moved to... * src/libs/libgroff/symbol.cpp: Here. Small fixes to make it work outside of the `troff' directory. * src/include/Makefile.sub (HDRS), src/libs/libgroff/Makefile.sub (OBJS, CCSRCS), src/roff/troff/Makefile.sub (OBJS, CCSRCS, HDRS): Updated. * src/include/color.h: Include symbol.h. (color): Add new field `nm'. * src/libs/libgroff/color.cpp (color::color): Updated. * src/roff/troff/dictionary.cpp, src/roff/troff/div.cpp, src/roff/troff/node.cpp, src/roff/troff/number.cpp, src/roff/troff/reg.cpp: Don't include symbol.h. * src/roff/troff/env.cpp: Don't include symbol.h. (environment::get_glyph_color_string, environment_get_fill_color_string): New member functions. (init_env_requests): Handle `.m' and `.M' registers. * src/roff/troff/input.cpp: Don't include symbol.h. (default_symbol): Moved to symbol.cpp/symbol.h. (do_glyph_color, do_fill_color, define_color): Pass symbol name to color constructor. * src/roff/troff/env.h: Updated. * NEWS, man/groff_diff.man, man/groff.man, doc/groff.texinfo: Document new registers.
* Renamed all `*.cc' files to `*.cpp'.Werner LEMBERG2003-04-151-0/+1182
Updated all configuration files, makefiles, and documentation.