diff options
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 7 | ||||
-rw-r--r-- | source4/lib/ldb/modules/sort.c | 4 | ||||
-rw-r--r-- | source4/lib/ldb/tools/ldbsearch.c | 3 | ||||
-rw-r--r-- | source4/nbt_server/wins/winsdb.c | 2 | ||||
-rw-r--r-- | source4/nbt_server/wins/winsserver.c | 3 | ||||
-rw-r--r-- | source4/rpc_server/drsuapi/getncchanges.c | 5 |
6 files changed, 8 insertions, 16 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 9fd2c1e617..725ba2a47c 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -603,9 +603,7 @@ static int replmd_replPropertyMetaDataCtr1_sort(struct replPropertyMetaDataCtr1 DEBUG(6,("Sorting rpmd with attid exception %u rDN=%s DN=%s\n", rdn_sa->attributeID_id, rdn_name, ldb_dn_get_linearized(dn))); - ldb_qsort(ctr1->array, ctr1->count, sizeof(struct replPropertyMetaData1), - discard_const_p(void, &rdn_sa->attributeID_id), - (ldb_qsort_cmp_fn_t)replmd_replPropertyMetaData1_attid_sort); + LDB_TYPESAFE_QSORT(ctr1->array, ctr1->count, &rdn_sa->attributeID_id, replmd_replPropertyMetaData1_attid_sort); return LDB_SUCCESS; } @@ -641,8 +639,7 @@ static int replmd_ldb_message_element_attid_sort(const struct ldb_message_elemen static void replmd_ldb_message_sort(struct ldb_message *msg, const struct dsdb_schema *schema) { - ldb_qsort(msg->elements, msg->num_elements, sizeof(struct ldb_message_element), - discard_const_p(void, schema), (ldb_qsort_cmp_fn_t)replmd_ldb_message_element_attid_sort); + LDB_TYPESAFE_QSORT(msg->elements, msg->num_elements, schema, replmd_ldb_message_element_attid_sort); } static int replmd_build_la_val(TALLOC_CTX *mem_ctx, struct ldb_val *v, struct dsdb_dn *dsdb_dn, diff --git a/source4/lib/ldb/modules/sort.c b/source4/lib/ldb/modules/sort.c index 5d1431d739..4ef7a0cecb 100644 --- a/source4/lib/ldb/modules/sort.c +++ b/source4/lib/ldb/modules/sort.c @@ -144,9 +144,7 @@ static int server_sort_results(struct sort_context *ac) ac->a = ldb_schema_attribute_by_name(ldb, ac->attributeName); ac->sort_result = 0; - ldb_qsort(ac->msgs, ac->num_msgs, - sizeof(struct ldb_message *), - ac, (ldb_qsort_cmp_fn_t)sort_compare); + LDB_TYPESAFE_QSORT(ac->msgs, ac->num_msgs, ac, sort_compare); if (ac->sort_result != LDB_SUCCESS) { return ac->sort_result; diff --git a/source4/lib/ldb/tools/ldbsearch.c b/source4/lib/ldb/tools/ldbsearch.c index 8f7ee1ce38..207b344195 100644 --- a/source4/lib/ldb/tools/ldbsearch.c +++ b/source4/lib/ldb/tools/ldbsearch.c @@ -248,8 +248,7 @@ again: int i; if (sctx->num_stored) { - ldb_qsort(sctx->store, sctx->num_stored, sizeof(struct ldb_message *), - ldb, (ldb_qsort_cmp_fn_t)do_compare_msg); + LDB_TYPESAFE_QSORT(sctx->store, sctx->num_stored, ldb, do_compare_msg); } for (i = 0; i < sctx->num_stored; i++) { display_message(sctx->store[i], sctx); diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c index fb3dcbf906..fef5cc84d5 100644 --- a/source4/nbt_server/wins/winsdb.c +++ b/source4/nbt_server/wins/winsdb.c @@ -503,7 +503,7 @@ add_new_addr: addresses[len+1] = NULL; - ldb_qsort(addresses, len+1 , sizeof(addresses[0]), h, (ldb_qsort_cmp_fn_t)winsdb_addr_sort_list); + LDB_TYPESAFE_QSORT(addresses, len+1, h, winsdb_addr_sort_list); return addresses; } diff --git a/source4/nbt_server/wins/winsserver.c b/source4/nbt_server/wins/winsserver.c index ca8daedc66..eab3f20d78 100644 --- a/source4/nbt_server/wins/winsserver.c +++ b/source4/nbt_server/wins/winsserver.c @@ -669,8 +669,7 @@ static void nbtd_wins_randomize1Clist(struct loadparm_context *lp_ctx, if (num_addrs <= 1) return; /* nothing to do */ /* first sort the addresses depending on the matching to the client */ - ldb_qsort(addresses, num_addrs , sizeof(addresses[0]), - src, (ldb_qsort_cmp_fn_t)nbtd_wins_randomize1Clist_sort); + LDB_TYPESAFE_QSORT(addresses, num_addrs, src, nbtd_wins_randomize1Clist_sort); mask = lp_parm_string(lp_ctx, NULL, "nbtd", "wins_randomize1Clist_mask"); if (!mask) { diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c index a82962e31d..ac277e58b8 100644 --- a/source4/rpc_server/drsuapi/getncchanges.c +++ b/source4/rpc_server/drsuapi/getncchanges.c @@ -990,9 +990,8 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_ r->out.ctr->ctr6.linked_attributes_count = getnc_state->la_count; r->out.ctr->ctr6.linked_attributes = talloc_steal(mem_ctx, getnc_state->la_list); - ldb_qsort(r->out.ctr->ctr6.linked_attributes, r->out.ctr->ctr6.linked_attributes_count, - sizeof(r->out.ctr->ctr6.linked_attributes[0]), - b_state->sam_ctx, (ldb_qsort_cmp_fn_t)linked_attribute_compare); + LDB_TYPESAFE_QSORT(r->out.ctr->ctr6.linked_attributes, r->out.ctr->ctr6.linked_attributes_count, + b_state->sam_ctx, linked_attribute_compare); r->out.ctr->ctr6.uptodateness_vector = talloc(mem_ctx, struct drsuapi_DsReplicaCursor2CtrEx); r->out.ctr->ctr6.new_highwatermark.highest_usn = r->out.ctr->ctr6.new_highwatermark.tmp_highest_usn; |