]> diplodocus.org Git - nmh/commitdiff
Replace `a == b ? 1 : 0' and similar with `a == b'.
authorRalph Corderoy <ralph@inputplus.co.uk>
Fri, 12 May 2017 22:29:31 +0000 (23:29 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Fri, 12 May 2017 22:29:31 +0000 (23:29 +0100)
sbr/datetime.c
sbr/fmt_scan.c
sbr/read_yes_or_no_if_tty.c
sbr/utils.c
uip/mhbuildsbr.c
uip/mhfixmsg.c

index 8b21e69..a3e0e7a 100644 (file)
@@ -170,7 +170,7 @@ load_timezones (const contentline *clines) {
                 if (in_standard) { in_standard = 0; }
                 else if (in_daylight) { in_daylight = 0; }
                 if (parse_datetime (params->dtstart, params->offsetfrom,
-                                    in_daylight ? 1 : 0,
+                                    in_daylight,
                                     &tws) == OK) {
                     if (tws.tw_year >= 1970) {
                         /* dmktime() falls apart for, e.g., the year 1601. */
index de7d8b7..39d549a 100644 (file)
@@ -470,7 +470,7 @@ fmt_scan (struct format *format, charstring_t scanlp, int width, int *dat,
            int num = value;
            unsigned int wid;
 
-           for (wid = num <= 0  ?  1  :  0; num; ++wid, num /= 10) {}
+            for (wid = num <= 0; num; ++wid, num /= 10) {}
            cpnumber (scanlp, value, wid, ' ',
                      max - charstring_chars (scanlp));
            break;
index 05ffc2f..2427f59 100644 (file)
@@ -14,7 +14,7 @@ read_yes_or_no_if_tty (const char *prompt)
     static int interactive = -1;
 
     if (interactive < 0)
-       interactive = isatty (fileno (stdin)) ? 1 : 0;
+        interactive = isatty (fileno (stdin));
 
     return (interactive ? read_switch (prompt, anoyes) : 1);
 }
index aa344b9..4c87b38 100644 (file)
@@ -533,7 +533,7 @@ nmh_version_changed (int older) {
             context_replace ("Version", "nmh-" VERSION);
         }
 
-        return old_version < current_version  ?  1  :  0;
+        return old_version < current_version;
     }
 
     if (context_version == NULL  ||  strcmp(context_version, "nmh-" VERSION) != 0) {
index 62df410..412f871 100644 (file)
@@ -1772,7 +1772,7 @@ skip_headers:
      */
     if (checksw) {
        np = mh_xstrdup(MD5_FIELD);
-       vp = calculate_digest (ct, (ct->c_encoding == CE_QUOTED) ? 1 : 0);
+        vp = calculate_digest (ct, ct->c_encoding == CE_QUOTED);
        add_header (ct, np, vp);
     }
 
index c4016f9..acdb9d7 100644 (file)
@@ -2166,7 +2166,7 @@ content_encoding (CT ct, const char **reason) {
                     encoding = CE_8BIT;
                 }
 
-                last_char_was_cr = *cp == '\r'  ?  1  :  0;
+                last_char_was_cr = *cp == '\r';
             }
         }
 
@@ -2249,7 +2249,7 @@ strip_crs (CT ct, int *message_mods) {
                         break;
                     }
 
-                    last_char_was_cr = *cp == '\r'  ?  1  :  0;
+                    last_char_was_cr = *cp == '\r';
                 }
             }