From: Jean-Philippe Andre Date: Tue, 17 Jan 2017 05:07:45 +0000 (+0900) Subject: eina: Remove EAPI eina_freeq_main_set() X-Git-Tag: upstream/1.20.0~2436 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ffbc0645e57d7cad01e5c11044bcb8c7688c6e27;p=platform%2Fupstream%2Fefl.git eina: Remove EAPI eina_freeq_main_set() I believe this function is not required and should not be used by applications. If there is a very good use case to use your own main freeq, then the API could be added again. For now, removing the set() is probably the safer option. Note: the API was introduced in the upcoming 1.19 --- diff --git a/src/lib/eina/eina_freeq.c b/src/lib/eina/eina_freeq.c index 0485501..898e8c9 100644 --- a/src/lib/eina/eina_freeq.c +++ b/src/lib/eina/eina_freeq.c @@ -254,8 +254,7 @@ eina_freeq_type_get(Eina_FreeQ *fq) return EINA_FREEQ_DEFAULT; } -/* FIXME This function should not exist as an EAPI */ -EAPI void +void eina_freeq_main_set(Eina_FreeQ *fq) { if (!fq) return; diff --git a/src/lib/eina/eina_freeq.h b/src/lib/eina/eina_freeq.h index 7b34669..e6fed41 100644 --- a/src/lib/eina/eina_freeq.h +++ b/src/lib/eina/eina_freeq.h @@ -150,16 +150,6 @@ EAPI Eina_FreeQ_Type eina_freeq_type_get(Eina_FreeQ *fq); /** - * @brief Set the main free queue driven by the EFL mainloop. - * - * @param fq The free queue to set as the main loop one. - * - * @since 1.19 - */ -EAPI void -eina_freeq_main_set(Eina_FreeQ *fq); - -/** * @brief Get the main loop free queue. * * @return The main loop free queue. diff --git a/src/lib/eina/eina_private.h b/src/lib/eina/eina_private.h index 810e4b2..d032f84 100644 --- a/src/lib/eina/eina_private.h +++ b/src/lib/eina/eina_private.h @@ -138,6 +138,12 @@ void eina_cpu_count_internal(void); void eina_file_mmap_faulty(void *addr, long page_size); +#ifndef EINA_FREEQ_H_ +typedef struct _Eina_FreeQ Eina_FreeQ; +#endif + +void eina_freeq_main_set(Eina_FreeQ *fq); + #include "eina_inline_private.h" #endif /* EINA_PRIVATE_H_ */ diff --git a/src/tests/eina/eina_test_freeq.c b/src/tests/eina/eina_test_freeq.c index c1d050a..8cd0eed 100644 --- a/src/tests/eina/eina_test_freeq.c +++ b/src/tests/eina/eina_test_freeq.c @@ -8,23 +8,25 @@ START_TEST(freeq_simple) { - Eina_FreeQ *fq, *pfq; + Eina_FreeQ *fq; + int *p; eina_init(); - fail_if(eina_freeq_main_get() == NULL); - pfq = eina_freeq_main_get(); - fail_if(eina_freeq_type_get(pfq) != EINA_FREEQ_DEFAULT); + fq = eina_freeq_main_get(); + fail_if(fq == NULL); + fail_if(eina_freeq_type_get(fq) != EINA_FREEQ_DEFAULT); + + p = malloc(sizeof(int)); + *p = 42; + eina_freeq_ptr_main_add(p, NULL, sizeof(int)); + eina_freeq_clear(fq); + fail_if(eina_freeq_ptr_pending(eina_freeq_main_get())); fq = eina_freeq_new(EINA_FREEQ_DEFAULT); fail_if(!fq); - eina_freeq_main_set(fq); - fail_if(eina_freeq_main_get() != fq); - eina_freeq_free(fq); - fail_if(eina_freeq_main_get() != NULL); - eina_freeq_main_set(pfq); eina_shutdown(); }