]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ldb: don't call comparison() directly in LDB_TYPESAFE_QSORT
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 21 Oct 2022 01:17:30 +0000 (14:17 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 21 Oct 2022 03:57:33 +0000 (03:57 +0000)
The result is not used, it is only part of the macro to gain
type-checking.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/ldb/include/ldb.h

index 1b3021b0fba8a9413a17ee0471ca25f32db268a6..68cbfdb6f7a376fb41224908908a5a10a8a84fcd 100644 (file)
@@ -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