gbranden pushed a commit to branch master
in repository groff.
commit de40823027ac99a894331aa0b3f1b5909a235686
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Mar 7 03:50:20 2026 -0600
[troff]: Warning diagnostic functions return void.
Change return type of `warning()` and `output_warning()` functions from
`int` to `void`. I would have boolified them, but nothing ever checks
their return values.
* src/roff/troff/troff.h: Update delcarations.
* src/roff/troff/input.cpp (warning, output_warning): Update
definitions. Simplify function bodies.
---
ChangeLog | 11 +++++++++++
src/roff/troff/input.cpp | 32 ++++++++++++--------------------
src/roff/troff/troff.h | 16 ++++++++--------
3 files changed, 31 insertions(+), 28 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 30ed68897..1cfaa88a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2026-03-07 G. Branden Robinson <[email protected]>
+
+ [troff]: Make warning diagnostic functions return `void`.
+ Change return type of `warning()` and `output_warning()`
+ functions from `int` to `void`. I would have boolified them,
+ but nothing ever checks their return values.
+
+ * src/roff/troff/troff.h: Update delcarations.
+ * src/roff/troff/input.cpp (warning, output_warning): Update
+ definitions. Simplify function bodies.
+
2026-03-06 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp: Rename several warning-relatd data
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 500cb911c..086886ae6 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -10747,32 +10747,24 @@ void debug(const char *format,
do_error(DEBUG, format, arg1, arg2, arg3);
}
-int warning(warning_type t,
- const char *format,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
+void warning(warning_type t,
+ const char *format,
+ const errarg &arg1,
+ const errarg &arg2,
+ const errarg &arg3)
{
- if ((t & desired_warnings) != 0U) {
+ if ((t & desired_warnings) != 0U)
do_error(WARNING, format, arg1, arg2, arg3);
- return 1;
- }
- else
- return 0;
}
-int output_warning(warning_type t,
- const char *format,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
+void output_warning(warning_type t,
+ const char *format,
+ const errarg &arg1,
+ const errarg &arg2,
+ const errarg &arg3)
{
- if ((t & desired_warnings) != 0U) {
+ if ((t & desired_warnings) != 0U)
do_error(OUTPUT_WARNING, format, arg1, arg2, arg3);
- return 1;
- }
- else
- return 0;
}
void error(const char *format,
diff --git a/src/roff/troff/troff.h b/src/roff/troff/troff.h
index 17515a9c1..f42c98888 100644
--- a/src/roff/troff/troff.h
+++ b/src/roff/troff/troff.h
@@ -74,14 +74,14 @@ enum warning_type {
const int WARN_MAX = 07777777;
-int warning(warning_type, const char *,
- const errarg & = empty_errarg,
- const errarg & = empty_errarg,
- const errarg & = empty_errarg);
-int output_warning(warning_type, const char *,
- const errarg & = empty_errarg,
- const errarg & = empty_errarg,
- const errarg & = empty_errarg);
+void warning(warning_type, const char *,
+ const errarg & = empty_errarg,
+ const errarg & = empty_errarg,
+ const errarg & = empty_errarg);
+void output_warning(warning_type, const char *,
+ const errarg & = empty_errarg,
+ const errarg & = empty_errarg,
+ const errarg & = empty_errarg);
// Local Variables:
// fill-column: 72
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit