[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 02/13: [troff]: Update exit status literals.
From: |
G. Branden Robinson |
Subject: |
[groff] 02/13: [troff]: Update exit status literals. |
Date: |
Sat, 11 Sep 2021 16:20:10 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit fa4c27e933f303ef774963352c2e8854e951b9f1
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Sep 7 06:23:34 2021 +1000
[troff]: Update exit status literals.
* 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.
---
ChangeLog | 10 ++++++++++
src/roff/troff/div.cpp | 4 ++--
src/roff/troff/input.cpp | 8 ++++----
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cfb5d46..7e5f831 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2021-09-07 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [troff]: Update exit status literals.
+
+ * 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.
+
2021-09-06 G. Branden Robinson <g.branden.robinson@gmail.com>
[troff]: Drop unused member function.
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index b826c89..7eda8e2 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -577,12 +577,12 @@ int top_level_diversion::begin_page(vunits n)
if (page_count == last_page_count
? curenv->is_empty()
: (done_end_macro && (seen_last_page_ejector ||
began_page_in_end_macro)))
- cleanup_and_exit(0);
+ cleanup_and_exit(EXIT_SUCCESS);
if (!done_end_macro)
began_page_in_end_macro = 1;
}
if (last_page_number > 0 && page_number == last_page_number)
- cleanup_and_exit(0);
+ cleanup_and_exit(EXIT_SUCCESS);
if (!the_output)
init_output();
++page_count;
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 8e1cdbf..e4cad70 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2598,7 +2598,7 @@ void exit_troff()
}
// This will only happen if a trap-called macro starts a diversion,
// or if vertical position traps have been disabled.
- cleanup_and_exit(0);
+ cleanup_and_exit(EXIT_SUCCESS);
}
// This implements .ex. The input stack must be cleared before calling
@@ -7516,7 +7516,7 @@ void abort_request()
fputs(asciify(c), stderr);
}
fputc('\n', stderr);
- cleanup_and_exit(1);
+ cleanup_and_exit(EXIT_FAILURE);
}
char *read_string()
@@ -8758,7 +8758,7 @@ static void do_error(error_type type,
fputc('\n', stderr);
fflush(stderr);
if (type == FATAL)
- cleanup_and_exit(1);
+ cleanup_and_exit(EXIT_FAILURE);
}
void debug(const char *format,
@@ -8823,7 +8823,7 @@ void fatal_with_file_and_line(const char *filename, int
lineno,
errprint(format, arg1, arg2, arg3);
fputc('\n', stderr);
fflush(stderr);
- cleanup_and_exit(1);
+ cleanup_and_exit(EXIT_FAILURE);
}
void error_with_file_and_line(const char *filename, int lineno,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 02/13: [troff]: Update exit status literals.,
G. Branden Robinson <=