From 75552ab845005d5b386d4c1383d9c10193168847 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 20 Jul 2009 13:19:36 -0400 Subject: dirent: push dirent type to prototypes This syncs the dirent related functions with the glibc behavior -- rather than take void pointers everywhere, make the struct dirent pointers explicit in the API. After all, the functions themselves will cast the pointers to a dirent structure, so if it isn't as expected, people will crash. Signed-off-by: Mike Frysinger --- libc/misc/dirent/scandir.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'libc/misc/dirent/scandir.c') diff --git a/libc/misc/dirent/scandir.c b/libc/misc/dirent/scandir.c index 9f1055439..bb425648b 100644 --- a/libc/misc/dirent/scandir.c +++ b/libc/misc/dirent/scandir.c @@ -12,15 +12,9 @@ #include #include "dirstream.h" -/* Experimentally off - libc_hidden_proto(memcpy) */ -/* libc_hidden_proto(opendir) */ -/* libc_hidden_proto(closedir) */ -/* libc_hidden_proto(qsort) */ -/* libc_hidden_proto(readdir) */ - int scandir(const char *dir, struct dirent ***namelist, int (*selector) (const struct dirent *), - int (*compar) (const void *, const void *)) + int (*compar) (const struct dirent **, const struct dirent **)) { DIR *dp = opendir (dir); struct dirent *current; @@ -94,7 +88,7 @@ int scandir(const char *dir, struct dirent ***namelist, /* Sort the list if we have a comparison function to sort with. */ if (compar != NULL) - qsort (names, pos, sizeof (struct dirent *), compar); + qsort (names, pos, sizeof (struct dirent *), (comparison_fn_t) compar); *namelist = names; return pos; } -- cgit v1.2.3