gbranden pushed a commit to branch branden-2023-07-05 in repository groff. commit 3a2070e689cc6017d507f256b5cde71ea15b6166 Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Sat Apr 29 12:35:21 2023 -0500
[libgroff]: Boolify `interpret_lf_args`. * src/include/lf.h (interpret_lf_args): * src/libs/libgroff/lf.cpp (interpret_lf_args): Boolify. Also update editor aid comments; drop old style Emacs file-local variable setting. --- ChangeLog | 5 +++++ src/include/lf.h | 9 +++++++-- src/libs/libgroff/lf.cpp | 19 ++++++++++++------- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3e3b062f8..75f8e8bd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2023-04-29 G. Branden Robinson <g.branden.robin...@gmail.com> + + * src/include/lf.h (interpret_lf_args): + * src/libs/libgroff/lf.cpp (interpret_lf_args): Boolify. + 2023-04-28 G. Branden Robinson <g.branden.robin...@gmail.com> [tbl]: Fix Savannah #64122. diff --git a/src/include/lf.h b/src/include/lf.h index dc85a8479..f275d341c 100644 --- a/src/include/lf.h +++ b/src/include/lf.h @@ -1,4 +1,3 @@ -// -*- C++ -*- /* Copyright (C) 2014-2020 Free Software Foundation, Inc. Written by Werner Lemberg (w...@gnu.org) @@ -17,5 +16,11 @@ for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -int interpret_lf_args(const char *p); +bool interpret_lf_args(const char *p); void normalize_for_lf (string &fn); + +// Local Variables: +// fill-column: 72 +// mode: C++ +// End: +// vim: set cindent noexpandtab shiftwidth=2 textwidth=72: diff --git a/src/libs/libgroff/lf.cpp b/src/libs/libgroff/lf.cpp index 9c255fbc0..239ca8901 100644 --- a/src/libs/libgroff/lf.cpp +++ b/src/libs/libgroff/lf.cpp @@ -1,4 +1,3 @@ -// -*- C++ -*- /* Copyright (C) 1989-2020 Free Software Foundation, Inc. Written by James Clark (j...@jclark.com) @@ -27,24 +26,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ extern void change_filename(const char *); extern void change_lineno(int); -int interpret_lf_args(const char *p) +bool interpret_lf_args(const char *p) { while (*p == ' ') p++; if (!csdigit(*p)) - return 0; + return false; int ln = 0; do { ln *= 10; ln += *p++ - '0'; } while (csdigit(*p)); if (*p != ' ' && *p != '\n' && *p != '\0') - return 0; + return false; while (*p == ' ') p++; if (*p == '\0' || *p == '\n') { change_lineno(ln); - return 1; + return true; } const char *q; for (q = p; @@ -55,11 +54,11 @@ int interpret_lf_args(const char *p) while (*q == ' ') q++; if (*q != '\n' && *q != '\0') - return 0; + return false; tem += '\0'; change_filename(tem.contents()); change_lineno(ln); - return 1; + return true; } #if defined(__MSDOS__) || (defined(_WIN32) && !defined(__CYGWIN__)) @@ -76,3 +75,9 @@ void normalize_for_lf (string &) { } #endif + +// Local Variables: +// fill-column: 72 +// mode: C++ +// End: +// vim: set cindent noexpandtab shiftwidth=2 textwidth=72: _______________________________________________ Groff-commit mailing list Groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit