From 700f4649511dbef417e639509d2f3374b5c8c6f3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 13 Feb 2010 13:01:08 +1100 Subject: s4-torture: use TYPESAFE_QSORT() in smbtorture --- source4/torture/raw/search.c | 7 +++---- source4/torture/raw/streams.c | 14 +++++--------- source4/torture/smb2/dir.c | 4 ++-- source4/torture/smb2/streams.c | 16 +++++----------- 4 files changed, 15 insertions(+), 26 deletions(-) diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c index dec7da0751..493039a307 100644 --- a/source4/torture/raw/search.c +++ b/source4/torture/raw/search.c @@ -23,6 +23,7 @@ #include "libcli/raw/raw_proto.h" #include "libcli/libcli.h" #include "torture/util.h" +#include "lib/util/tsort.h" #define BASEDIR "\\testsearch" @@ -733,8 +734,7 @@ static bool test_many_files(struct torture_context *tctx, compare_data_level = search_types[t].data_level; - qsort(result.list, result.count, sizeof(result.list[0]), - QSORT_CAST search_compare); + TYPESAFE_QSORT(result.list, result.count, search_compare); for (i=0;istream_name.s, s2->stream_name.s); } @@ -152,7 +149,7 @@ static bool check_stream_list(struct torture_context *tctx, goto done; } - qsort(exp_sort, num_exp, sizeof(*exp_sort), qsort_string); + TYPESAFE_QSORT(exp_sort, num_exp, qsort_string); stream_sort = (struct stream_struct *)talloc_memdup(tmp_ctx, finfo.stream_info.out.streams, @@ -163,8 +160,7 @@ static bool check_stream_list(struct torture_context *tctx, goto done; } - qsort(stream_sort, finfo.stream_info.out.num_streams, - sizeof(*stream_sort), qsort_stream); + TYPESAFE_QSORT(stream_sort, finfo.stream_info.out.num_streams, qsort_stream); for (i=0; istream_name.s, s2->stream_name.s); } @@ -197,7 +192,7 @@ static bool check_stream_list(struct smb2_tree *tree, goto fail; } - qsort(exp_sort, num_exp, sizeof(*exp_sort), qsort_string); + TYPESAFE_QSORT(exp_sort, num_exp, qsort_string); stream_sort = talloc_memdup(tmp_ctx, finfo.stream_info.out.streams, finfo.stream_info.out.num_streams * @@ -207,8 +202,7 @@ static bool check_stream_list(struct smb2_tree *tree, goto fail; } - qsort(stream_sort, finfo.stream_info.out.num_streams, - sizeof(*stream_sort), qsort_stream); + TYPESAFE_QSORT(stream_sort, finfo.stream_info.out.num_streams, qsort_stream); for (i=0; i