summaryrefslogtreecommitdiff
path: root/libc/misc/dirent/versionsort.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-07-20 13:19:36 -0400
committerMike Frysinger <vapier@gentoo.org>2009-07-20 13:19:36 -0400
commit75552ab845005d5b386d4c1383d9c10193168847 (patch)
treef2cbce375f646a4609ffc76660f5f90b97868aa6 /libc/misc/dirent/versionsort.c
parent41ea9da89530817441761dfc1f3c716c17d7ccb4 (diff)
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 <vapier@gentoo.org>
Diffstat (limited to 'libc/misc/dirent/versionsort.c')
-rw-r--r--libc/misc/dirent/versionsort.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libc/misc/dirent/versionsort.c b/libc/misc/dirent/versionsort.c
index 53476e67f..d84da1f6c 100644
--- a/libc/misc/dirent/versionsort.c
+++ b/libc/misc/dirent/versionsort.c
@@ -8,8 +8,7 @@
#include <string.h>
#include "dirstream.h"
-int versionsort(const void *a, const void *b)
+int versionsort(const struct dirent **a, const struct dirent **b)
{
- return strverscmp((*(const struct dirent **) a)->d_name,
- (*(const struct dirent **) b)->d_name);
+ return strverscmp((*a)->d_name, (*b)->d_name);
}