From: Douglas Bagnall Date: Wed, 3 Apr 2024 02:47:10 +0000 (+1300) Subject: util:binsearch: user NUMERIC_CMP() X-Git-Tag: tdb-1.4.11~1174 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09c98ff1263eb05933f1956e201655dd41e28a0c;p=thirdparty%2Fsamba.git util:binsearch: user NUMERIC_CMP() BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625 Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/lib/util/tests/binsearch.c b/lib/util/tests/binsearch.c index b3ecda165f3..24840156c73 100644 --- a/lib/util/tests/binsearch.c +++ b/lib/util/tests/binsearch.c @@ -23,17 +23,19 @@ #include "includes.h" #include "lib/util/binsearch.h" +#include "lib/util/tsort.h" #include "torture/torture.h" #include "torture/local/proto.h" static int int_cmp(int a, int b) { - return a - b; + return NUMERIC_CMP(a, b); } static int int_cmp_p(int a, int *b) { - return a - *b; + int _b = *b; + return NUMERIC_CMP(a, _b); } static bool test_binsearch_v(struct torture_context *tctx)