From: Ralph Corderoy Date: Sun, 24 Sep 2017 11:31:35 +0000 (+0100) Subject: void-pointer parameters don't need casting to char pointer. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/91634892c4d6b155c26fbc9bd70dfe0ea94462c3?ds=inline void-pointer parameters don't need casting to char pointer. E.g. `memcmp((char *)digest...' doesn't need the cast if it's already a pointer. --- diff --git a/uip/mhparse.c b/uip/mhparse.c index efa88480..1c4a1a96 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -2100,7 +2100,7 @@ openQuoted (CT ct, char **file) unsigned char digest[16]; MD5Final (digest, &mdContext); - if (memcmp((char *) digest, (char *) ct->c_digest, + if (memcmp(digest, ct->c_digest, sizeof digest)) content_error (NULL, ct, "content integrity suspect (digest mismatch) -- continuing"); diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 64bddb69..18f02908 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -358,7 +358,7 @@ store_partial (CT ct, mhstoreinfo_t info) *ctq = NULL; if (i > 1) - qsort ((char *) base, i, sizeof(*base), (qsort_comp) ct_compar); + qsort(base, i, sizeof(*base), (qsort_comp) ct_compar); cur = 1; for (ctq = base; *ctq; ctq++) { diff --git a/uip/sortm.c b/uip/sortm.c index 249122d8..9d661f10 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -231,7 +231,7 @@ main (int argc, char **argv) } /* first sort by date, or by subject-major, date-minor */ - qsort ((char *) dlist, nmsgs, sizeof(*dlist), + qsort (dlist, nmsgs, sizeof(*dlist), (qsort_comp) (submajor && subjsort ? txtsort : dsort)); /* @@ -244,8 +244,8 @@ main (int argc, char **argv) struct smsg ***il, **fp, **dp; slist = mh_xmalloc ((nmsgs+1) * sizeof(*slist)); - memcpy((char *)slist, (char *)dlist, (nmsgs+1)*sizeof(*slist)); - qsort((char *)slist, nmsgs, sizeof(*slist), (qsort_comp) subsort); + memcpy(slist, dlist, (nmsgs+1)*sizeof(*slist)); + qsort(slist, nmsgs, sizeof(*slist), (qsort_comp) subsort); /* * make an inversion list so we can quickly find