tree-wide: use typesafe_qsort()

This commit is contained in:
Yu Watanabe
2018-09-19 08:02:52 +09:00
parent 6058516a14
commit 93bab28895
35 changed files with 243 additions and 374 deletions
+3 -5
View File
@@ -202,10 +202,8 @@ int boot_loader_read_conf(const char *path, BootConfig *config) {
return 0;
}
static int boot_entry_compare(const void *a, const void *b) {
const BootEntry *aa = a, *bb = b;
return str_verscmp(aa->filename, bb->filename);
static int boot_entry_compare(const BootEntry *a, const BootEntry *b) {
return str_verscmp(a->filename, b->filename);
}
int boot_entries_find(const char *dir, BootEntry **ret_entries, size_t *ret_n_entries) {
@@ -234,7 +232,7 @@ int boot_entries_find(const char *dir, BootEntry **ret_entries, size_t *ret_n_en
n++;
}
qsort_safe(array, n, sizeof(BootEntry), boot_entry_compare);
typesafe_qsort(array, n, boot_entry_compare);
*ret_entries = array;
*ret_n_entries = n;