From: Ralph Corderoy Date: Mon, 28 Aug 2017 16:49:29 +0000 (+0100) Subject: Don't cast zero to a non-function pointer; use NULL instead. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/de06ed5f176a5fa3eb5522bb9a9741f9c3f1d0f4?ds=inline Don't cast zero to a non-function pointer; use NULL instead. Better still, omit it when BSS does the job, or C's treatment of non-zero as true is sufficient. --- diff --git a/sbr/context_read.c b/sbr/context_read.c index 8350b98d..a8d14202 100644 --- a/sbr/context_read.c +++ b/sbr/context_read.c @@ -140,7 +140,7 @@ context_read (void) ctxpath = getcpy (m_maildir (cp)); if ((ib = lkfopendata (ctxpath, "r", &failed_to_lock))) { - readconfig ((struct node **) 0, ib, cp, 1); + readconfig(NULL, ib, cp, 1); lkfclosedata (ib, ctxpath); } } diff --git a/sbr/fmt_compile.c b/sbr/fmt_compile.c index 389e16c4..a9dad42b 100644 --- a/sbr/fmt_compile.c +++ b/sbr/fmt_compile.c @@ -354,7 +354,7 @@ lookup(char *name) t++; } - return (struct ftable *) 0; + return NULL; } @@ -572,7 +572,7 @@ do_name(char *sp, int preprocess) case FT_GETMYMBOX: case FT_GETMYADDR: if (!primed) { - ismymbox ((struct mailname *) 0); + ismymbox(NULL); primed++; } /* FALLTHRU */ @@ -732,7 +732,7 @@ do_func(char *sp) } case TF_NOW: - LV(t->f_type, time((time_t *) 0)); + LV(t->f_type, time(NULL)); break; case TF_EXPR_SV: diff --git a/sbr/fmt_scan.c b/sbr/fmt_scan.c index 0de7a432..e80edc19 100644 --- a/sbr/fmt_scan.c +++ b/sbr/fmt_scan.c @@ -841,7 +841,7 @@ fmt_scan (struct format *format, charstring_t scanlp, int width, int *dat, case FT_LV_RCLOCK: if ((value = fmt->f_comp->c_tws->tw_clock) == 0) value = dmktime(fmt->f_comp->c_tws); - value = time((time_t *) 0) - value; + value = time(NULL) - value; break; case FT_LV_DAYF: if (!(((tws = fmt->f_comp->c_tws)->tw_flags) & (TW_SEXP|TW_SIMP))) diff --git a/uip/annosbr.c b/uip/annosbr.c index 124c77e7..7e7cefd0 100644 --- a/uip/annosbr.c +++ b/uip/annosbr.c @@ -140,7 +140,7 @@ annolist(char *file, char *comp, char *text, int number) if (number) (void)printf("%d\t", ++count); - if (text == NULL && (sp = strrchr(cp, '/')) != (char *)0) + if (text == NULL && (sp = strrchr(cp, '/'))) cp = sp + 1; puts(cp); diff --git a/uip/mhbuild.c b/uip/mhbuild.c index d3761c0f..faf9aa3b 100644 --- a/uip/mhbuild.c +++ b/uip/mhbuild.c @@ -289,7 +289,7 @@ main (int argc, char **argv) */ if ((cp = getenv ("MHBUILD"))) { if ((fp = fopen (cp, "r"))) { - readconfig ((struct node **) 0, fp, cp, 0); + readconfig(NULL, fp, cp, 0); fclose (fp); } else { admonish ("", "unable to read $MHBUILD profile (%s)", cp); @@ -300,7 +300,7 @@ main (int argc, char **argv) * Read the standard profile setup */ if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) { - readconfig ((struct node **) 0, fp, cp, 0); + readconfig(NULL, fp, cp, 0); fclose (fp); } diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index a05177a3..438f8a66 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -298,7 +298,7 @@ main (int argc, char **argv) { * Read the standard profile setup */ if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) { - readconfig ((struct node **) 0, fp, cp, 0); + readconfig(NULL, fp, cp, 0); fclose (fp); } diff --git a/uip/mhn.c b/uip/mhn.c index bc0cd62b..68def2bf 100644 --- a/uip/mhn.c +++ b/uip/mhn.c @@ -311,7 +311,7 @@ do_cache: */ if ((cp = getenv ("MHN"))) { if ((fp = fopen (cp, "r"))) { - readconfig ((struct node **) 0, fp, cp, 0); + readconfig(NULL, fp, cp, 0); fclose (fp); } else { admonish ("", "unable to read $MHN profile (%s)", cp); @@ -322,7 +322,7 @@ do_cache: * Read the standard profile setup */ if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) { - readconfig ((struct node **) 0, fp, cp, 0); + readconfig(NULL, fp, cp, 0); fclose (fp); } diff --git a/uip/mhparse.c b/uip/mhparse.c index 94fd50bc..904c1237 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -2326,7 +2326,7 @@ openExternal (CT ct, CT cb, CE ce, char **file, int *fd) goto ready_already; } - if (find_cache (ct, rcachesw, (int *) 0, cb->c_id, + if (find_cache(ct, rcachesw, NULL, cb->c_id, cachefile, sizeof(cachefile)) != NOTOK) { if ((ce->ce_fp = fopen (cachefile, "r"))) { ce->ce_file = mh_xstrdup(cachefile); diff --git a/uip/mhshow.c b/uip/mhshow.c index cf38ecf1..8c604ad8 100644 --- a/uip/mhshow.c +++ b/uip/mhshow.c @@ -280,7 +280,7 @@ do_cache: */ if ((cp = getenv ("MHSHOW"))) { if ((fp = fopen (cp, "r"))) { - readconfig ((struct node **) 0, fp, cp, 0); + readconfig(NULL, fp, cp, 0); fclose (fp); } else { admonish ("", "unable to read $MHSHOW profile (%s)", cp); @@ -291,7 +291,7 @@ do_cache: * Read the standard profile setup */ if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) { - readconfig ((struct node **) 0, fp, cp, 0); + readconfig(NULL, fp, cp, 0); fclose (fp); } diff --git a/uip/mhstore.c b/uip/mhstore.c index 1ca21494..2b08a6ba 100644 --- a/uip/mhstore.c +++ b/uip/mhstore.c @@ -211,7 +211,7 @@ do_cache: */ if ((cp = getenv ("MHSTORE"))) { if ((fp = fopen (cp, "r"))) { - readconfig ((struct node **) 0, fp, cp, 0); + readconfig(NULL, fp, cp, 0); fclose (fp); } else { admonish ("", "unable to read $MHSTORE profile (%s)", cp); @@ -222,7 +222,7 @@ do_cache: * Read the standard profile setup */ if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) { - readconfig ((struct node **) 0, fp, cp, 0); + readconfig(NULL, fp, cp, 0); fclose (fp); } diff --git a/uip/sortm.c b/uip/sortm.c index 84f8e085..7e966db6 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -43,7 +43,7 @@ struct smsg { static struct smsg *smsgs; int nmsgs; -char *subjsort = (char *) 0; /* sort on subject if != 0 */ +char *subjsort; /* sort on subject if != 0 */ time_t datelimit = 0; int submajor = 0; /* if true, sort on subject-major */ int verbose;