From cdcacd10bab0f0511c78b741eb9c7f7c19b2f4aa Mon Sep 17 00:00:00 2001 From: guenther <> Date: Thu, 22 Mar 2012 01:44:19 +0000 Subject: [PATCH] Update alphasort() and scandir()'s argument types to match POSIX: use "const struct dirent **" instead of "const void *". Also, add __restrict to readdir_r(). ok matthew@ --- src/include/dirent.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/include/dirent.h b/src/include/dirent.h index c59fc1e0..0d5884cb 100644 --- a/src/include/dirent.h +++ b/src/include/dirent.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dirent.h,v 1.25 2012/03/22 01:13:40 matthew Exp $ */ +/* $OpenBSD: dirent.h,v 1.26 2012/03/22 01:44:19 guenther Exp $ */ /* $NetBSD: dirent.h,v 1.9 1995/03/26 20:13:37 jtc Exp $ */ /*- @@ -112,12 +112,13 @@ long telldir(DIR *); void seekdir(DIR *, long); #endif #if __POSIX_VISIBLE >= 199506 || __XPG_VISIBLE >= 500 -int readdir_r(DIR *, struct dirent *, struct dirent **); +int readdir_r(DIR *__restrict, struct dirent *__restrict, + struct dirent **__restrict); #endif -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 -int scandir(const char *, struct dirent ***, - int (*)(struct dirent *), int (*)(const void *, const void *)); -int alphasort(const void *, const void *); +#if __POSIX_VISIBLE >= 200809 +int scandir(const char *, struct dirent ***, int (*)(struct dirent *), + int (*)(const struct dirent **, const struct dirent **)); +int alphasort(const struct dirent **, const struct dirent **); #endif #if __POSIX_VISIBLE >= 200809 || __XPG_VISIBLE > 600 int (dirfd)(DIR *);