]> diplodocus.org Git - nmh/commitdiff
void-pointer parameters don't need casting to char pointer.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 24 Sep 2017 11:31:35 +0000 (12:31 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 24 Sep 2017 11:37:52 +0000 (12:37 +0100)
E.g. `memcmp((char *)digest...' doesn't need the cast if it's already a
pointer.

uip/mhparse.c
uip/mhstoresbr.c
uip/sortm.c

index efa8848..1c4a1a9 100644 (file)
@@ -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");
index 64bddb6..18f0290 100644 (file)
@@ -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++) {
index 249122d..9d661f1 100644 (file)
@@ -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