diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 6 | ||||
| -rw-r--r-- | lib-src/sorted-doc.c | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 939f3f219ec..e80ca8a4cc2 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-07-03 Andreas Schwab <schwab@linux-m68k.org> | ||
| 2 | |||
| 3 | * sorted-doc.c (cmpdoc): Fix signature. | ||
| 4 | (qsort_compare): Delete. | ||
| 5 | (main): Remove cast. | ||
| 6 | |||
| 1 | 2010-07-03 Juanma Barranquero <lekktu@gmail.com> | 7 | 2010-07-03 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 8 | ||
| 3 | * ebrowse.c (match_qualified_namespace_alias): Check for null pointer. | 9 | * ebrowse.c (match_qualified_namespace_alias): Check for null pointer. |
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) | |||
| 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 | 114 | ||
| 113 | typedef int (*qsort_compare) (const void *, const void *); | ||
| 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 |
| @@ -228,7 +228,7 @@ main (void) | |||
| 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 | ||