Mercurial > emacs
comparison lib-src/sorted-doc.c @ 109120:9983eb21a9c9
Fix invalid cast
* sorted-doc.c (cmpdoc): Fix signature.
(qsort_compare): Delete.
(main): Remove cast.
author | Andreas Schwab <schwab@linux-m68k.org> |
---|---|
date | Sat, 03 Jul 2010 14:11:03 +0200 |
parents | 71150397fb59 |
children | fdbd24f8d999 |
comparison
equal
deleted
inserted
replaced
109119:00accbd76dbd | 109120:9983eb21a9c9 |
---|---|
101 } | 101 } |
102 | 102 |
103 /* Comparison function for qsort to call. */ | 103 /* Comparison function for qsort to call. */ |
104 | 104 |
105 int | 105 int |
106 cmpdoc (DOCSTR **a, DOCSTR **b) | 106 cmpdoc (const void *va, const void *vb) |
107 { | 107 { |
108 DOCSTR *const *a = va; | |
109 DOCSTR *const *b = vb; | |
108 register int val = strcmp ((*a)->name, (*b)->name); | 110 register int val = strcmp ((*a)->name, (*b)->name); |
109 if (val) return val; | 111 if (val) return val; |
110 return (*a)->type - (*b)->type; | 112 return (*a)->type - (*b)->type; |
111 } | 113 } |
112 | |
113 typedef int (*qsort_compare) (const void *, const void *); | |
114 | 114 |
115 enum state | 115 enum state |
116 { | 116 { |
117 WAITING, BEG_NAME, NAME_GET, BEG_DESC, DESC_GET | 117 WAITING, BEG_NAME, NAME_GET, BEG_DESC, DESC_GET |
118 }; | 118 }; |
226 for (dp = docs, i = 0; dp != NULL ; dp = dp->next) | 226 for (dp = docs, i = 0; dp != NULL ; dp = dp->next) |
227 array[i++] = dp; | 227 array[i++] = dp; |
228 | 228 |
229 /* sort the array by name; within each name, by type */ | 229 /* sort the array by name; within each name, by type */ |
230 | 230 |
231 qsort ((char*)array, cnt, sizeof (DOCSTR*), (qsort_compare)cmpdoc); | 231 qsort ((char*)array, cnt, sizeof (DOCSTR*), cmpdoc); |
232 | 232 |
233 /* write the output header */ | 233 /* write the output header */ |
234 | 234 |
235 printf ("\\input texinfo @c -*-texinfo-*-\n"); | 235 printf ("\\input texinfo @c -*-texinfo-*-\n"); |
236 printf ("@setfilename ../info/summary\n"); | 236 printf ("@setfilename ../info/summary\n"); |