From ee5e2034b99dcf4ca85a9aed7a6d68f84b09fb91 Mon Sep 17 00:00:00 2001 From: Jiyoun Park Date: Thu, 14 Dec 2017 08:21:57 +0900 Subject: [PATCH] eina_list: fix old-style-cast warning opensource changed EINA_LIST_FOREACH to use the c type casting. it cause old-style-cast warning in c++. Change-Id: I4411929d56a7fcbcf85b2109266079d211875426 --- src/lib/eina/eina_list.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/lib/eina/eina_list.h b/src/lib/eina/eina_list.h index 155cd4e..c2010a5 100644 --- a/src/lib/eina/eina_list.h +++ b/src/lib/eina/eina_list.h @@ -1411,6 +1411,8 @@ EAPI int eina_list_data_idx(const Eina_List *list, void *data) * For destructive operations such as this, consider * using EINA_LIST_FOREACH_SAFE(). */ +//TIZEN_ONLY(20171214): fix old-style casting warning in cplusplus +#if !defined(__cplusplus) #define EINA_LIST_FOREACH(list, l, _data)\ for (l = list, \ _data = eina_list_data_get(l), \ @@ -1421,6 +1423,19 @@ EAPI int eina_list_data_idx(const Eina_List *list, void *data) l = eina_list_next(l), \ _data = eina_list_data_get(l), \ l ? (EINA_PREFETCH(((Eina_List *)l)->next), EINA_PREFETCH(_data)) : EINA_PREFETCH(l)) +#else +#define EINA_LIST_FOREACH(list, l, _data)\ + for (l = list, \ + _data = eina_list_data_get(l), \ + l ? (EINA_PREFETCH((static_cast(l))->next), EINA_PREFETCH(_data)) : EINA_PREFETCH(l); \ + \ + l; \ + \ + l = eina_list_next(l), \ + _data = eina_list_data_get(l), \ + l ? (EINA_PREFETCH((static_cast(l))->next), EINA_PREFETCH(_data)) : EINA_PREFETCH(l)) +#endif +// /** * @def EINA_LIST_REVERSE_FOREACH -- 2.7.4