]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
bsearch.3: Fix intermediate type and remove unneeded casts
authorAlejandro Colomar <colomar.6.4.3@gmail.com>
Sat, 5 Sep 2020 15:15:00 +0000 (17:15 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 6 Sep 2020 12:58:29 +0000 (14:58 +0200)
Casting `const void *` to `struct mi *` should result in a warning if
done implicitly.  The explicit cast was probably silencing that warning.
`const` can and should be kept.
Now, casting `const void *` to `const struct mi *` is done implicitly.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man3/bsearch.3

index 6dfd5158f3e6c621703dc064e40cdd0685fda5a4..9d4f76da53ddf77725dec816ba54549d01dceb59 100644 (file)
@@ -114,8 +114,8 @@ struct mi {
 static int
 compmi(const void *m1, const void *m2)
 {
-    struct mi *mi1 = (struct mi *) m1;
-    struct mi *mi2 = (struct mi *) m2;
+    const struct mi *mi1 = m1;
+    const struct mi *mi2 = m2;
     return strcmp(mi1\->name, mi2\->name);
 }