groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 18/39: [grotty]: Fix code style nits.


From: G. Branden Robinson
Subject: [groff] 18/39: [grotty]: Fix code style nits.
Date: Sat, 29 Oct 2022 14:59:57 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit d85dbd108aa16648c0eb53a36bdf88ab99d04420
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Oct 24 18:17:10 2022 -0500

    [grotty]: Fix code style nits.
    
    * src/devices/grotty/tty.cpp: Fix code style nits.
    
      (main): Use standard C library symbols `EXIT_SUCCESS` and
      `EXIT_FAILURE` instead of integer literals as arguments to `exit()`.
      Replace `assert(0)` call with communicative predicate.
---
 ChangeLog                  | 8 ++++++++
 src/devices/grotty/tty.cpp | 8 ++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 02a4807b7..6cf75d440 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-10-24  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/devices/grotty/tty.cpp: Fix code style nits.
+       (main): Use standard C library symbols `EXIT_SUCCESS` and
+       `EXIT_FAILURE` instead of integer literals as arguments to
+       `exit()`.  Replace `assert(0)` call with communicative
+       predicate.
+
 2022-10-24  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/groff/groff.cpp: Alter usage message handling.
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index bb39512e2..b14813997 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -947,7 +947,7 @@ int main(int argc, char **argv)
     switch(c) {
     case 'v':
       printf("GNU grotty (groff) version %s\n", Version_string);
-      exit(0);
+      exit(EXIT_SUCCESS);
       break;
     case 'i':
       // Use italic font instead of underlining.
@@ -1000,14 +1000,14 @@ int main(int argc, char **argv)
       break;
     case CHAR_MAX + 1: // --help
       usage(stdout);
-      exit(0);
+      exit(EXIT_SUCCESS);
       break;
     case '?':
       usage(stderr);
-      exit(1);
+      exit(EXIT_FAILURE);
       break;
     default:
-      assert(0);
+      assert(0 == "unhandled getopt_long return value");
     }
   update_options();
   if (optind >= argc)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]