s3: last part of TYPESAFE_QSORT() conversion
authorAndrew Tridgell <tridge@samba.org>
Sat, 13 Feb 2010 23:03:55 +0000 (10:03 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sun, 14 Feb 2010 07:44:21 +0000 (18:44 +1100)
convert smbcacls, sharesec and web/

source3/utils/sharesec.c
source3/utils/smbcacls.c
source3/web/neg_lang.c

index 4be77ecadd633f888ad79ea18506a1bfc03a2fe0..00b6975bf0dbd9fc57ebaabc3e54dc47272616bc 100644 (file)
@@ -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;i<the_acl->num_aces;) {
                if (sec_ace_equal(&the_acl->aces[i-1], &the_acl->aces[i])) {
index eefe4fe77cef1aab800ef793836ed5ea0d1cb036..5fd18ff58c2694ea49c4b33575cd247e9e58c3d6 100644 (file)
@@ -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;i<the_acl->num_aces;) {
                if (sec_ace_equal(&the_acl->aces[i-1], &the_acl->aces[i])) {
index ae33dfc4ad8178e22c1def3b2656326a34cbfc4a..f897d1097432a9262cd1badd42e0043e369e3746 100644 (file)
@@ -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 */