tsearch.3: Remove unneeded cast
PATCH 1/1 tsearch.3: Remove unneeded cast
Casting int * to const void * is already done implicitly. Not only that, but the explicit cast to void * was slightly misleading.
Signed-off-by Alejandro Colomar <[email protected]>
--- man3/tsearch.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man3/tsearch.3 +1 -1
@@ -329,7 +329,7 @@ main(void) for (i = 0; i < 12; i++) { ptr = xmalloc(sizeof(*ptr)); *ptr = rand() & 0xff; - val = tsearch((void *) ptr, &root, compare); + val = tsearch(ptr, &root, compare); if (val == NULL) exit(EXIT_FAILURE); else if (*val != ptr)
Signature · 1 line
2.28.0
Quoted 14 lines · Alejandro Colomar
Casting
int *toconst void *is already done implicitly. Not only that, but the explicit cast tovoid *was slightly misleading.Signed-off-by Alejandro Colomar <[email protected]>--- man3/tsearch.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)man3/tsearch.3 +0
-0
man3/tsearch.3 main(void) · line 335
Quoted 8 lines
man3/tsearch.3 +1
-1@@ -329,7 +329,7 @@ main(void) for (i = 0; i < 12; i++) { ptr = xmalloc(sizeof(*ptr)); *ptr = rand() & 0xff; - val = tsearch((void *) ptr, &root, compare); + val = tsearch(ptr, &root, compare); if (val == NULL) exit(EXIT_FAILURE); else if (*val != ptr)
Thanks, Alex. Patch applied.
Cheers,
Michael
Signature · 3 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/