From: Ralph Corderoy Date: Tue, 31 Oct 2017 23:46:14 +0000 (+0000) Subject: mhbuild.c, mhbuildsbr.c: Replace three global ints with bools. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/38c0aa73edd0e2951218a7f7f64658eb7a0eebaa?hp=8c6e995a43e71e012ae133ff8ebea5719d9117fe mhbuild.c, mhbuildsbr.c: Replace three global ints with bools. Knowing the domain of the variable is Boolean aids comprehension of the variable's name and purpose. --- diff --git a/uip/mhbuild.c b/uip/mhbuild.c index 233d7a6a..2306e378 100644 --- a/uip/mhbuild.c +++ b/uip/mhbuild.c @@ -75,9 +75,9 @@ DEFINE_SWITCH_ARRAY(MIMEENCODING, encodingswitches); int debugsw = 0; -int listsw = 0; -int rfc934sw = 0; -int contentidsw = 1; +bool listsw; +bool rfc934sw; +bool contentidsw = true; /* * Temporary files @@ -116,7 +116,7 @@ main (int argc, char **argv) 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; } @@ -191,17 +191,17 @@ main (int argc, char **argv) continue; case LISTSW: - listsw++; + listsw = true; continue; case NLISTSW: - listsw = 0; + listsw = false; continue; case RFC934SW: - rfc934sw++; + rfc934sw = true; continue; case NRFC934SW: - rfc934sw = 0; + rfc934sw = false; continue; case SIZESW: @@ -212,10 +212,10 @@ main (int argc, char **argv) continue; case CONTENTIDSW: - contentidsw = 1; + contentidsw = true; continue; case NCONTENTIDSW: - contentidsw = 0; + contentidsw = false; continue; case HEADERENCSW: { diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index fc41dd10..b8b28f24 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -39,9 +39,9 @@ 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";