From 6dfd7cdc71547e692d67b36df6439c69e8fcd9dd Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 7 May 2024 12:49:17 +0200 Subject: [PATCH] rename find_if_arr -> find_if to avoid name clashes In a later commit, we will use find_if in L2. In the case of building with E2 agent, we link e2_agent which comes with its own implementation of find_if_arr(), which results in a name clash. Rename the OAI implementation, as nothing uses this, anyway. --- common/utils/alg/find.c | 2 +- common/utils/alg/find.h | 2 +- common/utils/ds/tests/test_seq_array.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/utils/alg/find.c b/common/utils/alg/find.c index 1aea32ab88..e3c0e1337c 100644 --- a/common/utils/alg/find.c +++ b/common/utils/alg/find.c @@ -40,7 +40,7 @@ elm_arr_t find_if_arr_it(seq_arr_t* arr, void* start_it, void* end_it, void* val return (elm_arr_t){.found = false, .it = NULL}; } -elm_arr_t find_if_arr(seq_arr_t* arr, void* value, bool (*f)(const void*, const void*)) +elm_arr_t find_if(seq_arr_t* arr, void* value, bool (*f)(const void*, const void*)) { assert(arr != NULL); void* start_it = seq_arr_front(arr); diff --git a/common/utils/alg/find.h b/common/utils/alg/find.h index a8acde169d..2b11a42fd5 100644 --- a/common/utils/alg/find.h +++ b/common/utils/alg/find.h @@ -42,7 +42,7 @@ typedef struct { * @param f Function representing the predicate * @return Whether the predicate was fullfilled and the iterator to the element if true */ -elm_arr_t find_if_arr(seq_arr_t* arr, void* value, bool (*f)(const void* value, const void* it)); +elm_arr_t find_if(seq_arr_t* arr, void* value, bool (*f)(const void* value, const void* it)); /** * @brief Find elements in an array in the semi-open range [start_it, end_it) diff --git a/common/utils/ds/tests/test_seq_array.c b/common/utils/ds/tests/test_seq_array.c index c642c883c7..28a7c98b1e 100644 --- a/common/utils/ds/tests/test_seq_array.c +++ b/common/utils/ds/tests/test_seq_array.c @@ -52,7 +52,7 @@ int main() // Find element in the array int value = 50; - elm_arr_t elm = find_if_arr(&arr, &value, eq_int); + elm_arr_t elm = find_if(&arr, &value, eq_int); assert(elm.found == true); // Check assert(*(int*)elm.it == 50);