summaryrefslogtreecommitdiff
path: root/lib-src/sorted-doc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src/sorted-doc.c')
-rw-r--r--lib-src/sorted-doc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib-src/sorted-doc.c b/lib-src/sorted-doc.c
index 2c138dc348c..595633b76d8 100644
--- a/lib-src/sorted-doc.c
+++ b/lib-src/sorted-doc.c
@@ -103,15 +103,15 @@ xstrdup (char *str)
/* Comparison function for qsort to call. */
int
-cmpdoc (DOCSTR **a, DOCSTR **b)
+cmpdoc (const void *va, const void *vb)
{
+ DOCSTR *const *a = va;
+ DOCSTR *const *b = vb;
register int val = strcmp ((*a)->name, (*b)->name);
if (val) return val;
return (*a)->type - (*b)->type;
}
-typedef int (*qsort_compare) (const void *, const void *);
-
enum state
{
WAITING, BEG_NAME, NAME_GET, BEG_DESC, DESC_GET
@@ -228,7 +228,7 @@ main (void)
/* sort the array by name; within each name, by type */
- qsort ((char*)array, cnt, sizeof (DOCSTR*), (qsort_compare)cmpdoc);
+ qsort ((char*)array, cnt, sizeof (DOCSTR*), cmpdoc);
/* write the output header */