gbranden pushed a commit to branch master
in repository groff.
commit bdc22b6e9e4962f04f2ce311562c3450625e7c8c
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Aug 22 05:38:59 2022 -0500
[libgroff]: Trivially refactor.
* src/libs/libgroff/error.cpp (do_error_with_file_and_line): Trivially
refactor. Use separate string constant for invariant material. (This
will make it easier to, for example, store the diagnostic level
strings in an array that can be indexed by their corresponding `enum`
type.)
---
ChangeLog | 8 ++++++++
src/libs/libgroff/error.cpp | 9 +++++----
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ad87559b7..6f93d5ceb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-08-22 G. Branden Robinson <[email protected]>
+
+ * src/libs/libgroff/error.cpp (do_error_with_file_and_line):
+ Trivially refactor. Use separate string constant for invariant
+ material. (This will make it easier to, for example, store the
+ diagnostic level strings in an array that can be indexed by
+ their corresponding `enum` type.)
+
2022-08-22 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp (fatal_with_file_and_line)
diff --git a/src/libs/libgroff/error.cpp b/src/libs/libgroff/error.cpp
index 259c30537..b1a4e61c1 100644
--- a/src/libs/libgroff/error.cpp
+++ b/src/libs/libgroff/error.cpp
@@ -65,18 +65,19 @@ static void do_error_with_file_and_line(const char
*filename,
fputc(' ', stderr);
switch (type) {
case FATAL:
- fputs("fatal error: ", stderr);
+ fputs("fatal error", stderr);
break;
case ERROR:
- fputs("error: ", stderr);
+ fputs("error", stderr);
break;
case WARNING:
- fputs("warning: ", stderr);
+ fputs("warning", stderr);
break;
case DEBUG:
- fputs("debug: ", stderr);
+ fputs("debug", stderr);
break;
}
+ fputs(": ", stderr);
errprint(format, arg1, arg2, arg3);
fputc('\n', stderr);
fflush(stderr);
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit