summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@free.fr>2018-05-17 14:08:05 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-24 16:02:20 -0700
commit301340baf688e297fbe57e880f9f75e7d85ea577 (patch)
treee3d2df112bf26011a826df9624eaa33567a98d6f /src/lib/ecore_con
parent13ae5b1f0c711764017bde45e733c6c175650ef6 (diff)
ecore_con: allow for NULL to do nothing.
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/ecore_con_legacy.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/lib/ecore_con/ecore_con_legacy.c b/src/lib/ecore_con/ecore_con_legacy.c
index f5643bb..e4e631c 100644
--- a/src/lib/ecore_con/ecore_con_legacy.c
+++ b/src/lib/ecore_con/ecore_con_legacy.c
@@ -88,15 +88,16 @@ typedef struct _Ecore_Con_Lookup_Ctx {
88} Ecore_Con_Lookup_Ctx; 88} Ecore_Con_Lookup_Ctx;
89 89
90/* allows delete_me to be true */ 90/* allows delete_me to be true */
91#define ECORE_CON_SERVER_CHECK_RELAXED_RETURN(svr, ...) \ 91#define ECORE_CON_SERVER_CHECK_RELAXED_RETURN(svr, ...) \
92 do \ 92 do \
93 { \ 93 { \
94 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER)) \ 94 if (!svr) return __VA_ARGS__; \
95 { \ 95 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER)) \
96 { \
96 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, __FUNCTION__); \ 97 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, __FUNCTION__); \
97 return __VA_ARGS__; \ 98 return __VA_ARGS__; \
98 } \ 99 } \
99 } \ 100 } \
100 while (0) 101 while (0)
101 102
102#define ECORE_CON_SERVER_CHECK_RETURN(svr, ...) \ 103#define ECORE_CON_SERVER_CHECK_RETURN(svr, ...) \
@@ -107,15 +108,16 @@ typedef struct _Ecore_Con_Lookup_Ctx {
107 } \ 108 } \
108 while (0) 109 while (0)
109 110
110#define ECORE_CON_CLIENT_CHECK_RELAXED_RETURN(cl, ...) \ 111#define ECORE_CON_CLIENT_CHECK_RELAXED_RETURN(cl, ...) \
111 do \ 112 do \
112 { \ 113 { \
113 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT)) \ 114 if (!cl) return __VA_ARGS__; \
114 { \ 115 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT)) \
116 { \
115 ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, __FUNCTION__); \ 117 ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, __FUNCTION__); \
116 return __VA_ARGS__; \ 118 return __VA_ARGS__; \
117 } \ 119 } \
118 } \ 120 } \
119 while (0) 121 while (0)
120 122
121#define ECORE_CON_CLIENT_CHECK_RETURN(cl, ...) \ 123#define ECORE_CON_CLIENT_CHECK_RETURN(cl, ...) \