gbranden pushed a commit to branch master in repository groff. commit be4d8ecd7bcd6a0e884fa52e192ef70cc1928c95 Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Thu Jul 3 08:40:06 2025 -0500
src/roff/troff/env.cpp: Trivially refactor. * src/roff/troff/env.cpp: Use better data type for `deprecated_font_identifiers`; make a vector of `symbol`s rather than of `string`s. (warn_if_font_name_deprecated): Use compatible type for vector iterator. groff's `string` data type is really just a memory buffer with no null- termination semantics--a fact that has been woefully under-documented for ages and for which I hope one day to have my revenge. --- ChangeLog | 8 ++++++++ src/roff/troff/env.cpp | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 134398428..039e7c6af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2025-07-03 G. Branden Robinson <g.branden.robin...@gmail.com> + + * src/roff/troff/env.cpp: Trivially refactor. Use better data + type for `deprecated_font_identifiers`; make a vector of + `symbol`s rather than of `string`s. + (warn_if_font_name_deprecated): Use compatible type for vector + iterator. + 2025-07-02 G. Branden Robinson <g.branden.robin...@gmail.com> * src/utils/afmtodit/afmtodit.pl: Throw separate diagnostic diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp index 9625b2da9..87b802ca0 100644 --- a/src/roff/troff/env.cpp +++ b/src/roff/troff/env.cpp @@ -575,14 +575,14 @@ static node *configure_space_underlining(bool b) return new device_extension_node(m, 1); } -// TODO: Kill this off in groff 1.25. -std::vector<string> deprecated_font_identifiers; +// TODO: Kill this off in groff 1.24.0 release + 2 years. See input.cpp. +std::vector<symbol> deprecated_font_identifiers; extern bool is_device_ps_or_pdf; // See input.cpp. static void warn_if_font_name_deprecated(symbol nm) { const char *name = nm.contents(); - std::vector<string>::iterator it + std::vector<symbol>::iterator it = find(deprecated_font_identifiers.begin(), deprecated_font_identifiers.end(), name); if (it != deprecated_font_identifiers.end()) { _______________________________________________ groff-commit mailing list groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit