diff options
author | Cedric BAIL <cedric@osg.samsung.com> | 2016-08-26 12:01:52 -0700 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2016-08-26 12:14:14 -0700 |
commit | 5e67a80753c4cc0a33dfaba008c098e07acfadfa (patch) | |
tree | 7418925cd9e6a83ff8e6de10ea34f7ac9b02c270 | |
parent | 8356b16a49d4f653d61940763eff947466b44e24 (diff) |
eo: remove useless duplicated check.
-rw-r--r-- | src/lib/eo/eo_ptr_indirection.h | 70 |
1 files changed, 28 insertions, 42 deletions
diff --git a/src/lib/eo/eo_ptr_indirection.h b/src/lib/eo/eo_ptr_indirection.h index d7f6dd3b15..8cad652acc 100644 --- a/src/lib/eo/eo_ptr_indirection.h +++ b/src/lib/eo/eo_ptr_indirection.h | |||
@@ -13,42 +13,29 @@ void _eo_pointer_error(const char *msg); | |||
13 | #define _EO_POINTER_ERR(fmt, ptr) \ | 13 | #define _EO_POINTER_ERR(fmt, ptr) \ |
14 | do { char buf[256]; sprintf(buf, fmt, ptr); _eo_pointer_error(buf); } while (0) | 14 | do { char buf[256]; sprintf(buf, fmt, ptr); _eo_pointer_error(buf); } while (0) |
15 | 15 | ||
16 | #define EO_OBJ_POINTER(obj_id, obj) \ | 16 | #define EO_OBJ_POINTER(obj_id, obj) \ |
17 | _Eo_Object *obj = NULL; \ | 17 | _Eo_Object *obj = NULL; \ |
18 | do { \ | 18 | do { \ |
19 | if (!obj_id) break; \ | 19 | obj = _eo_obj_pointer_get((Eo_Id)obj_id); \ |
20 | obj = _eo_obj_pointer_get((Eo_Id)obj_id); \ | 20 | } while (0) |
21 | if (!obj) { \ | 21 | |
22 | _EO_POINTER_ERR("Obj (%p) is an invalid ref.", obj_id); \ | 22 | #define EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, ret) \ |
23 | } \ | 23 | _Eo_Object *obj; \ |
24 | } while (0) | 24 | do { \ |
25 | 25 | obj = _eo_obj_pointer_get((Eo_Id)obj_id); \ | |
26 | #define EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, ret) \ | 26 | if (!obj) return (ret); \ |
27 | _Eo_Object *obj; \ | 27 | } while (0) |
28 | do { \ | 28 | |
29 | if (!obj_id) return ret; \ | 29 | #define EO_OBJ_POINTER_RETURN(obj_id, obj) \ |
30 | obj = _eo_obj_pointer_get((Eo_Id)obj_id); \ | 30 | _Eo_Object *obj; \ |
31 | if (!obj) { \ | 31 | do { \ |
32 | _EO_POINTER_ERR("Obj (%p) is an invalid ref.", obj_id); \ | 32 | obj = _eo_obj_pointer_get((Eo_Id)obj_id); \ |
33 | return ret; \ | 33 | if (!obj) return; \ |
34 | } \ | 34 | } while (0) |
35 | } while (0) | ||
36 | |||
37 | #define EO_OBJ_POINTER_RETURN(obj_id, obj) \ | ||
38 | _Eo_Object *obj; \ | ||
39 | do { \ | ||
40 | if (!obj_id) return; \ | ||
41 | obj = _eo_obj_pointer_get((Eo_Id)obj_id); \ | ||
42 | if (!obj) { \ | ||
43 | _EO_POINTER_ERR("Obj (%p) is an invalid ref.", obj_id); \ | ||
44 | return; \ | ||
45 | } \ | ||
46 | } while (0) | ||
47 | 35 | ||
48 | #define EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, ret) \ | 36 | #define EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, ret) \ |
49 | _Efl_Class *klass; \ | 37 | _Efl_Class *klass; \ |
50 | do { \ | 38 | do { \ |
51 | if (!klass_id) return ret; \ | ||
52 | klass = _eo_class_pointer_get(klass_id); \ | 39 | klass = _eo_class_pointer_get(klass_id); \ |
53 | if (!klass) { \ | 40 | if (!klass) { \ |
54 | _EO_POINTER_ERR("Class (%p) is an invalid ref.", klass_id); \ | 41 | _EO_POINTER_ERR("Class (%p) is an invalid ref.", klass_id); \ |
@@ -59,7 +46,6 @@ void _eo_pointer_error(const char *msg); | |||
59 | #define EO_CLASS_POINTER_RETURN(klass_id, klass) \ | 46 | #define EO_CLASS_POINTER_RETURN(klass_id, klass) \ |
60 | _Efl_Class *klass; \ | 47 | _Efl_Class *klass; \ |
61 | do { \ | 48 | do { \ |
62 | if (!klass_id) return; \ | ||
63 | klass = _eo_class_pointer_get(klass_id); \ | 49 | klass = _eo_class_pointer_get(klass_id); \ |
64 | if (!klass) { \ | 50 | if (!klass) { \ |
65 | _EO_POINTER_ERR("Class (%p) is an invalid ref.", klass_id); \ | 51 | _EO_POINTER_ERR("Class (%p) is an invalid ref.", klass_id); \ |
@@ -69,15 +55,15 @@ void _eo_pointer_error(const char *msg); | |||
69 | 55 | ||
70 | #else | 56 | #else |
71 | 57 | ||
72 | #define EO_OBJ_POINTER(obj_id, obj) \ | 58 | #define EO_OBJ_POINTER(obj_id, obj) \ |
73 | _Eo_Object *obj = NULL; \ | 59 | _Eo_Object *obj = NULL; \ |
74 | do { \ | 60 | do { \ |
75 | if (!obj_id) break; \ | 61 | obj = _eo_obj_pointer_get((Eo_Id)obj_id); \ |
76 | obj = _eo_obj_pointer_get((Eo_Id)obj_id); \ | 62 | if (obj && \ |
77 | if (!EINA_MAGIC_CHECK((Eo_Header *) obj, EO_EINA_MAGIC)) { \ | 63 | !EINA_MAGIC_CHECK((Eo_Header *) obj, EO_EINA_MAGIC)) { \ |
78 | EINA_MAGIC_FAIL((Eo_Header *) obj, EO_EINA_MAGIC); \ | 64 | EINA_MAGIC_FAIL((Eo_Header *) obj, EO_EINA_MAGIC); \ |
79 | } \ | 65 | } \ |
80 | } while (0) | 66 | } while (0) |
81 | 67 | ||
82 | #define EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, ret) \ | 68 | #define EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, ret) \ |
83 | _Eo_Object *obj; \ | 69 | _Eo_Object *obj; \ |