]> diplodocus.org Git - nmh/commitdiff
Convert some Boolean variables to the bool type.
authorRalph Corderoy <ralph@inputplus.co.uk>
Mon, 21 Aug 2017 11:06:40 +0000 (12:06 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Tue, 22 Aug 2017 10:51:14 +0000 (11:51 +0100)
uip/ali.c
uip/inc.c

index a75edf3644b97deef7e80128f1046e0830f7f0b1..1c75644bf088402a33111bc1a810a62b35627b91 100644 (file)
--- a/uip/ali.c
+++ b/uip/ali.c
@@ -36,15 +36,15 @@ extern struct aka *akahead;
 /*
  * prototypes
  */
-static void print_aka (char *, int, int);
-static void print_usr (char *, int);
+static void print_aka (char *, bool, int);
+static void print_usr (char *, bool);
 
 
 int
 main (int argc, char **argv)
 {
-    int i, vecp = 0, inverted = 0, list = 0;
-    int noalias = 0;
+    int i, vecp = 0;
+    bool inverted, list, noalias;
     char *cp, **ap, **argp, buf[BUFSIZ];
     /* Really only need to allocate for argc-1, but must allocate at least 1,
        so go ahead and allocate for argc char pointers. */
@@ -57,6 +57,7 @@ main (int argc, char **argv)
     arguments = getarguments (invo_name, argc, argv, 1);
     argp = arguments;
 
+    inverted = list = noalias = false;
     while ((cp = *argp++)) {
        if (*cp == '-') {
            switch (smatch (++cp, switches)) {
@@ -82,21 +83,21 @@ main (int argc, char **argv)
                        adios (NULL, "aliasing error in %s - %s", cp, akerror (i));
                    continue;
                case NALIASW: 
-                   noalias++;
+                   noalias = true;
                    continue;
 
                case LISTSW: 
-                   list++;
+                   list = true;
                    continue;
                case NLISTSW: 
-                   list = 0;
+                   list = false;
                    continue;
 
                case USERSW: 
-                   inverted++;
+                   inverted = true;
                    continue;
                case NUSERSW: 
-                   inverted = 0;
+                   inverted = false;
                    continue;
            }
        }
@@ -158,7 +159,7 @@ main (int argc, char **argv)
 }
 
 static void
-print_aka (char *p, int list, int margin)
+print_aka (char *p, bool list, int margin)
 {
     char c;
 
@@ -198,7 +199,7 @@ print_aka (char *p, int list, int margin)
 }
 
 static void
-print_usr (char *s, int list)
+print_usr (char *s, bool list)
 {
     char *cp, *pp, *vp;
     struct aka *ak;
index 68fb06b69715ff3d8415e9c547e3b8ad6b958bf0..c337dde5375b43d59523357fe692004226827b57 100644 (file)
--- a/uip/inc.c
+++ b/uip/inc.c
@@ -149,7 +149,7 @@ static gid_t return_gid;
 #endif /* not MAILGROUP */
 
 /* these variables have to be globals so that done() can correctly clean up the lockfile */
-static int locked = 0;
+static bool locked;
 static char *newmail;
 static FILE *in;
 
@@ -526,7 +526,7 @@ main (int argc, char **argv)
         /* Mail from a spool file. */
 
        if (access (newmail, W_OK) != NOTOK) {
-           locked++;
+           locked = true;
            if (trnflag) {
                SIGNAL (SIGHUP, SIG_IGN);
                SIGNAL (SIGINT, SIG_IGN);