From: Joseph Sutton Date: Fri, 21 Oct 2022 01:17:30 +0000 (+1300) Subject: ldb: don't call comparison() directly in LDB_TYPESAFE_QSORT X-Git-Tag: talloc-2.4.0~685 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19895c9389e0109eeb84cdbbfe1fafafcbb516fe;p=thirdparty%2Fsamba.git ldb: don't call comparison() directly in LDB_TYPESAFE_QSORT The result is not used, it is only part of the macro to gain type-checking. Signed-off-by: Joseph Sutton Reviewed-by: Douglas Bagnall --- diff --git a/lib/ldb/include/ldb.h b/lib/ldb/include/ldb.h index 1b3021b0fba..68cbfdb6f7a 100644 --- a/lib/ldb/include/ldb.h +++ b/lib/ldb/include/ldb.h @@ -2296,7 +2296,9 @@ void ldb_qsort (void *const pbase, size_t total_elems, size_t size, void *opaque do { \ if (numel > 1) { \ ldb_qsort(base, numel, sizeof((base)[0]), discard_const(opaque), (ldb_qsort_cmp_fn_t)comparison); \ - comparison(&((base)[0]), &((base)[1]), opaque); \ + if (0) { \ + comparison(&((base)[0]), &((base)[1]), opaque); \ + } \ } \ } while (0) @@ -2306,7 +2308,9 @@ do { \ do { \ if (numel > 1) { \ qsort(base, numel, sizeof((base)[0]), (int (*)(const void *, const void *))comparison); \ - comparison(&((base)[0]), &((base)[1])); \ + if (0) { \ + comparison(&((base)[0]), &((base)[1])); \ + } \ } \ } while (0) #endif