]> diplodocus.org Git - nmh/commitdiff
uip: Replace some ints that are only ever 0 or 1 with bool.
authorRalph Corderoy <ralph@inputplus.co.uk>
Wed, 1 Nov 2017 17:21:23 +0000 (17:21 +0000)
committerRalph Corderoy <ralph@inputplus.co.uk>
Wed, 1 Nov 2017 17:21:23 +0000 (17:21 +0000)
Knowing the domain of the variable is Boolean aids comprehension of the
variable's name and purpose.

22 files changed:
uip/mhstore.c
uip/msgchk.c
uip/pick.c
uip/picksbr.c
uip/popsbr.c
uip/post.c
uip/prompter.c
uip/rcvstore.c
uip/refile.c
uip/repl.c
uip/replsbr.c
uip/rmf.c
uip/rmm.c
uip/scan.c
uip/send.c
uip/sendsbr.c
uip/show.c
uip/slocal.c
uip/sortm.c
uip/viamail.c
uip/whatnowproc.c
uip/whatnowsbr.c

index 6f2fdd39489a731616565cfe2d399c5eb301524b..66ad91e99e99f51bb652dc6d0b59b0cf4b8aa41c 100644 (file)
@@ -63,7 +63,8 @@ static void pipeser (int);
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int msgnum, *icachesw, autosw = 0;
+    int msgnum, *icachesw;
+    bool autosw = false;
     /* verbosw defaults to 1 for backward compatibility. */
     bool verbosw = true;
     const char *clobbersw = "always";
     /* verbosw defaults to 1 for backward compatibility. */
     bool verbosw = true;
     const char *clobbersw = "always";
@@ -107,10 +108,10 @@ main (int argc, char **argv)
                done (0);
 
            case AUTOSW:
                done (0);
 
            case AUTOSW:
-               autosw++;
+               autosw = true;
                continue;
            case NAUTOSW:
                continue;
            case NAUTOSW:
-               autosw = 0;
+               autosw = false;
                continue;
 
            case RCACHESW:
                continue;
 
            case RCACHESW:
index 21aca33b1b412d1eb7a3361c52ff54be7fb6e124..bf95d90742265e4e6dc89318f9875b044eb97be8 100644 (file)
@@ -78,9 +78,14 @@ static int remotemail (char *, char *, char *, char *, int, int, int, int,
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int datesw = 1, notifysw = NT_ALL;
-    int status = 0, sasl = 0, tls = 0, noverify = 0;
-    int snoop = 0, vecp = 0;
+    bool datesw = true;
+    int notifysw = NT_ALL;
+    int status = 0;
+    bool sasl = false;
+    bool tls = false;
+    bool noverify = false;
+    bool snoop = false;
+    int vecp = 0;
     char *cp, *host = NULL, *port = NULL, *user = NULL, *proxy = NULL;
     char buf[BUFSIZ], *saslmech = NULL, *auth_svc = NULL;
     char **argp, **arguments, *vec[MAXVEC];
     char *cp, *host = NULL, *port = NULL, *user = NULL, *proxy = NULL;
     char buf[BUFSIZ], *saslmech = NULL, *auth_svc = NULL;
     char **argp, **arguments, *vec[MAXVEC];
@@ -112,10 +117,10 @@ main (int argc, char **argv)
                    done (0);
 
                case DATESW:
                    done (0);
 
                case DATESW:
-                   datesw++;
+                   datesw = true;
                    continue;
                case NDATESW:
                    continue;
                case NDATESW:
-                   datesw = 0;
+                   datesw = false;
                    continue;
 
                case NOTESW:
                    continue;
 
                case NOTESW:
@@ -148,15 +153,15 @@ main (int argc, char **argv)
                    continue;
 
                case SNOOPSW:
                    continue;
 
                case SNOOPSW:
-                   snoop++;
+                   snoop = true;
                    continue;
 
                case SASLSW:
                    continue;
 
                case SASLSW:
-                   sasl++;
+                   sasl = true;
                    continue;
                
                case NOSASLSW:
                    continue;
                
                case NOSASLSW:
-                   sasl = 0;
+                   sasl = false;
                    continue;
 
                case SASLMECHSW:
                    continue;
 
                case SASLMECHSW:
@@ -165,19 +170,19 @@ main (int argc, char **argv)
                    continue;
 
                case INITTLSSW:
                    continue;
 
                case INITTLSSW:
-                   tls++;
+                   tls = true;
                    continue;
 
                case NOTLSSW:
                    continue;
 
                case NOTLSSW:
-                   tls = 0;
+                   tls = false;
                    continue;
 
                case CERTVERSW:
                    continue;
 
                case CERTVERSW:
-                   noverify = 0;
+                   noverify = false;
                    continue;
 
                case NOCERTVERSW:
                    continue;
 
                case NOCERTVERSW:
-                   noverify++;
+                   noverify = true;
                    continue;
 
                case AUTHSERVICESW:
                    continue;
 
                case AUTHSERVICESW:
index 01e2081a9ddeda784558dea9724cb41b0d7fe3c3..967e12553ef7f4ef48a30374c46ccc088bf47da7 100644 (file)
@@ -56,7 +56,9 @@ static void putzero_done (int) NORETURN;
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int publicsw = -1, zerosw = 1, vecp = 0;
+    int publicsw = -1;
+    bool zerosw = true;
+    int vecp = 0;
     size_t seqp = 0;
     int msgnum;
     char *maildir, *folder = NULL, buf[100];
     size_t seqp = 0;
     int msgnum;
     char *maildir, *folder = NULL, buf[100];
@@ -153,10 +155,10 @@ main (int argc, char **argv)
                publicsw = 0;
                continue;
            case ZEROSW: 
                publicsw = 0;
                continue;
            case ZEROSW: 
-               zerosw++;
+               zerosw = true;
                continue;
            case NZEROSW: 
                continue;
            case NZEROSW: 
-               zerosw = 0;
+               zerosw = false;
                continue;
 
            case LISTSW: 
                continue;
 
            case LISTSW: 
index a51847990b1045f011fb855dbb9e17a389daccf6..4d4d99a1de3bdd7c9bddd066c1c958f9dfa8e347 100644 (file)
@@ -644,21 +644,23 @@ cerror: ;
 static int
 GREPaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop)
 {
 static int
 GREPaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop)
 {
-    int c, body, lf;
+    int c;
+    bool body;
+    bool lf;
     long pos = start;
     char *p1, *p2, *ebp, *cbp;
     char ibuf[BUFSIZ];
     NMH_UNUSED (msgnum);
 
     fseek (fp, start, SEEK_SET);
     long pos = start;
     char *p1, *p2, *ebp, *cbp;
     char ibuf[BUFSIZ];
     NMH_UNUSED (msgnum);
 
     fseek (fp, start, SEEK_SET);
-    body = 0;
+    body = false;
     ebp = cbp = ibuf;
     for (;;) {
        if (body && n->n_header)
            return 0;
        p1 = linebuf;
        p2 = cbp;
     ebp = cbp = ibuf;
     for (;;) {
        if (body && n->n_header)
            return 0;
        p1 = linebuf;
        p2 = cbp;
-       lf = 0;
+       lf = false;
        for (;;) {
            if (p2 >= ebp) {
                if (fgets (ibuf, sizeof ibuf, fp) == NULL
        for (;;) {
            if (p2 >= ebp) {
                if (fgets (ibuf, sizeof ibuf, fp) == NULL
@@ -677,16 +679,16 @@ GREPaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop)
                    --p2;
                    break;
                }
                    --p2;
                    break;
                }
-                lf = 0;
+                lf = false;
            }
            if (c == '\n') {
                if (body)
                    break;
                 if (lf) {
            }
            if (c == '\n') {
                if (body)
                    break;
                 if (lf) {
-                    body++;
+                    body = true;
                     break;
                 }
                     break;
                 }
-                lf++;
+                lf = true;
                 /* Unfold by skipping the newline. */
                 c = 0;
            }
                 /* Unfold by skipping the newline. */
                 c = 0;
            }
@@ -701,7 +703,7 @@ GREPaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop)
 
        /* Attempt to decode as a MIME header.  If it's the last header,
           body will be 1 and lf will be at least 1. */
 
        /* Attempt to decode as a MIME header.  If it's the last header,
           body will be 1 and lf will be at least 1. */
-       if ((body == 0 || lf > 0)  &&
+       if ((!body || lf)  &&
            decode_rfc2047 (linebuf, decoded_linebuf, sizeof decoded_linebuf)) {
            p1 = decoded_linebuf;
        }
            decode_rfc2047 (linebuf, decoded_linebuf, sizeof decoded_linebuf)) {
            p1 = decoded_linebuf;
        }
index ac1117be062fe4654188eb798c4a112e6f603324..1466a2e1228efda25c4d6c77d0c2b3e6f5e6af99 100644 (file)
@@ -39,7 +39,8 @@ static int pop_sasl_callback(enum sasl_message_type, unsigned const char *,
 static int
 check_mech(char *server_mechs, size_t server_mechs_size)
 {
 static int
 check_mech(char *server_mechs, size_t server_mechs_size)
 {
-  int status, sasl_capability = 0;
+  int status;
+  bool sasl_capability = false;
 
     /*
      * First off, we're going to send the CAPA command to see if we can
 
     /*
      * First off, we're going to send the CAPA command to see if we can
@@ -62,7 +63,7 @@ check_mech(char *server_mechs, size_t server_mechs_size)
 
         if (strncasecmp(response, "SASL ", 5) == 0) {
             /* We've seen the SASL capability.  Grab the mech list. */
 
         if (strncasecmp(response, "SASL ", 5) == 0) {
             /* We've seen the SASL capability.  Grab the mech list. */
-            sasl_capability++;
+            sasl_capability = true;
             strncpy(server_mechs, response + 5, server_mechs_size);
         }
     }
             strncpy(server_mechs, response + 5, server_mechs_size);
         }
     }
index 2917945b9b61c2df81514db293739892134c7673..c2af2948b4a635819566ea3490ea8810beb3a0d7 100644 (file)
@@ -225,27 +225,27 @@ static short fccind = 0;  /* index into fccfold[] */
 static short outputlinelen = OUTPUTLINELEN;
 
 static int pfd = NOTOK;                /* fd to write annotation list to        */
 static short outputlinelen = OUTPUTLINELEN;
 
 static int pfd = NOTOK;                /* fd to write annotation list to        */
-static int recipients = 0;     /* how many people will get a copy       */
+static bool recipients;        /* how many people will get a copy       */
 static int unkadr = 0;         /* how many of those were unknown        */
 static int badadr = 0;         /* number of bad addrs                   */
 static int unkadr = 0;         /* how many of those were unknown        */
 static int badadr = 0;         /* number of bad addrs                   */
-static int badmsg = 0;         /* message has bad semantics             */
-static int verbose = 0;                /* spell it out                          */
+static bool badmsg;            /* message has bad semantics             */
+static bool verbose;           /* spell it out                          */
 static bool format = true;     /* format addresses                      */
 static bool format = true;     /* format addresses                      */
-static int mime = 0;           /* use MIME-style encapsulations for Bcc */
-static int msgid = 0;          /* add msgid                             */
-static int debug = 0;          /* debugging post                        */
-static int watch = 0;          /* watch the delivery process            */
-static int whomsw = 0;         /* we are whom not post                  */
-static int checksw = 0;                /* whom -check                           */
+static bool mime;              /* use MIME-style encapsulations for Bcc */
+static bool msgid;             /* add msgid                             */
+static bool debug;             /* debugging post                        */
+static bool watch;             /* watch the delivery process            */
+static bool whomsw;            /* we are whom not post                  */
+static bool checksw;           /* whom -check                           */
 static int linepos=0;          /* putadr()'s position on the line       */
 static int nameoutput=0;       /* putadr() has output header name       */
 static int linepos=0;          /* putadr()'s position on the line       */
 static int nameoutput=0;       /* putadr() has output header name       */
-static int sasl=0;             /* Use SASL auth for SMTP                */
+static bool sasl;              /* Use SASL auth for SMTP                */
 static char *saslmech=NULL;    /* Force use of particular SASL mech     */
 static char *user=NULL;                /* Authenticate as this user             */
 static char *port="submission";        /* Name of server port for SMTP submission */
 static int tlsflag=0;          /* Flags to control TLS settings         */
 static int fromcount=0;                /* Count of addresses on From: header    */
 static char *saslmech=NULL;    /* Force use of particular SASL mech     */
 static char *user=NULL;                /* Authenticate as this user             */
 static char *port="submission";        /* Name of server port for SMTP submission */
 static int tlsflag=0;          /* Flags to control TLS settings         */
 static int fromcount=0;                /* Count of addresses on From: header    */
-static int seensender=0;       /* Have we seen a Sender: header?        */
+static bool seensender;        /* Have we seen a Sender: header?        */
 
 static unsigned msgflags = 0;  /* what we've seen */
 
 
 static unsigned msgflags = 0;  /* what we've seen */
 
@@ -277,7 +277,7 @@ static struct mailname netaddrs;            /* network addrs   */
 static struct mailname uuaddrs;                        /* uucp addrs      */
 static struct mailname tmpaddrs;               /* temporary queue */
 
 static struct mailname uuaddrs;                        /* uucp addrs      */
 static struct mailname tmpaddrs;               /* temporary queue */
 
-static int snoop      = 0;
+static bool snoop;
 static char *clientsw = NULL;
 static char *serversw = NULL;
 
 static char *clientsw = NULL;
 static char *serversw = NULL;
 
@@ -318,8 +318,10 @@ static int find_prefix (void);
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int state, compnum, dashstuff = 0, swnum, oauth_flag = 0, tls = -1;
-    int noverify = 0;
+    int state, compnum, dashstuff = 0, swnum;
+    bool oauth_flag = false;
+    int tls = -1;
+    bool noverify = false;
     int eai = 0; /* use Email Address Internationalization (EAI) (SMTPUTF8) */
     char *cp, *msg = NULL, **argp, **arguments, *envelope;
     char buf[NMH_BUFSIZ], name[NAMESZ], *auth_svc = NULL;
     int eai = 0; /* use Email Address Internationalization (EAI) (SMTPUTF8) */
     char *cp, *msg = NULL, **argp, **arguments, *envelope;
     char buf[NMH_BUFSIZ], name[NAMESZ], *auth_svc = NULL;
@@ -366,14 +368,14 @@ main (int argc, char **argv)
                    continue;
 
                case CHKSW: 
                    continue;
 
                case CHKSW: 
-                   checksw++;
+                   checksw = true;
                    continue;
                case NCHKSW: 
                    continue;
                case NCHKSW: 
-                   checksw = 0;
+                   checksw = false;
                    continue;
 
                case DEBUGSW: 
                    continue;
 
                case DEBUGSW: 
-                   debug++;
+                   debug = true;
                    continue;
 
                case DISTSW:
                    continue;
 
                case DISTSW:
@@ -383,7 +385,7 @@ main (int argc, char **argv)
                case FILTSW:
                    if (!(filter = *argp++) || *filter == '-')
                        die("missing argument to %s", argp[-2]);
                case FILTSW:
                    if (!(filter = *argp++) || *filter == '-')
                        die("missing argument to %s", argp[-2]);
-                   mime = 0;
+                   mime = false;
                    continue;
                case NFILTSW:
                    filter = NULL;
                    continue;
                case NFILTSW:
                    filter = NULL;
@@ -404,36 +406,36 @@ main (int argc, char **argv)
                    continue;
 
                case MIMESW:
                    continue;
 
                case MIMESW:
-                   mime++;
+                   mime = true;
                    filter = NULL;
                    continue;
                case NMIMESW: 
                    filter = NULL;
                    continue;
                case NMIMESW: 
-                   mime = 0;
+                   mime = false;
                    continue;
 
                case MSGDSW: 
                    continue;
 
                case MSGDSW: 
-                   msgid++;
+                   msgid = true;
                    continue;
                case NMSGDSW: 
                    continue;
                case NMSGDSW: 
-                   msgid = 0;
+                   msgid = false;
                    continue;
 
                case VERBSW: 
                    continue;
 
                case VERBSW: 
-                   verbose++;
+                   verbose = true;
                    continue;
                case NVERBSW: 
                    continue;
                case NVERBSW: 
-                   verbose = 0;
+                   verbose = false;
                    continue;
 
                case WATCSW: 
                    continue;
 
                case WATCSW: 
-                   watch++;
+                   watch = true;
                    continue;
                case NWATCSW: 
                    continue;
                case NWATCSW: 
-                   watch = 0;
+                   watch = false;
                    continue;
 
                case WHOMSW: 
                    continue;
 
                case WHOMSW: 
-                   whomsw++;
+                   whomsw = true;
                    continue;
 
                case WIDTHSW: 
                    continue;
 
                case WIDTHSW: 
@@ -459,7 +461,7 @@ main (int argc, char **argv)
                        die("missing argument to %s", argp[-2]);
                    continue;
                case SNOOPSW:
                        die("missing argument to %s", argp[-2]);
                    continue;
                case SNOOPSW:
-                   snoop++;
+                   snoop = true;
                    continue;
 
                case PARTSW:
                    continue;
 
                case PARTSW:
@@ -468,11 +470,11 @@ main (int argc, char **argv)
                    continue;
 
                case SASLSW:
                    continue;
 
                case SASLSW:
-                   sasl++;
+                   sasl = true;
                    continue;
 
                case NOSASLSW:
                    continue;
 
                case NOSASLSW:
-                   sasl = 0;
+                   sasl = false;
                    continue;
 
                case SASLMECHSW:
                    continue;
 
                case SASLMECHSW:
@@ -483,7 +485,7 @@ main (int argc, char **argv)
                case AUTHSERVICESW:
                    if (!(auth_svc = *argp++) || *auth_svc == '-')
                        die("missing argument to %s", argp[-2]);
                case AUTHSERVICESW:
                    if (!(auth_svc = *argp++) || *auth_svc == '-')
                        die("missing argument to %s", argp[-2]);
-                   oauth_flag++;
+                   oauth_flag = true;
                    continue;
 
                case OAUTHCREDFILESW:
                    continue;
 
                case OAUTHCREDFILESW:
@@ -510,7 +512,7 @@ main (int argc, char **argv)
                        die("internal error: cannot map switch %s "
                               "to profile entry", argp[-2]);
 
                        die("internal error: cannot map switch %s "
                               "to profile entry", argp[-2]);
 
-                   oauth_flag++;
+                   oauth_flag = true;
                    continue;
                }
 
                    continue;
                }
 
@@ -537,11 +539,11 @@ main (int argc, char **argv)
                    continue;
 
                case CERTVERSW:
                    continue;
 
                case CERTVERSW:
-                   noverify = 0;
+                   noverify = false;
                    continue;
 
                case NOCERTVERSW:
                    continue;
 
                case NOCERTVERSW:
-                   noverify++;
+                   noverify = true;
                    continue;
 
                case FILEPROCSW:
                    continue;
 
                case FILEPROCSW:
@@ -601,7 +603,7 @@ main (int argc, char **argv)
 
     start_headers ();
     if (debug) {
 
     start_headers ();
     if (debug) {
-       verbose++;
+       verbose = true;
        out = stdout;
     } else {
        if (whomsw) {
        out = stdout;
     } else {
        if (whomsw) {
@@ -788,7 +790,9 @@ main (int argc, char **argv)
 static void
 putfmt (char *name, char *str, int *eai, FILE *out)
 {
 static void
 putfmt (char *name, char *str, int *eai, FILE *out)
 {
-    int count, grp, i, keep;
+    int count;
+    bool grp;
+    int i, keep;
     char *cp, *pp, *qp;
     char namep[BUFSIZ], error[BUFSIZ];
     char *savehdr = NULL;
     char *cp, *pp, *qp;
     char namep[BUFSIZ], error[BUFSIZ];
     char *savehdr = NULL;
@@ -801,7 +805,7 @@ putfmt (char *name, char *str, int *eai, FILE *out)
 
     if (msgstate == NORMAL && uprf (name, "resent")) {
        inform("illegal header line -- %s:", name);
 
     if (msgstate == NORMAL && uprf (name, "resent")) {
        inform("illegal header line -- %s:", name);
-       badmsg++;
+       badmsg = true;
        return;
     }
 
        return;
     }
 
@@ -845,7 +849,7 @@ putfmt (char *name, char *str, int *eai, FILE *out)
     }
     if (hdr->flags & HBAD) {
        inform("illegal header line -- %s:", name);
     }
     if (hdr->flags & HBAD) {
        inform("illegal header line -- %s:", name);
-       badmsg++;
+       badmsg = true;
        return;
     }
     msgflags |= (hdr->set & ~(MVIS | MINV));
        return;
     }
     msgflags |= (hdr->set & ~(MVIS | MINV));
@@ -904,7 +908,7 @@ putfmt (char *name, char *str, int *eai, FILE *out)
            if (hdr->flags & HTRY)
                badadr++;
            else
            if (hdr->flags & HTRY)
                badadr++;
            else
-               badmsg++;
+               badmsg = true;
        }
     }
 
        }
     }
 
@@ -918,11 +922,11 @@ putfmt (char *name, char *str, int *eai, FILE *out)
            if ((msgstate == RESENT) ? (hdr->set & MRSN)
                                        : (hdr->set & MSND)) {
                inform("%s: field requires one address", name);
            if ((msgstate == RESENT) ? (hdr->set & MRSN)
                                        : (hdr->set & MSND)) {
                inform("%s: field requires one address", name);
-               badmsg++;
+               badmsg = true;
            }
 #ifdef notdef
            inform("%s: field requires at least one address", name);
            }
 #ifdef notdef
            inform("%s: field requires at least one address", name);
-           badmsg++;
+           badmsg = true;
 #endif /* notdef */
        }
        return;
 #endif /* notdef */
        }
        return;
@@ -930,7 +934,7 @@ putfmt (char *name, char *str, int *eai, FILE *out)
 
     if (count > 1 && (hdr->flags & HONE)) {
        inform("%s: field only permits one address", name);
 
     if (count > 1 && (hdr->flags & HONE)) {
        inform("%s: field only permits one address", name);
-       badmsg++;
+       badmsg = true;
        return;
     }
 
        return;
     }
 
@@ -938,7 +942,7 @@ putfmt (char *name, char *str, int *eai, FILE *out)
     snprintf (namep, sizeof(namep), "%s%s",
                (hdr->flags & HMNG) ? "Original-" : "", name);
 
     snprintf (namep, sizeof(namep), "%s%s",
                (hdr->flags & HMNG) ? "Original-" : "", name);
 
-    for (grp = 0, mp = tmpaddrs.m_next; mp; mp = np)
+    for (grp = false, mp = tmpaddrs.m_next; mp; mp = np)
        if (mp->m_nohost) {     /* also used to test (hdr->flags & HTRY) */
            /* The address doesn't include a host, so it might be an alias. */
            pp = akvalue (mp->m_mbox);  /* do mh alias substitution */
        if (mp->m_nohost) {     /* also used to test (hdr->flags & HTRY) */
            /* The address doesn't include a host, so it might be an alias. */
            pp = akvalue (mp->m_mbox);  /* do mh alias substitution */
@@ -973,7 +977,7 @@ putfmt (char *name, char *str, int *eai, FILE *out)
                                                : (hdr->set & MSND)) {
                    strncpy(sender, auxformat(mp, 0), sizeof(sender) - 1);
                    sender[sizeof(sender) - 1] = '\0';
                                                : (hdr->set & MSND)) {
                    strncpy(sender, auxformat(mp, 0), sizeof(sender) - 1);
                    sender[sizeof(sender) - 1] = '\0';
-                   seensender++;
+                   seensender = true;
                }
 
                /*
                }
 
                /*
@@ -1004,7 +1008,7 @@ putfmt (char *name, char *str, int *eai, FILE *out)
                               " sendmail/pipe");
                    }
 
                               " sendmail/pipe");
                    }
 
-                   grp++;
+                   grp = true;
                }
                if (putadr (namep, qp, mp, out, hdr->flags, savehdr,
                            savehdrlen))
                }
                if (putadr (namep, qp, mp, out, hdr->flags, savehdr,
                            savehdrlen))
@@ -1038,7 +1042,7 @@ putfmt (char *name, char *str, int *eai, FILE *out)
                                            : (hdr->set & MSND)) {
                strncpy(sender, auxformat(mp, 0), sizeof(sender) - 1);
                sender[sizeof(sender) - 1] = '\0';
                                            : (hdr->set & MSND)) {
                strncpy(sender, auxformat(mp, 0), sizeof(sender) - 1);
                sender[sizeof(sender) - 1] = '\0';
-               seensender++;
+               seensender = true;
            }
 
            /*
            }
 
            /*
@@ -1055,7 +1059,7 @@ putfmt (char *name, char *str, int *eai, FILE *out)
            if (mp->m_gname)
                putgrp (namep, mp->m_gname, out, hdr->flags);
            if (mp->m_ingrp)
            if (mp->m_gname)
                putgrp (namep, mp->m_gname, out, hdr->flags);
            if (mp->m_ingrp)
-               grp++;
+               grp = true;
            keep = putadr (namep, "", mp, out, hdr->flags, savehdr, savehdrlen);
            np = mp->m_next;
            if (keep) {
            keep = putadr (namep, "", mp, out, hdr->flags, savehdr, savehdrlen);
            np = mp->m_next;
            if (keep) {
@@ -1077,9 +1081,9 @@ putfmt (char *name, char *str, int *eai, FILE *out)
        }
     }
 
        }
     }
 
-    if (grp > 0 && (hdr->flags & HNGR)) {
+    if (grp && (hdr->flags & HNGR)) {
        inform("%s: field does not allow groups", name);
        inform("%s: field does not allow groups", name);
-       badmsg++;
+       badmsg = true;
     }
     if (linepos) {
        putc ('\n', out);
     }
     if (linepos) {
        putc ('\n', out);
@@ -1120,14 +1124,14 @@ finish_headers (FILE *out)
                 */
                inform("message has no From: header");
                inform("See default components files for examples");
                 */
                inform("message has no From: header");
                inform("See default components files for examples");
-               badmsg++;
+               badmsg = true;
                break;
            }
 
                break;
            }
 
-           if (fromcount > 1 && (seensender == 0 && !(msgflags & MEFM))) {
+           if (fromcount > 1 && (!seensender && !(msgflags & MEFM))) {
                inform("A Sender: or Envelope-From: header is required "
                        "with multiple\nFrom: addresses");
                inform("A Sender: or Envelope-From: header is required "
                        "with multiple\nFrom: addresses");
-               badmsg++;
+               badmsg = true;
                break;
            }
 
                break;
            }
 
@@ -1143,12 +1147,12 @@ finish_headers (FILE *out)
             * from Envelope-From: (which in this case, cannot be blank)
             */
 
             * from Envelope-From: (which in this case, cannot be blank)
             */
 
-           if (fromcount > 1 && seensender == 0) {
+           if (fromcount > 1 && !seensender) {
                if (efrom[0] == '\0') {
                    inform("Envelope-From cannot be blank when there "
                            "is multiple From: addresses\nand no Sender: "
                            "header");
                if (efrom[0] == '\0') {
                    inform("Envelope-From cannot be blank when there "
                            "is multiple From: addresses\nand no Sender: "
                            "header");
-                   badmsg++;
+                   badmsg = true;
                } else {
                    fprintf (out, "Sender: %s\n", efrom);
                }
                } else {
                    fprintf (out, "Sender: %s\n", efrom);
                }
@@ -1161,22 +1165,22 @@ finish_headers (FILE *out)
        case RESENT: 
            if (!(msgflags & MDAT)) {
                inform("message has no Date: header");
        case RESENT: 
            if (!(msgflags & MDAT)) {
                inform("message has no Date: header");
-               badmsg++;
+               badmsg = true;
            }
            if (!(msgflags & MFRM)) {
                inform("message has no From: header");
            }
            if (!(msgflags & MFRM)) {
                inform("message has no From: header");
-               badmsg++;
+               badmsg = true;
            }
            if (!(msgflags & MRFM)) {
                inform("message has no Resent-From: header");
                inform("See default components files for examples");
            }
            if (!(msgflags & MRFM)) {
                inform("message has no Resent-From: header");
                inform("See default components files for examples");
-               badmsg++;
+               badmsg = true;
                break;
            }
                break;
            }
-           if (fromcount > 1 && (seensender == 0 && !(msgflags & MEFM))) {
+           if (fromcount > 1 && (!seensender && !(msgflags & MEFM))) {
                inform("A Resent-Sender: or Envelope-From: header is "
                        "required with multiple\nResent-From: addresses");
                inform("A Resent-Sender: or Envelope-From: header is "
                        "required with multiple\nResent-From: addresses");
-               badmsg++;
+               badmsg = true;
                break;
            }
 
                break;
            }
 
@@ -1193,12 +1197,12 @@ finish_headers (FILE *out)
             * from Envelope-From (which in this case, cannot be blank)
             */
 
             * from Envelope-From (which in this case, cannot be blank)
             */
 
-           if (fromcount > 1 && seensender == 0) {
+           if (fromcount > 1 && !seensender) {
                if (efrom[0] == '\0') {
                    inform("Envelope-From cannot be blank when there "
                            "is multiple Resent-From: addresses and no "
                            "Resent-Sender: header");
                if (efrom[0] == '\0') {
                    inform("Envelope-From cannot be blank when there "
                            "is multiple Resent-From: addresses and no "
                            "Resent-Sender: header");
-                   badmsg++;
+                   badmsg = true;
                } else {
                    fprintf (out, "Resent-Sender: %s\n", efrom);
                }
                } else {
                    fprintf (out, "Resent-Sender: %s\n", efrom);
                }
@@ -1359,7 +1363,7 @@ insert (struct mailname *np)
            return 0;
 
     mp->m_next = np;
            return 0;
 
     mp->m_next = np;
-    recipients++;
+    recipients = true;
     return 1;
 }
 
     return 1;
 }
 
index 1564852d747e9547faf77388e9616300eea3fc4e..2c346607bed0d0f6d162c40aea3748e2483fc626 100644 (file)
@@ -42,7 +42,7 @@ DEFINE_SWITCH_ARRAY(PROMPTER, switches);
 static struct termios tio;
 
 static bool wtuser;
 static struct termios tio;
 
 static bool wtuser;
-static int sigint = 0;
+static bool sigint;
 static jmp_buf sigenv;
 
 /*
 static jmp_buf sigenv;
 
 /*
@@ -57,8 +57,11 @@ static void intrser (int);
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int body = 1, prepend = 1, rapid = 0;
-    int doteof = 0, fdi, fdo, i, state;
+    bool body = true;
+    bool prepend = true;
+    bool rapid = false;
+    bool doteof = false;
+    int fdi, fdo, i, state;
     char *cp, *drft = NULL, *erasep = NULL;
     char *killp = NULL, name[NAMESZ], field[NMH_BUFSIZ];
     char buffer[BUFSIZ];
     char *cp, *drft = NULL, *erasep = NULL;
     char *killp = NULL, name[NAMESZ], field[NMH_BUFSIZ];
     char buffer[BUFSIZ];
@@ -100,31 +103,31 @@ main (int argc, char **argv)
                    continue;
 
                case PREPSW: 
                    continue;
 
                case PREPSW: 
-                   prepend++;
+                   prepend = true;
                    continue;
                case NPREPSW: 
                    continue;
                case NPREPSW: 
-                   prepend = 0;
+                   prepend = false;
                    continue;
 
                case RAPDSW: 
                    continue;
 
                case RAPDSW: 
-                   rapid++;
+                   rapid = true;
                    continue;
                case NRAPDSW: 
                    continue;
                case NRAPDSW: 
-                   rapid = 0;
+                   rapid = false;
                    continue;
 
                case BODYSW: 
                    continue;
 
                case BODYSW: 
-                   body++;
+                   body = true;
                    continue;
                case NBODYSW: 
                    continue;
                case NBODYSW: 
-                   body = 0;
+                   body = false;
                    continue;
 
                case DOTSW: 
                    continue;
 
                case DOTSW: 
-                   doteof++;
+                   doteof = true;
                    continue;
                case NDOTSW: 
                    continue;
                case NDOTSW: 
-                   doteof = 0;
+                   doteof = false;
                    continue;
            }
        } else {
                    continue;
            }
        } else {
@@ -177,7 +180,7 @@ main (int argc, char **argv)
        tio.c_cc[VERASE] = save_erase;
     }
 
        tio.c_cc[VERASE] = save_erase;
     }
 
-    sigint = 0;
+    sigint = false;
     SIGNAL2 (SIGINT, intrser);
 
     /*
     SIGNAL2 (SIGINT, intrser);
 
     /*
@@ -379,7 +382,7 @@ intrser (int i)
 
     if (wtuser)
        longjmp (sigenv, NOTOK);
 
     if (wtuser)
        longjmp (sigenv, NOTOK);
-    sigint++;
+    sigint = true;
 }
 
 
 }
 
 
index d952a3a21e9d6cbb4278119d9f4f5ab51ef91548..e32770933619de986ba2deefd18e8032d3e495ed 100644 (file)
@@ -47,8 +47,9 @@ static void unlink_done(int) NORETURN;
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int publicsw = -1, zerosw = 0;
-    int create = 1;
+    int publicsw = -1;
+    bool zerosw = false;
+    bool create = true;
     bool unseensw = true;
     int fd, msgnum;
     size_t seqp = 0;
     bool unseensw = true;
     int fd, msgnum;
     size_t seqp = 0;
@@ -108,17 +109,17 @@ main (int argc, char **argv)
                continue;
 
            case ZEROSW: 
                continue;
 
            case ZEROSW: 
-               zerosw++;
+               zerosw = true;
                continue;
            case NZEROSW: 
                continue;
            case NZEROSW: 
-               zerosw = 0;
+               zerosw = false;
                continue;
 
            case CRETSW: 
                continue;
 
            case CRETSW: 
-               create++;
+               create = true;
                continue;
            case NCRETSW: 
                continue;
            case NCRETSW: 
-               create = 0;
+               create = false;
                continue;
            }
        }
                continue;
            }
        }
index 9ee6dab414e72e27ca6a9117e442e00ef798fdf1..2552ec66a3354c1881039bc0f8c4dde37e68a8fb 100644 (file)
@@ -58,10 +58,12 @@ static void copy_seqs (struct msgs *, int, struct msgs *, int);
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int linkf = 0, preserve = 0;
+    bool linkf = false;
+    bool preserve = false;
     bool retainseqs = false;
     int filep = 0;
     bool retainseqs = false;
     int filep = 0;
-    int foldp = 0, isdf = 0, unlink_msgs = 0;
+    int foldp = 0, isdf = 0;
+    bool unlink_msgs = false;
     int i, msgnum;
     char *cp, *folder = NULL, buf[BUFSIZ];
     char **argp, **arguments;
     int i, msgnum;
     char *cp, *folder = NULL, buf[BUFSIZ];
     char **argp, **arguments;
@@ -98,17 +100,17 @@ main (int argc, char **argv)
                done (0);
 
            case LINKSW:
                done (0);
 
            case LINKSW:
-               linkf++;
+               linkf = true;
                continue;
            case NLINKSW:
                continue;
            case NLINKSW:
-               linkf = 0;
+               linkf = false;
                continue;
 
            case PRESSW:
                continue;
 
            case PRESSW:
-               preserve++;
+               preserve = true;
                continue;
            case NPRESSW:
                continue;
            case NPRESSW:
-               preserve = 0;
+               preserve = false;
                continue;
 
            case RETAINSEQSSW:
                continue;
 
            case RETAINSEQSSW:
@@ -119,10 +121,10 @@ main (int argc, char **argv)
                continue;
 
            case UNLINKSW:
                continue;
 
            case UNLINKSW:
-               unlink_msgs++;
+               unlink_msgs = true;
                continue;
            case NUNLINKSW:
                continue;
            case NUNLINKSW:
-               unlink_msgs = 0;
+               unlink_msgs = false;
                continue;
 
            case SRCSW:
                continue;
 
            case SRCSW:
index e114273da1ea211afb046aad87913cf7fd1cbc60..6101641bf3208fa5310909bbf7ddd26260de7378 100644 (file)
@@ -98,9 +98,9 @@ short ccme = -1;
 short querysw = 0;
 
 static short outputlinelen = OUTPUTLINELEN;
 short querysw = 0;
 
 static short outputlinelen = OUTPUTLINELEN;
-static short groupreply = 0;           /* Is this a group reply?        */
+static bool groupreply;                        /* Is this a group reply?        */
 
 
-static int mime = 0;                   /* include original as MIME part */
+static bool mime;                      /* include original as MIME part */
 static char *form   = NULL;            /* form (components) file        */
 static char *filter = NULL;            /* message filter file           */
 static char *fcc    = NULL;            /* folders to add to Fcc: header */
 static char *form   = NULL;            /* form (components) file        */
 static char *filter = NULL;            /* message filter file           */
 static char *fcc    = NULL;            /* folders to add to Fcc: header */
@@ -117,10 +117,11 @@ int
 main (int argc, char **argv)
 {
     int        i, isdf = 0;
 main (int argc, char **argv)
 {
     int        i, isdf = 0;
-    int anot = 0;
+    bool anot = false;
     bool inplace = true;
     bool inplace = true;
-    int nedit = 0, nwhat = 0;
-    int atfile = 0;
+    bool nedit = false;
+    bool nwhat = false;
+    bool atfile = false;
     int fmtproc = -1;
     char *cp, *cwd, *dp, *maildir, *file = NULL;
     char *folder = NULL, *msg = NULL, *dfolder = NULL;
     int fmtproc = -1;
     char *cp, *cwd, *dp, *maildir, *file = NULL;
     char *folder = NULL, *msg = NULL, *dfolder = NULL;
@@ -132,8 +133,7 @@ main (int argc, char **argv)
     struct msgs *mp = NULL;
     struct stat st;
     FILE *in;
     struct msgs *mp = NULL;
     struct stat st;
     FILE *in;
-
-    int buildsw = 0;
+    bool buildsw = false;
 
     if (nmh_init(argv[0], true, true)) { return 1; }
 
 
     if (nmh_init(argv[0], true, true)) { return 1; }
 
@@ -159,17 +159,17 @@ main (int argc, char **argv)
                    done (0);
 
                case GROUPSW:
                    done (0);
 
                case GROUPSW:
-                   groupreply++;
+                   groupreply = true;
                    continue;
                case NGROUPSW:
                    continue;
                case NGROUPSW:
-                   groupreply = 0;
+                   groupreply = false;
                    continue;
 
                case ANNOSW: 
                    continue;
 
                case ANNOSW: 
-                   anot++;
+                   anot = true;
                    continue;
                case NANNOSW: 
                    continue;
                case NANNOSW: 
-                   anot = 0;
+                   anot = false;
                    continue;
 
                case CCSW: 
                    continue;
 
                case CCSW: 
@@ -186,10 +186,10 @@ main (int argc, char **argv)
                case EDITRSW: 
                    if (!(ed = *argp++) || *ed == '-')
                        die("missing argument to %s", argp[-2]);
                case EDITRSW: 
                    if (!(ed = *argp++) || *ed == '-')
                        die("missing argument to %s", argp[-2]);
-                   nedit = 0;
+                   nedit = false;
                    continue;
                case NEDITSW:
                    continue;
                case NEDITSW:
-                   nedit++;
+                   nedit = true;
                    continue;
                    
                case CONVERTARGSW: {
                    continue;
                    
                case CONVERTARGSW: {
@@ -223,13 +223,13 @@ main (int argc, char **argv)
                case WHATSW: 
                    if (!(whatnowproc = *argp++) || *whatnowproc == '-')
                        die("missing argument to %s", argp[-2]);
                case WHATSW: 
                    if (!(whatnowproc = *argp++) || *whatnowproc == '-')
                        die("missing argument to %s", argp[-2]);
-                   nwhat = 0;
+                   nwhat = false;
                    continue;
                case BILDSW: 
                    continue;
                case BILDSW: 
-                   buildsw++;
+                   buildsw = true;
                    /* FALLTHRU */
                case NWHATSW: 
                    /* FALLTHRU */
                case NWHATSW: 
-                   nwhat++;
+                   nwhat = true;
                    continue;
 
                case FCCSW: 
                    continue;
 
                case FCCSW: 
@@ -255,7 +255,7 @@ main (int argc, char **argv)
                    if (!(cp = *argp++) || *cp == '-')
                        die("missing argument to %s", argp[-2]);
                    filter = mh_xstrdup(etcpath(cp));
                    if (!(cp = *argp++) || *cp == '-')
                        die("missing argument to %s", argp[-2]);
                    filter = mh_xstrdup(etcpath(cp));
-                   mime = 0;
+                   mime = false;
                    continue;
                case FORMSW: 
                    if (!(form = *argp++) || *form == '-')
                    continue;
                case FORMSW: 
                    if (!(form = *argp++) || *form == '-')
@@ -264,7 +264,7 @@ main (int argc, char **argv)
 
                case FRMTSW: 
                    filter = mh_xstrdup(etcpath(mhlreply));
 
                case FRMTSW: 
                    filter = mh_xstrdup(etcpath(mhlreply));
-                   mime = 0;
+                   mime = false;
                    continue;
                case NFRMTSW: 
                    filter = NULL;
                    continue;
                case NFRMTSW: 
                    filter = NULL;
@@ -278,11 +278,11 @@ main (int argc, char **argv)
                    continue;
 
                case MIMESW:
                    continue;
 
                case MIMESW:
-                   mime++;
+                   mime = true;
                    filter = NULL;
                    continue;
                case NMIMESW:
                    filter = NULL;
                    continue;
                case NMIMESW:
-                   mime = 0;
+                   mime = false;
                    continue;
 
                case QURYSW: 
                    continue;
 
                case QURYSW: 
@@ -319,10 +319,10 @@ main (int argc, char **argv)
                    continue;
 
                case ATFILESW:
                    continue;
 
                case ATFILESW:
-                   atfile++;
+                   atfile = true;
                    continue;
                case NOATFILESW:
                    continue;
                case NOATFILESW:
-                   atfile = 0;
+                   atfile = false;
                    continue;
 
                case FMTPROCSW:
                    continue;
 
                case FMTPROCSW:
@@ -398,7 +398,7 @@ try_it_again:
        /*
         * We are replying to a file.
         */
        /*
         * We are replying to a file.
         */
-       anot = 0;       /* we don't want to annotate a file */
+       anot = false;   /* we don't want to annotate a file */
     } else {
        /*
         * We are replying to a message.
     } else {
        /*
         * We are replying to a message.
index 46742e66a1d8d9c55ab0a46c797fa6632796bdc4..2fadb1d10548a5a31b42a7bacd3dd34486db61d9 100644 (file)
@@ -282,7 +282,7 @@ replformataddr (char *orig, char *str)
 {
     int len;
     char baddr[BUFSIZ], error[BUFSIZ];
 {
     int len;
     char baddr[BUFSIZ], error[BUFSIZ];
-    int isgroup;
+    bool isgroup;
     char *dst;
     char *cp;
     char *sp;
     char *dst;
     char *cp;
     char *sp;
@@ -312,7 +312,7 @@ replformataddr (char *orig, char *str)
     }
 
     /* concatenate all the new addresses onto 'buf' */
     }
 
     /* concatenate all the new addresses onto 'buf' */
-    for (isgroup = 0; (cp = getname (fixed_str)); ) {
+    for (isgroup = false; (cp = getname (fixed_str)); ) {
        if ((mp = getm (cp, dfhost, dftype, error, sizeof(error))) == NULL) {
            snprintf (baddr, sizeof(baddr), "\t%s -- %s\n", cp, error);
            badaddrs = add (baddr, badaddrs);
        if ((mp = getm (cp, dfhost, dftype, error, sizeof(error))) == NULL) {
            snprintf (baddr, sizeof(baddr), "\t%s -- %s\n", cp, error);
            badaddrs = add (baddr, badaddrs);
@@ -320,7 +320,7 @@ replformataddr (char *orig, char *str)
        }
        if (isgroup && (mp->m_gname || !mp->m_ingrp)) {
            *dst++ = ';';
        }
        if (isgroup && (mp->m_gname || !mp->m_ingrp)) {
            *dst++ = ';';
-           isgroup = 0;
+           isgroup = false;
        }
        if (insert (mp)) {
            /* if we get here we're going to add an address */
        }
        if (insert (mp)) {
            /* if we get here we're going to add an address */
@@ -331,7 +331,7 @@ replformataddr (char *orig, char *str)
            if (mp->m_gname) {
                CHECKMEM (mp->m_gname);
                CPY (mp->m_gname);
            if (mp->m_gname) {
                CHECKMEM (mp->m_gname);
                CPY (mp->m_gname);
-               isgroup++;
+               isgroup = true;
            }
            sp = adrformat (mp);
            CHECKMEM (sp);
            }
            sp = adrformat (mp);
            CHECKMEM (sp);
index 724bd26fcf9590c0d613a763af23a261f5faa898..38b07a14ece55fad460bb77303442bf9fb797c9c 100644 (file)
--- a/uip/rmf.c
+++ b/uip/rmf.c
@@ -35,7 +35,8 @@ static void rma (char *);
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int defolder = 0, interactive = -1;
+    bool defolder = false;
+    int interactive = -1;
     char *cp, *folder = NULL, newfolder[BUFSIZ];
     char buf[BUFSIZ], **argp, **arguments;
     char *fp;
     char *cp, *folder = NULL, newfolder[BUFSIZ];
     char buf[BUFSIZ], **argp, **arguments;
     char *fp;
@@ -84,7 +85,7 @@ main (int argc, char **argv)
        free (path ("./", TFOLDER));
     if (!folder) {
        folder = getfolder (1);
        free (path ("./", TFOLDER));
     if (!folder) {
        folder = getfolder (1);
-       defolder++;
+       defolder = true;
     }
     fp = m_mailpath(folder);
     if (!strcmp(fp, pwd()))
     }
     fp = m_mailpath(folder);
     if (!strcmp(fp, pwd()))
@@ -127,7 +128,8 @@ main (int argc, char **argv)
 static int
 rmf (char *folder)
 {
 static int
 rmf (char *folder)
 {
-    int i, others;
+    int i;
+    bool others;
     char *fp;
     char *maildir;
     char cur[BUFSIZ];
     char *fp;
     char *maildir;
     char cur[BUFSIZ];
@@ -155,7 +157,7 @@ rmf (char *folder)
 
     if ((dd = opendir (".")) == NULL)
        die("unable to read folder +%s", folder);
 
     if ((dd = opendir (".")) == NULL)
        die("unable to read folder +%s", folder);
-    others = 0;
+    others = false;
 
     /*
      * Run the external delete hook program.
 
     /*
      * Run the external delete hook program.
@@ -183,12 +185,12 @@ rmf (char *folder)
 
                inform("file \"%s/%s\" not deleted, continuing...",
                        folder, dp->d_name);
 
                inform("file \"%s/%s\" not deleted, continuing...",
                        folder, dp->d_name);
-               others++;
+               others = true;
                continue;
        }
        if (m_unlink (dp->d_name) == NOTOK) {
            admonish (dp->d_name, "unable to unlink %s:", folder);
                continue;
        }
        if (m_unlink (dp->d_name) == NOTOK) {
            admonish (dp->d_name, "unable to unlink %s:", folder);
-           others++;
+           others = true;
        }
     }
 
        }
     }
 
@@ -203,7 +205,7 @@ rmf (char *folder)
     if (chdir ("..") < 0) {
        advise ("..", "chdir");
     }
     if (chdir ("..") < 0) {
        advise ("..", "chdir");
     }
-    if (others == 0 && remdir (maildir))
+    if (!others && remdir (maildir))
        return OK;
 
     inform("folder +%s not removed", folder);
        return OK;
 
     inform("folder +%s not removed", folder);
index 0d71be96b0c1a4337e86daff5b31e87fad17039c..fc32a520a2331629c4a933fc96206b201c8446ad 100644 (file)
--- a/uip/rmm.c
+++ b/uip/rmm.c
@@ -30,7 +30,8 @@ DEFINE_SWITCH_ARRAY(RMM, switches);
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int msgnum, unlink_msgs = 0;
+    int msgnum;
+    bool unlink_msgs = false;
     char *cp, *maildir, *folder = NULL;
     char buf[BUFSIZ], **argp;
     char **arguments;
     char *cp, *maildir, *folder = NULL;
     char buf[BUFSIZ], **argp;
     char **arguments;
@@ -62,10 +63,10 @@ main (int argc, char **argv)
                done (0);
 
            case UNLINKSW:
                done (0);
 
            case UNLINKSW:
-               unlink_msgs++;
+               unlink_msgs = true;
                continue;
            case NUNLINKSW:
                continue;
            case NUNLINKSW:
-               unlink_msgs = 0;
+               unlink_msgs = false;
                continue;
 
             case RPROCSW:
                continue;
 
             case RPROCSW:
index ba238d9c4512dcccc742151e84b662ec40d89daa..60c5ebccbdd582ea8714603dfc153d6dd08cfd4a 100644 (file)
@@ -41,8 +41,11 @@ DEFINE_SWITCH_ARRAY(SCAN, switches);
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int clearflag = 0, hdrflag = 0, ontty;
-    int width = -1, revflag = 0;
+    bool clearflag = false;
+    bool hdrflag = false;
+    int ontty;
+    int width = -1;
+    bool revflag = false;
     int i, state, msgnum;
     ivector_t seqnum = ivector_create (0);
     bool unseen;
     int i, state, msgnum;
     ivector_t seqnum = ivector_create (0);
     bool unseen;
@@ -82,10 +85,10 @@ main (int argc, char **argv)
                    done (0);
 
                case CLRSW: 
                    done (0);
 
                case CLRSW: 
-                   clearflag++;
+                   clearflag = true;
                    continue;
                case NCLRSW: 
                    continue;
                case NCLRSW: 
-                   clearflag = 0;
+                   clearflag = false;
                    continue;
 
                case FORMSW: 
                    continue;
 
                case FORMSW: 
@@ -100,10 +103,10 @@ main (int argc, char **argv)
                    continue;
 
                case HEADSW: 
                    continue;
 
                case HEADSW: 
-                   hdrflag++;
+                   hdrflag = true;
                    continue;
                case NHEADSW: 
                    continue;
                case NHEADSW: 
-                   hdrflag = 0;
+                   hdrflag = false;
                    continue;
 
                case WIDTHSW: 
                    continue;
 
                case WIDTHSW: 
@@ -112,10 +115,10 @@ main (int argc, char **argv)
                    width = atoi (cp);
                    continue;
                case REVSW:
                    width = atoi (cp);
                    continue;
                case REVSW:
-                   revflag++;
+                   revflag = true;
                    continue;
                case NREVSW:
                    continue;
                case NREVSW:
-                   revflag = 0;
+                   revflag = false;
                    continue;
 
                case FILESW:
                    continue;
 
                case FILESW:
@@ -272,7 +275,7 @@ main (int argc, char **argv)
            }
            charstring_free (scanl);
            scan_finished ();
            }
            charstring_free (scanl);
            scan_finished ();
-           hdrflag = 0;
+           hdrflag = false;
            fclose (in);
            if (ontty)
                fflush (stdout);
            fclose (in);
            if (ontty)
                fflush (stdout);
index 235946ec0d9aef087a517bb813ed94fafbd546ff..dde2029b7b9c036fa73387966e02f92e1c35d308 100644 (file)
@@ -98,12 +98,12 @@ DEFINE_SWITCH_ARRAY(USE, anyl);
 #undef X
 
 extern int debugsw;            /* from sendsbr.c */
 #undef X
 
 extern int debugsw;            /* from sendsbr.c */
-extern int forwsw;
+extern bool forwsw;
 extern int inplace;
 extern int inplace;
-extern int pushsw;
+extern bool pushsw;
 extern int splitsw;
 extern int splitsw;
-extern int unique;
-extern int verbsw;
+extern bool unique;
+extern bool verbsw;
 
 extern char *altmsg;           /*  .. */
 extern char *annotext;
 
 extern char *altmsg;           /*  .. */
 extern char *annotext;
@@ -190,10 +190,10 @@ main (int argc, char **argv)
                    continue;
 
                case PUSHSW: 
                    continue;
 
                case PUSHSW: 
-                   pushsw++;
+                   pushsw = true;
                    continue;
                case NPUSHSW: 
                    continue;
                case NPUSHSW: 
-                   pushsw = 0;
+                   pushsw = false;
                    continue;
 
                case SPLITSW: 
                    continue;
 
                case SPLITSW: 
@@ -202,25 +202,25 @@ main (int argc, char **argv)
                    continue;
 
                case UNIQSW: 
                    continue;
 
                case UNIQSW: 
-                   unique++;
+                   unique = true;
                    continue;
                case NUNIQSW: 
                    continue;
                case NUNIQSW: 
-                   unique = 0;
+                   unique = false;
                    continue;
 
                case FORWSW:
                    continue;
 
                case FORWSW:
-                   forwsw++;
+                   forwsw = true;
                    continue;
                case NFORWSW:
                    continue;
                case NFORWSW:
-                   forwsw = 0;
+                   forwsw = false;
                    continue;
 
                case VERBSW: 
                    continue;
 
                case VERBSW: 
-                   verbsw++;
+                   verbsw = true;
                    vec[vecp++] = --cp;
                    continue;
                case NVERBSW:
                    vec[vecp++] = --cp;
                    continue;
                case NVERBSW:
-                   verbsw = 0;
+                   verbsw = false;
                    vec[vecp++] = --cp;
                    continue;
 
                    vec[vecp++] = --cp;
                    continue;
 
index f2c2762f707ff18bd7ea2bdeb590102b6d778ace..8d6dd616765ce822f2e7f484eb8e421fc5ba1ddf 100644 (file)
@@ -34,12 +34,12 @@ static int setup_oauth_params(char *[], int *, const char *, const char **);
 #endif /* OAUTH_SUPPORT */
 
 int debugsw = 0;               /* global */
 #endif /* OAUTH_SUPPORT */
 
 int debugsw = 0;               /* global */
-int forwsw  = 1;
+bool forwsw = true;
 int inplace = 1;
 int inplace = 1;
-int pushsw  = 0;
+bool pushsw;
 int splitsw = -1;
 int splitsw = -1;
-int unique  = 0;
-int verbsw  = 0;
+bool unique;
+bool verbsw;
 
 char *altmsg   = NULL;         /*  .. */
 char *annotext = NULL;
 
 char *altmsg   = NULL;         /*  .. */
 char *annotext = NULL;
index 3943118a64e9a44f7b962b94ea34c7f711668af8..3de3a836de0dd52b846302cf7f6d9c18ca5bfa79 100644 (file)
@@ -66,9 +66,10 @@ static int is_nontext(char *);
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int draftsw = 0;
+    bool draftsw = false;
     bool headersw = true;
     bool headersw = true;
-    int nshow = 0, checkmime = 1;
+    bool nshow = false;
+    bool checkmime = true;
     bool mime = false;
     int isdf = 0, mode = SHOW, msgnum;
     char *cp, *maildir, *file = NULL, *folder = NULL, *proc, *program;
     bool mime = false;
     int isdf = 0, mode = SHOW, msgnum;
     char *cp, *maildir, *file = NULL, *folder = NULL, *proc, *program;
@@ -126,7 +127,7 @@ non_mhl_switches:
                case DRFTSW:
                    if (file)
                        die("only one file at a time!");
                case DRFTSW:
                    if (file)
                        die("only one file at a time!");
-                   draftsw++;
+                   draftsw = true;
                    if (mode == SHOW)
                        continue;
 usage:
                    if (mode == SHOW)
                        continue;
 usage:
@@ -168,22 +169,22 @@ usage:
                case SHOWSW:
                    if (!(showproc = *argp++) || *showproc == '-')
                        die("missing argument to %s", argp[-2]);
                case SHOWSW:
                    if (!(showproc = *argp++) || *showproc == '-')
                        die("missing argument to %s", argp[-2]);
-                   nshow = 0;
+                   nshow = false;
                    continue;
                case NSHOWSW:
                    continue;
                case NSHOWSW:
-                   nshow++;
+                   nshow = true;
                    continue;
 
                case SHOWMIMESW:
                    if (!(showmimeproc = *argp++) || *showmimeproc == '-')
                        die("missing argument to %s", argp[-2]);
                    continue;
 
                case SHOWMIMESW:
                    if (!(showmimeproc = *argp++) || *showmimeproc == '-')
                        die("missing argument to %s", argp[-2]);
-                   nshow = 0;
+                   nshow = false;
                    continue;
                case CHECKMIMESW:
                    continue;
                case CHECKMIMESW:
-                   checkmime++;
+                   checkmime = true;
                    continue;
                case NOCHECKMIMESW:
                    continue;
                case NOCHECKMIMESW:
-                   checkmime = 0;
+                   checkmime = false;
                    continue;
            }
        }
                    continue;
            }
        }
index b3f0aa238c0433569ac5301162bb6be2cd6c6038..8677b3f2b500a96700b1a482eb08dd0a7976332f 100644 (file)
@@ -83,10 +83,10 @@ DEFINE_SWITCH_ARRAY(SLOCAL, switches);
 static int globbed = 0;                /* have we built "vars" table yet?        */
 static int parsed = 0;         /* have we built header field table yet   */
 static int utmped = 0;         /* have we scanned umtp(x) file yet       */
 static int globbed = 0;                /* have we built "vars" table yet?        */
 static int parsed = 0;         /* have we built header field table yet   */
 static int utmped = 0;         /* have we scanned umtp(x) file yet       */
-static int suppressdup = 0;    /* are we suppressing duplicate messages? */
+static bool suppressdup;       /* are we suppressing duplicate messages? */
 
 
-static int verbose = 0;
-static int debug = 0;
+static bool verbose;
+static bool debug;
 
 static char *addr = NULL;
 static char *user = NULL;
 
 static char *addr = NULL;
 static char *user = NULL;
@@ -251,20 +251,20 @@ main (int argc, char **argv)
                    continue;
 
                case VERBSW: 
                    continue;
 
                case VERBSW: 
-                   verbose++;
+                   verbose = true;
                    continue;
                case NVERBSW: 
                    continue;
                case NVERBSW: 
-                   verbose = 0;
+                   verbose = false;
                    continue;
 
                case SUPPRESSDUP:
                    continue;
 
                case SUPPRESSDUP:
-                   suppressdup++;
+                   suppressdup = true;
                    continue;
                case NSUPPRESSDUP:
                    continue;
                case NSUPPRESSDUP:
-                   suppressdup = 0;
+                   suppressdup = false;
                    continue;
                case DEBUGSW: 
                    continue;
                case DEBUGSW: 
-                   debug++;
+                   debug = true;
                    continue;
            }
        } else {
                    continue;
            }
        } else {
@@ -423,7 +423,9 @@ usr_delivery (int fd, char *delivery, int su)
 {
     int i;
     bool accept;
 {
     int i;
     bool accept;
-    int status=1, won, vecp;
+    int status=1;
+    bool won;
+    int vecp;
     bool next;
     char *field, *pattern, *action, *result, *string;
     char buffer[BUFSIZ], tmpbuf[BUFSIZ];
     bool next;
     char *field, *pattern, *action, *result, *string;
     char buffer[BUFSIZ], tmpbuf[BUFSIZ];
@@ -447,7 +449,7 @@ usr_delivery (int fd, char *delivery, int su)
        return -1;
     }
 
        return -1;
     }
 
-    won = 0;
+    won = false;
     next = true;
 
     /* read and process delivery file */
     next = true;
 
     /* read and process delivery file */
@@ -636,7 +638,7 @@ usr_delivery (int fd, char *delivery, int su)
        if (status) next = false; /* action failed, mark for 'N' result */
 
        if (accept && status == 0)
        if (status) next = false; /* action failed, mark for 'N' result */
 
        if (accept && status == 0)
-           won++;
+           won = true;
     }
 
     fclose (fp);
     }
 
     fclose (fp);
index a47eb9e4795622e8fc1f1f7c4377b83762805f0d..75c322a24091b24e8ee7ac44e57640e22afd6122 100644 (file)
@@ -46,8 +46,8 @@ int nmsgs;
 
 char *subjsort;                 /* sort on subject if != 0 */
 time_t datelimit = 0;
 
 char *subjsort;                 /* sort on subject if != 0 */
 time_t datelimit = 0;
-int submajor = 0;              /* if true, sort on subject-major */
-int verbose;
+bool submajor;                 /* if true, sort on subject-major */
+bool verbose;
 int allmsgs = 1;
 int check_failed = 0;
 
 int allmsgs = 1;
 int check_failed = 0;
 
@@ -131,7 +131,7 @@ main (int argc, char **argv)
                while (*cp == '0')
                    cp++;               /* skip any leading zeros */
                if (!*cp) {             /* hit end of string */
                while (*cp == '0')
                    cp++;               /* skip any leading zeros */
                if (!*cp) {             /* hit end of string */
-                   submajor++;         /* sort subject-major */
+                   submajor = true;    /* sort subject-major */
                    continue;
                }
                if (!isdigit((unsigned char) *cp) || !(datelimit = atoi(cp)))
                    continue;
                }
                if (!isdigit((unsigned char) *cp) || !(datelimit = atoi(cp)))
@@ -139,15 +139,15 @@ main (int argc, char **argv)
                datelimit *= 60*60*24;
                continue;
            case NLIMSW:
                datelimit *= 60*60*24;
                continue;
            case NLIMSW:
-               submajor = 0;   /* use date-major, but */
-               datelimit = 0;  /* use no limit */
+               submajor = false;       /* use date-major, but */
+               datelimit = 0;          /* use no limit */
                continue;
 
            case VERBSW:
                continue;
 
            case VERBSW:
-               verbose++;
+               verbose = true;
                continue;
            case NVERBSW:
                continue;
            case NVERBSW:
-               verbose = 0;
+               verbose = false;
                continue;
 
            case ALLMSGS:
                continue;
 
            case ALLMSGS:
index 7d9214e60d3efa53ccf7d4232ba290a68142343f..c25205424e38206c73e62c2d09037c3e1ce681df 100644 (file)
@@ -41,7 +41,7 @@ DEFINE_SWITCH_ARRAY(VIAMAIL, switches);
 
 extern int debugsw;
 extern int splitsw;
 
 extern int debugsw;
 extern int splitsw;
-extern int verbsw;
+extern bool verbsw;
 
 /*
  * static prototypes
 
 /*
  * static prototypes
@@ -117,10 +117,10 @@ main (int argc, char **argv)
                continue;
 
            case VERBSW: 
                continue;
 
            case VERBSW: 
-               verbsw = 1;
+               verbsw = true;
                continue;
            case NVERBSW: 
                continue;
            case NVERBSW: 
-               verbsw = 0;
+               verbsw = false;
                continue;
 
            case DEBUGSW:
                continue;
 
            case DEBUGSW:
index 2fa0ed85cd3b92f584f1578f6f21cbafeee35500..8a4c372bb6f80dd9ce156b91c5c01054757f577d 100644 (file)
@@ -23,7 +23,8 @@ int
 what_now (char *ed, int nedit, int use, char *file, char *altmsg, int dist,
           struct msgs *mp, char *text, int inplace, char *cwd, int atfile)
 {
 what_now (char *ed, int nedit, int use, char *file, char *altmsg, int dist,
           struct msgs *mp, char *text, int inplace, char *cwd, int atfile)
 {
-    int found, k, msgnum, vecp;
+    bool found;
+    int k, msgnum, vecp;
     int len, buflen;
     char *bp;
     char buffer[BUFSIZ], *vec[MAXARGS];
     int len, buflen;
     char *bp;
     char buffer[BUFSIZ], *vec[MAXARGS];
@@ -68,7 +69,7 @@ what_now (char *ed, int nedit, int use, char *file, char *altmsg, int dist,
     unsetenv("mhinplace");
 
     if (text && mp && !is_readonly(mp)) {
     unsetenv("mhinplace");
 
     if (text && mp && !is_readonly(mp)) {
-       found = 0;
+       found = false;
        bp = buffer;
        buflen = sizeof(buffer);
        for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) {
        bp = buffer;
        buflen = sizeof(buffer);
        for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) {
@@ -86,7 +87,7 @@ what_now (char *ed, int nedit, int use, char *file, char *altmsg, int dist,
                    buflen -= len;
                }
                msgnum = k + 1;
                    buflen -= len;
                }
                msgnum = k + 1;
-               found++;
+               found = true;
            }
        }
        if (found) {
            }
        }
        if (found) {
index 9d9ab63372bd2f7b6cc936467b86e14319384d42..2f00ba586d47df50e849bd733b774e5eb133757c 100644 (file)
@@ -120,7 +120,9 @@ static int copyf (char *, char *);
 int
 WhatNow (int argc, char **argv)
 {
 int
 WhatNow (int argc, char **argv)
 {
-    int isdf = 0, nedit = 0, use = 0, atfile = 1;
+    int isdf = 0;
+    bool nedit = false;
+    int use = 0, atfile = 1;
     char *cp, *dfolder = NULL, *dmsg = NULL;
     char *ed = NULL, *drft = NULL, *msgnam = NULL;
     char buf[BUFSIZ];
     char *cp, *dfolder = NULL, *dmsg = NULL;
     char *ed = NULL, *drft = NULL, *msgnam = NULL;
     char buf[BUFSIZ];
@@ -186,10 +188,10 @@ WhatNow (int argc, char **argv)
            case EDITRSW:
                if (!(ed = *argp++) || *ed == '-')
                    die("missing argument to %s", argp[-2]);
            case EDITRSW:
                if (!(ed = *argp++) || *ed == '-')
                    die("missing argument to %s", argp[-2]);
-               nedit = 0;
+               nedit = false;
                continue;
            case NEDITSW:
                continue;
            case NEDITSW:
-               nedit++;
+               nedit = true;
                continue;
 
            case PRMPTSW:
                continue;
 
            case PRMPTSW:
@@ -216,7 +218,7 @@ WhatNow (int argc, char **argv)
 
     if (ed == NULL && ((ed = getenv ("mheditor")) == NULL || *ed == 0)) {
        ed = NULL;
 
     if (ed == NULL && ((ed = getenv ("mheditor")) == NULL || *ed == 0)) {
        ed = NULL;
-       nedit++;
+       nedit = true;
     }
 
     /* start editing the draft, unless -noedit was given */
     }
 
     /* start editing the draft, unless -noedit was given */
@@ -634,7 +636,7 @@ popen_in_dir(const char *dir, const char *cmd, const char *type)
  * EDIT
  */
 
  * EDIT
  */
 
-static int  reedit = 0;                /* have we been here before?     */
+static bool reedit;                    /* have we been here before?     */
 static char *edsave = NULL;    /* the editor we used previously */
 
 
 static char *edsave = NULL;    /* the editor we used previously */
 
 
@@ -739,7 +741,7 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp,
                break;
            }
 
                break;
            }
 
-           reedit++;
+           reedit = true;
            if (altmsg
                    && mp
                    && !is_readonly(mp)
            if (altmsg
                    && mp
                    && !is_readonly(mp)
@@ -956,12 +958,12 @@ DEFINE_SWITCH_ARRAY(SEND, sendswitches);
 
 
 extern int debugsw;            /* from sendsbr.c */
 
 
 extern int debugsw;            /* from sendsbr.c */
-extern int forwsw;
+extern bool forwsw;
 extern int inplace;
 extern int inplace;
-extern int pushsw;
+extern bool pushsw;
 extern int splitsw;
 extern int splitsw;
-extern int unique;
-extern int verbsw;
+extern bool unique;
+extern bool verbsw;
 
 extern char *altmsg;           /*  .. */
 extern char *annotext;
 
 extern char *altmsg;           /*  .. */
 extern char *annotext;
@@ -1012,9 +1014,9 @@ sendit (char *sp, char **arg, char *file, int pushed)
     argp = arguments;
 
     debugsw = 0;
     argp = arguments;
 
     debugsw = 0;
-    forwsw = 1;
+    forwsw = true;
     inplace = 1;
     inplace = 1;
-    unique = 0;
+    unique = false;
 
     altmsg = NULL;
     annotext = NULL;
 
     altmsg = NULL;
     annotext = NULL;
@@ -1078,24 +1080,24 @@ sendit (char *sp, char **arg, char *file, int pushed)
                    continue;
 
                case UNIQSW:
                    continue;
 
                case UNIQSW:
-                   unique++;
+                   unique = true;
                    continue;
                case NUNIQSW:
                    continue;
                case NUNIQSW:
-                   unique = 0;
+                   unique = false;
                    continue;
                case FORWSW:
                    continue;
                case FORWSW:
-                   forwsw++;
+                   forwsw = true;
                    continue;
                case NFORWSW:
                    continue;
                case NFORWSW:
-                   forwsw = 0;
+                   forwsw = false;
                    continue;
 
                case VERBSW:
                    continue;
 
                case VERBSW:
-                   verbsw++;
+                   verbsw = true;
                    vec[vecp++] = --cp;
                    continue;
                case NVERBSW:
                    vec[vecp++] = --cp;
                    continue;
                case NVERBSW:
-                   verbsw = 0;
+                   verbsw = false;
                    vec[vecp++] = --cp;
                    continue;
 
                    vec[vecp++] = --cp;
                    continue;