From fc4846fbc6ea0c1a7baa3605a24a92aa6cd5e836 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 5 Mar 2013 09:25:45 +0000 Subject: [PATCH] Eo: Changed EO_DBG_INFO_LIST_APPEND to be an inline function. It's cleaner. Should have never been a macro. This is part of the effort of reducing the usage of ({ which is apparently a non standard extension. We can get rid of most of it and ifdef the rest. --- src/lib/eo/Eo.h | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index 0dc6490abf..c596a270e2 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -151,24 +151,23 @@ EAPI extern const Eina_Value_Type *EO_DBG_INFO_TYPE; typedef struct _Eo_Dbg_Info Eo_Dbg_Info; /** - * @def EO_DBG_INFO_LIST_APPEND * Creates a list inside debug info list. - * @param[in] LIST list where to append - * @param[in] NAME name of the list + * @param[in] list list where to append + * @param[in] name name of the list * @return the new list */ -#define EO_DBG_INFO_LIST_APPEND(LIST, NAME) \ -({ \ - Eo_Dbg_Info *List = LIST; \ - Eo_Dbg_Info *Tmp = calloc(1, sizeof(*Tmp)); \ - Tmp->name = eina_stringshare_add(NAME); \ - eina_value_list_setup(&(Tmp->value), EO_DBG_INFO_TYPE); \ - if (List) \ - { \ - eina_value_list_pappend(&(List->value), Tmp); \ - } \ - Tmp; \ -}) +static inline Eo_Dbg_Info * +EO_DBG_INFO_LIST_APPEND(Eo_Dbg_Info *list, const char *name) +{ + Eo_Dbg_Info *tmp = calloc(1, sizeof(*tmp)); + tmp->name = eina_stringshare_add(name); + eina_value_list_setup(&(tmp->value), EO_DBG_INFO_TYPE); + if (list) + { + eina_value_list_pappend(&(list->value), tmp); + } + return tmp; +} /** * @def EO_DBG_INFO_APPEND