diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2020-06-14 22:49:36 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2020-06-14 22:49:36 +0000 |
commit | 77c0aeafdb196f1dfe90683bbff71a3d1cb5fbcf (patch) | |
tree | 87e6e841c412635fe5ebcab1897ee8aca7c36eae /compat_fts.c | |
parent | 98bea86787275725dd85ea3efa889650f0b41c87 (diff) | |
download | mandoc-77c0aeafdb196f1dfe90683bbff71a3d1cb5fbcf.tar.gz mandoc-77c0aeafdb196f1dfe90683bbff71a3d1cb5fbcf.tar.zst mandoc-77c0aeafdb196f1dfe90683bbff71a3d1cb5fbcf.zip |
Give the fts_compar struct member a real prototype.
This adds clarity and avoids compiler warnings.
Diffstat (limited to 'compat_fts.c')
-rw-r--r-- | compat_fts.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compat_fts.c b/compat_fts.c index 3859111a..0106923a 100644 --- a/compat_fts.c +++ b/compat_fts.c @@ -6,7 +6,7 @@ int dummy; #else -/* $Id: compat_fts.c,v 1.14 2017/02/18 12:24:24 schwarze Exp $ */ +/* $Id: compat_fts.c,v 1.15 2020/06/14 22:49:36 schwarze Exp $ */ /* $OpenBSD: fts.c,v 1.56 2016/09/21 04:38:56 guenther Exp $ */ /*- @@ -62,6 +62,8 @@ static int fts_palloc(FTS *, size_t); static FTSENT *fts_sort(FTS *, FTSENT *, int); static unsigned short fts_stat(FTS *, FTSENT *); +typedef int (*qsort_compar_proto)(const void *, const void *); + #define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) #ifndef O_CLOEXEC #define O_CLOEXEC 0 @@ -585,7 +587,8 @@ fts_sort(FTS *sp, FTSENT *head, int nitems) } for (ap = sp->fts_array, p = head; p; p = p->fts_link) *ap++ = p; - qsort(sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar); + qsort(sp->fts_array, nitems, sizeof(FTSENT *), + (qsort_compar_proto)sp->fts_compar); for (head = *(ap = sp->fts_array); --nitems; ++ap) ap[0]->fts_link = ap[1]; ap[0]->fts_link = NULL; |