From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5092 invoked from network); 14 Jun 2020 22:50:16 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 14 Jun 2020 22:50:16 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 8ddf9042 for ; Sun, 14 Jun 2020 17:50:07 -0500 (EST) Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id afd48901 for ; Sun, 14 Jun 2020 17:50:07 -0500 (EST) Date: Sun, 14 Jun 2020 17:50:07 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: Give the fts_compar struct member a real prototype. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: <490dd1db92f39dc7@mandoc.bsd.lv> Log Message: ----------- Give the fts_compar struct member a real prototype. This adds clarity and avoids compiler warnings. Modified Files: -------------- mandoc: compat_fts.h compat_fts.c Revision Data ------------- Index: compat_fts.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/compat_fts.c,v retrieving revision 1.14 retrieving revision 1.15 diff -Lcompat_fts.c -Lcompat_fts.c -u -p -r1.14 -r1.15 --- compat_fts.c +++ compat_fts.c @@ -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 nite } 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; Index: compat_fts.h =================================================================== RCS file: /home/cvs/mandoc/mandoc/compat_fts.h,v retrieving revision 1.4 retrieving revision 1.5 diff -Lcompat_fts.h -Lcompat_fts.h -u -p -r1.4 -r1.5 --- compat_fts.h +++ compat_fts.h @@ -43,7 +43,8 @@ typedef struct { char *fts_path; /* path for this descent */ size_t fts_pathlen; /* sizeof(path) */ int fts_nitems; /* elements in the sort array */ - int (*fts_compar)(); /* compare function */ + int (*fts_compar)(const struct _ftsent **, const struct _ftsent **); + /* compare function */ #define FTS_NOCHDIR 0x0004 /* don't change directories */ #define FTS_PHYSICAL 0x0010 /* physical walk */ -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv