]> diplodocus.org Git - nmh/commitdiff
mhbuild.c, mhbuildsbr.c: Replace three global ints with bools.
authorRalph Corderoy <ralph@inputplus.co.uk>
Tue, 31 Oct 2017 23:46:14 +0000 (23:46 +0000)
committerRalph Corderoy <ralph@inputplus.co.uk>
Tue, 31 Oct 2017 23:46:14 +0000 (23:46 +0000)
Knowing the domain of the variable is Boolean aids comprehension of the
variable's name and purpose.

uip/mhbuild.c
uip/mhbuildsbr.c

index 233d7a6a227a58b70b2d7568aef78ec8af4bba61..2306e378185e7152a37a68f5fc10eb52ae9078dd 100644 (file)
@@ -75,9 +75,9 @@ DEFINE_SWITCH_ARRAY(MIMEENCODING, encodingswitches);
 
 int debugsw = 0;
 
 
 int debugsw = 0;
 
-int listsw   = 0;
-int rfc934sw = 0;
-int contentidsw = 1;
+bool listsw;
+bool rfc934sw;
+bool contentidsw = true;
 
 /*
  * Temporary files
 
 /*
  * Temporary files
@@ -116,7 +116,7 @@ main (int argc, char **argv)
            if (compfile)
                die("cannot specify both standard input and a file");
             compfile = cp;
            if (compfile)
                die("cannot specify both standard input and a file");
             compfile = cp;
-           listsw = 0;         /* turn off -list if using standard in/out */
+           listsw = false;     /* turn off -list if using standard in/out */
            verbosw = 0;        /* turn off -verbose listings */
            break;
        }
            verbosw = 0;        /* turn off -verbose listings */
            break;
        }
@@ -191,17 +191,17 @@ main (int argc, char **argv)
                continue;
 
            case LISTSW:
                continue;
 
            case LISTSW:
-               listsw++;
+               listsw = true;
                continue;
            case NLISTSW:
                continue;
            case NLISTSW:
-               listsw = 0;
+               listsw = false;
                continue;
 
            case RFC934SW:
                continue;
 
            case RFC934SW:
-               rfc934sw++;
+               rfc934sw = true;
                continue;
            case NRFC934SW:
                continue;
            case NRFC934SW:
-               rfc934sw = 0;
+               rfc934sw = false;
                continue;
 
            case SIZESW:
                continue;
 
            case SIZESW:
@@ -212,10 +212,10 @@ main (int argc, char **argv)
                continue;
 
            case CONTENTIDSW:
                continue;
 
            case CONTENTIDSW:
-               contentidsw = 1;
+               contentidsw = true;
                continue;
            case NCONTENTIDSW:
                continue;
            case NCONTENTIDSW:
-               contentidsw = 0;
+               contentidsw = false;
                continue;
 
            case HEADERENCSW: {
                continue;
 
            case HEADERENCSW: {
index fc41dd1000ce679f3e804baceadce64d2dde57e8..b8b28f24aa827a2a010ceff2ee9efbd3a382600b 100644 (file)
@@ -39,9 +39,9 @@
 
 extern int debugsw;
 
 
 extern int debugsw;
 
-extern int listsw;
-extern int rfc934sw;
-extern int contentidsw;
+extern bool listsw;
+extern bool rfc934sw;
+extern bool contentidsw;
 
 static char prefix[] = "----- =_aaaaaaaaaa";
 
 
 static char prefix[] = "----- =_aaaaaaaaaa";