From: Ralph Corderoy Date: Sat, 13 May 2017 12:24:03 +0000 (+0100) Subject: Use FENDNULL() instead of duplicate, locally defined, empty(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/a34ce71c09fe1d5dda955bbd987f3add2b3c368e?ds=sidebyside Use FENDNULL() instead of duplicate, locally defined, empty(). Three files had an empty() that was defined using FENDNULL(); use the latter directly. --- diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index 1e435502..a9f16d8f 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -216,8 +216,6 @@ mnfree (struct mailname *mp) } -#define empty(s) FENDNULL(s) - char * auxformat (struct mailname *mp, int extras) { @@ -230,10 +228,10 @@ auxformat (struct mailname *mp, int extras) if (mp->m_type != UUCPHOST) { if (mp->m_host) - snprintf (addr, sizeof(addr), "%s%s@%s", empty(mp->m_path), - empty(mp->m_mbox), mp->m_host); - else snprintf (addr, sizeof(addr), "%s%s", empty(mp->m_path), - empty(mp->m_mbox)); + snprintf (addr, sizeof(addr), "%s%s@%s", FENDNULL(mp->m_path), + FENDNULL(mp->m_mbox), mp->m_host); + else snprintf (addr, sizeof(addr), "%s%s", FENDNULL(mp->m_path), + FENDNULL(mp->m_mbox)); } else snprintf (addr, sizeof(addr), "%s!%s", mp->m_host, mp->m_mbox); diff --git a/sbr/seq_print.c b/sbr/seq_print.c index ce3c45fb..fafad6d8 100644 --- a/sbr/seq_print.c +++ b/sbr/seq_print.c @@ -7,8 +7,6 @@ #include -#define empty(s) FENDNULL(s) - /* * Print all the sequences in a folder */ @@ -21,7 +19,7 @@ seq_printall (struct msgs *mp) for (i = 0; i < svector_size (mp->msgattrs); i++) { list = seq_list (mp, svector_at (mp->msgattrs, i)); printf ("%s%s: %s\n", svector_at (mp->msgattrs, i), - is_seq_private (mp, i) ? " (private)" : "", empty(list)); + is_seq_private (mp, i) ? " (private)" : "", FENDNULL(list)); } } @@ -42,5 +40,5 @@ seq_print (struct msgs *mp, char *seqname) list = seq_list (mp, seqname); printf ("%s%s: %s\n", seqname, - (i == -1) ? "" : is_seq_private(mp, i) ? " (private)" : "", empty(list)); + (i == -1) ? "" : is_seq_private(mp, i) ? " (private)" : "", FENDNULL(list)); } diff --git a/uip/mhlistsbr.c b/uip/mhlistsbr.c index 42b04ae2..f7ecbc89 100644 --- a/uip/mhlistsbr.c +++ b/uip/mhlistsbr.c @@ -133,8 +133,6 @@ list_switch (CT ct, int toplevel, int realsize, int verbose, int debug, } -#define empty(s) FENDNULL(s) - /* * Method for listing information about a simple/generic content */ @@ -149,16 +147,16 @@ list_content (CT ct, int toplevel, int realsize, int verbose, int debug, PM pm; if (toplevel > 0) - printf (LSTFMT2a, atoi (r1bindex (empty (ct->c_file), '/'))); + printf (LSTFMT2a, atoi (r1bindex (FENDNULL(ct->c_file), '/'))); else printf(toplevel < 0 ? "part " : " "); - snprintf (buffer, sizeof(buffer), "%s/%s", empty (ci->ci_type), - empty (ci->ci_subtype)); + snprintf (buffer, sizeof(buffer), "%s/%s", FENDNULL(ci->ci_type), + FENDNULL(ci->ci_subtype)); if (verbose) - printf (LSTFMT2bv, empty (ct->c_partno), buffer); + printf (LSTFMT2bv, FENDNULL(ct->c_partno), buffer); else - printf (LSTFMT2b, empty (ct->c_partno), buffer); + printf (LSTFMT2b, FENDNULL(ct->c_partno), buffer); if (ct->c_cesizefnx && realsize) size = (*ct->c_cesizefnx) (ct); @@ -252,7 +250,7 @@ list_debug (CT ct) PM pm; fflush (stdout); - fprintf (stderr, " partno \"%s\"\n", empty (ct->c_partno)); + fprintf (stderr, " partno \"%s\"\n", FENDNULL(ct->c_partno)); /* print MIME-Version line */ if (ct->c_vrsn) @@ -263,10 +261,10 @@ list_debug (CT ct) fprintf (stderr, " %s:%s\n", TYPE_FIELD, ct->c_ctline); /* print parsed elements of content type */ - fprintf (stderr, " type \"%s\"\n", empty (ci->ci_type)); - fprintf (stderr, " subtype \"%s\"\n", empty (ci->ci_subtype)); - fprintf (stderr, " comment \"%s\"\n", empty (ci->ci_comment)); - fprintf (stderr, " magic \"%s\"\n", empty (ci->ci_magic)); + fprintf (stderr, " type \"%s\"\n", FENDNULL(ci->ci_type)); + fprintf (stderr, " subtype \"%s\"\n", FENDNULL(ci->ci_subtype)); + fprintf (stderr, " comment \"%s\"\n", FENDNULL(ci->ci_comment)); + fprintf (stderr, " magic \"%s\"\n", FENDNULL(ci->ci_magic)); /* print parsed parameters attached to content type */ fprintf (stderr, " parameters\n"); @@ -279,9 +277,9 @@ list_debug (CT ct) ct->c_type, ct->c_subtype, (unsigned int)(unsigned long) ct->c_ctparams); - fprintf (stderr, " showproc \"%s\"\n", empty (ct->c_showproc)); - fprintf (stderr, " termproc \"%s\"\n", empty (ct->c_termproc)); - fprintf (stderr, " storeproc \"%s\"\n", empty (ct->c_storeproc)); + fprintf (stderr, " showproc \"%s\"\n", FENDNULL(ct->c_showproc)); + fprintf (stderr, " termproc \"%s\"\n", FENDNULL(ct->c_termproc)); + fprintf (stderr, " storeproc \"%s\"\n", FENDNULL(ct->c_storeproc)); /* print transfer encoding information */ if (ct->c_celine) @@ -303,14 +301,14 @@ list_debug (CT ct) if (ct->c_dispo) fprintf (stderr, " %s:%s", DISPO_FIELD, ct->c_dispo); - fprintf(stderr, " disposition \"%s\"\n", empty (ct->c_dispo_type)); + fprintf(stderr, " disposition \"%s\"\n", FENDNULL(ct->c_dispo_type)); fprintf(stderr, " disposition parameters\n"); for (pm = ct->c_dispo_first; pm; pm = pm->pm_next) fprintf (stderr, " %s=\"%s\"\n", pm->pm_name, get_param_value(pm, '?')); fprintf (stderr, " read fp 0x%x file \"%s\" begin %ld end %ld\n", - (unsigned int)(unsigned long) ct->c_fp, empty (ct->c_file), + (unsigned int)(unsigned long) ct->c_fp, FENDNULL(ct->c_file), ct->c_begin, ct->c_end); /* print more information about transfer encoding */ @@ -319,8 +317,6 @@ list_debug (CT ct) return OK; } -#undef empty - /* * list content information for type "multipart"