diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2012-03-22 01:44:20 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2012-03-22 01:44:20 +0000 |
commit | 2e2475e8d275a770779144663fee23b401a6ce13 (patch) | |
tree | 5a88ea7fc8280d284edc70b122ae860aee8515d7 /usr.sbin | |
parent | 28b53b23fb896b2ac25241cc161d67f65b88b054 (diff) |
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@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/lpr/lpc/cmds.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.sbin/lpr/lpc/cmds.c b/usr.sbin/lpr/lpc/cmds.c index b964ae679c3..c9a444b59ae 100644 --- a/usr.sbin/lpr/lpc/cmds.c +++ b/usr.sbin/lpr/lpc/cmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmds.c,v 1.22 2012/03/04 04:05:15 fgsch Exp $ */ +/* $OpenBSD: cmds.c,v 1.23 2012/03/22 01:44:19 guenther Exp $ */ /* $NetBSD: cmds.c,v 1.12 1997/10/05 15:12:06 mrg Exp $ */ /* @@ -63,7 +63,7 @@ static int doselect(struct dirent *); static void enablepr(void); static void prstat(void); static void putmsg(int, char **); -static int sortq(const void *, const void *); +static int sortq(const struct dirent **, const struct dirent **); static void startpr(int); static void stoppr(void); static int touch(struct queue *); @@ -265,13 +265,10 @@ doselect(struct dirent *d) * by `cf', `tf', or `df', then by the sequence letter A-Z, a-z. */ static int -sortq(const void *a, const void *b) +sortq(const struct dirent **d1, const struct dirent **d2) { - const struct dirent **d1, **d2; int c1, c2; - d1 = (const struct dirent **)a; - d2 = (const struct dirent **)b; if ((c1 = strcmp((*d1)->d_name + 3, (*d2)->d_name + 3)) != 0) return(c1); c1 = (*d1)->d_name[0]; |