tasn pushed a commit to branch master.
commit fc4846fbc6ea0c1a7baa3605a24a92aa6cd5e836
Author: Tom Hacohen <[email protected]>
Date: Tue Mar 5 09:25:45 2013 +0000
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 0dc6490..c596a27 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
--
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb