From f8a1832fce02d5eff13d9f643a9c195c3a5199bc Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Thu, 27 Jul 2017 22:19:27 +0200 Subject: [PATCH] Fix conflict between the specialized version of sort in array and the generic version in algo so that we can use the same prefix for both generation. --- bench/bench-mlib.c | 4 ++-- m-array.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bench/bench-mlib.c b/bench/bench-mlib.c index 3b916ff9..df9d1b0e 100644 --- a/bench/bench-mlib.c +++ b/bench/bench-mlib.c @@ -248,7 +248,7 @@ test_dict_str(unsigned long n) /********************************************************************************************/ ARRAY_DEF(array_float, float) -ALGO_DEF(afloat, ARRAY_OPLIST(array_float)) +ALGO_DEF(array_float, ARRAY_OPLIST(array_float)) static void test_sort(size_t n) { @@ -256,7 +256,7 @@ static void test_sort(size_t n) for(size_t i = 0; i < n; i++) { array_float_push_back(a1, rand_get() ); } - afloat_sort(a1); + array_float_sort(a1); g_result = *array_float_get(a1, 0); } } diff --git a/m-array.h b/m-array.h index c2362540..42fdf843 100644 --- a/m-array.h +++ b/m-array.h @@ -76,7 +76,7 @@ ,PUSH(M_C(name,_push_back)) \ ,POP(M_C(name,_pop_back)) \ ,OPLIST(oplist) \ - ,M_IF_METHOD(CMP, oplist)(SORT(M_C(name, _sort)),) \ + ,M_IF_METHOD(CMP, oplist)(SORT(M_C(name, _special_sort)),) \ ,M_IF_METHOD(GET_STR, oplist)(GET_STR(M_C(name, _get_str)),) \ ,M_IF_METHOD(OUT_STR, oplist)(OUT_STR(M_C(name, _out_str)),) \ ,M_IF_METHOD(IN_STR, oplist)(IN_STR(M_C(name, _in_str)),) \ @@ -607,7 +607,7 @@ \ M_IF_METHOD(CMP, oplist) \ ( \ - static inline void M_C(name, _sort)(array_t l, \ + static inline void M_C(name, _special_sort)(array_t l, \ int (*func_type) (const type *a, const type *b)) \ { \ /* Using qsort is more compact but slower than a full templated \