From 862a17e9ba0aac382a4301d1d60c9d5ea4888959 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 14 Feb 2010 10:03:55 +1100 Subject: s3: last part of TYPESAFE_QSORT() conversion convert smbcacls, sharesec and web/ --- source3/utils/sharesec.c | 2 +- source3/utils/smbcacls.c | 2 +- source3/web/neg_lang.c | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'source3') diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c index 4be77ecadd..00b6975bf0 100644 --- a/source3/utils/sharesec.c +++ b/source3/utils/sharesec.c @@ -388,7 +388,7 @@ static void sort_acl(SEC_ACL *the_acl) uint32 i; if (!the_acl) return; - qsort(the_acl->aces, the_acl->num_aces, sizeof(the_acl->aces[0]), QSORT_CAST ace_compare); + TYPESAFE_QSORT(the_acl->aces, the_acl->num_aces, ace_compare); for (i=1;inum_aces;) { if (sec_ace_equal(&the_acl->aces[i-1], &the_acl->aces[i])) { diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index eefe4fe77c..5fd18ff58c 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -792,7 +792,7 @@ static void sort_acl(SEC_ACL *the_acl) uint32 i; if (!the_acl) return; - qsort(the_acl->aces, the_acl->num_aces, sizeof(the_acl->aces[0]), QSORT_CAST ace_compare); + TYPESAFE_QSORT(the_acl->aces, the_acl->num_aces, ace_compare); for (i=1;inum_aces;) { if (sec_ace_equal(&the_acl->aces[i-1], &the_acl->aces[i])) { diff --git a/source3/web/neg_lang.c b/source3/web/neg_lang.c index ae33dfc4ad..f897d10974 100644 --- a/source3/web/neg_lang.c +++ b/source3/web/neg_lang.c @@ -51,9 +51,8 @@ struct pri_list { char *string; }; -static int qsort_cmp_list(const void *x, const void *y) { - struct pri_list *a = (struct pri_list *)x; - struct pri_list *b = (struct pri_list *)y; +static int qsort_cmp_list(struct pri_list *a, struct pri_list *b) +{ if (a->pri > b->pri) return -1; if (a->pri < b->pri) return 1; return 0; @@ -101,7 +100,7 @@ void web_set_lang(const char *lang_string) } TALLOC_FREE(lang_list); - qsort(pl, lang_num, sizeof(struct pri_list), &qsort_cmp_list); + TYPESAFE_QSORT(pl, lang_num, qsort_cmp_list); /* it's not an error to not initialise - we just fall back to the default */ -- cgit