[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 29/80: [lkbib]: Fix code style nits.
From: |
G. Branden Robinson |
Subject: |
[groff] 29/80: [lkbib]: Fix code style nits. |
Date: |
Sat, 30 Nov 2024 04:02:17 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 2648bfd7d849246af5eebe3e20090adb5f845974
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Nov 27 14:35:08 2024 -0600
[lkbib]: Fix code style nits.
* src/utils/lkbib/lkbib.cpp: Align with modern groff conventions.
Include system library headers before local ones. Use standard
symbols `EXIT_SUCCESS` and `EXIT_FAILURE` instead of `0` and `1`
literals, respectively.
---
ChangeLog | 7 +++++++
src/utils/lkbib/lkbib.cpp | 13 +++++++------
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1c969c04f..226ae3d26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-11-27 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * src/utils/lkbib/lkbib.cpp: Align with modern groff
+ conventions. Include system library headers before local ones.
+ Use standard symbols `EXIT_SUCCESS` and `EXIT_FAILURE` instead
+ of `0` and `1` literals, respectively.
+
2024-11-27 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/utils/libbib/index.cpp:
diff --git a/src/utils/lkbib/lkbib.cpp b/src/utils/lkbib/lkbib.cpp
index 7e8ba3396..fcc67a614 100644
--- a/src/utils/lkbib/lkbib.cpp
+++ b/src/utils/lkbib/lkbib.cpp
@@ -16,15 +16,16 @@ 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/>. */
-#include "lib.h"
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <assert.h>
#include <errno.h>
-#include <stdlib.h>
+#include <stdlib.h> // exit(), EXIT_FAILURE, EXIT_SUCCESS, getenv(),
+ // strtol()
+
+#include "lib.h"
#include "errarg.h"
#include "error.h"
@@ -86,7 +87,7 @@ int main(int argc, char **argv)
case 'v':
{
printf("GNU lkbib (groff) version %s\n", Version_string);
- exit(0);
+ exit(EXIT_SUCCESS);
break;
}
case 'p':
@@ -94,7 +95,7 @@ int main(int argc, char **argv)
break;
case CHAR_MAX + 1: // --help
usage(stdout);
- exit(0);
+ exit(EXIT_SUCCESS);
break;
case '?':
error("unrecognized command-line option '%1'", char(optopt));
@@ -106,7 +107,7 @@ int main(int argc, char **argv)
}
if (optind >= argc) {
usage(stderr);
- exit(1);
+ exit(EXIT_FAILURE);
}
char *filename = getenv("REFER");
if (filename)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 29/80: [lkbib]: Fix code style nits.,
G. Branden Robinson <=