summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/eo/eo.c91
1 files changed, 44 insertions, 47 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 89a50f65c9..7fa140660e 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -35,7 +35,6 @@ static void _eo_condtor_reset(_Eo_Object *obj);
35static inline void *_eo_data_scope_get(const _Eo_Object *obj, const _Eo_Class *klass); 35static inline void *_eo_data_scope_get(const _Eo_Object *obj, const _Eo_Class *klass);
36static inline void *_eo_data_xref_internal(const char *file, int line, _Eo_Object *obj, const _Eo_Class *klass, const _Eo_Object *ref_obj); 36static inline void *_eo_data_xref_internal(const char *file, int line, _Eo_Object *obj, const _Eo_Class *klass, const _Eo_Object *ref_obj);
37static inline void _eo_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj); 37static inline void _eo_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj);
38static const _Eo_Class *_eo_op_class_get(Eo_Op op);
39 38
40/* Start of Dich */ 39/* Start of Dich */
41 40
@@ -103,6 +102,30 @@ _dich_func_get(const _Eo_Class *klass, Eo_Op op)
103 return &chain1->funcs[DICH_CHAIN_LAST(op)]; 102 return &chain1->funcs[DICH_CHAIN_LAST(op)];
104} 103}
105 104
105/* XXX: Only used for a debug message below. Doesn't matter that it's slow. */
106static const _Eo_Class *
107_eo_op_class_get(Eo_Op op)
108{
109 _Eo_Class **itr = _eo_classes;
110 int mid, max, min;
111
112 min = 0;
113 max = _eo_classes_last_id - 1;
114 while (min <= max)
115 {
116 mid = (min + max) / 2;
117
118 if (itr[mid]->base_id + itr[mid]->desc->ops.count < op)
119 min = mid + 1;
120 else if (itr[mid]->base_id > op)
121 max = mid - 1;
122 else
123 return itr[mid];
124 }
125
126 return NULL;
127}
128
106static inline Eina_Bool 129static inline Eina_Bool
107_dich_func_set(_Eo_Class *klass, Eo_Op op, eo_op_func_type func) 130_dich_func_set(_Eo_Class *klass, Eo_Op op, eo_op_func_type func)
108{ 131{
@@ -173,30 +196,6 @@ _eo_class_pointer_get(const Eo_Class *klass_id)
173#endif 196#endif
174} 197}
175 198
176static const _Eo_Class *
177_eo_op_class_get(Eo_Op op)
178{
179 /* FIXME: Make it fast. */
180 _Eo_Class **itr = _eo_classes;
181 int mid, max, min;
182
183 min = 0;
184 max = _eo_classes_last_id - 1;
185 while (min <= max)
186 {
187 mid = (min + max) / 2;
188
189 if (itr[mid]->base_id + itr[mid]->desc->ops.count < op)
190 min = mid + 1;
191 else if (itr[mid]->base_id > op)
192 max = mid - 1;
193 else
194 return itr[mid];
195 }
196
197 return NULL;
198}
199
200static const char * 199static const char *
201_eo_op_desc_name_get(const Eo_Op_Description *desc) 200_eo_op_desc_name_get(const Eo_Op_Description *desc)
202{ 201{
@@ -872,31 +871,29 @@ _eo_add_internal_end(Eo *eo_id, Eo_Call_Stack *stack)
872 return NULL; 871 return NULL;
873 } 872 }
874 873
874 if (!fptr->o.obj->condtor_done)
875 { 875 {
876 if (!fptr->o.obj->condtor_done) 876 const _Eo_Class *klass = fptr->o.obj->klass;
877 {
878 const _Eo_Class *klass = fptr->o.obj->klass;
879 877
880 ERR("Object of class '%s' - Not all of the object constructors have been executed.", 878 ERR("Object of class '%s' - Not all of the object constructors have been executed.",
881 klass->desc->name); 879 klass->desc->name);
882 goto cleanup; 880 goto cleanup;
883 } 881 }
884 882
885 if (!eo_id) 883 if (!eo_id)
886 { 884 {
887// XXX: Given EFL usage of objects, construction is a perfectly valid thing 885 // XXX: Given EFL usage of objects, construction is a perfectly valid thing
888// to do. we shouldn't complain about it as handling a NULL obj creation is 886 // to do. we shouldn't complain about it as handling a NULL obj creation is
889// the job of the caller. a perfect example here is ecore_con and ecore_ipc 887 // the job of the caller. a perfect example here is ecore_con and ecore_ipc
890// where you create a con or ipc obj then set up type/destination/port and 888 // where you create a con or ipc obj then set up type/destination/port and
891// the finalize of the constructor does the actual connect and thus this 889 // the finalize of the constructor does the actual connect and thus this
892// fails or succeeds based on if service is there. 890 // fails or succeeds based on if service is there.
893// 891 //
894// until there is a better solution - don't complain here. 892 // until there is a better solution - don't complain here.
895// 893 //
896// ERR("Object of class '%s' - Finalizing the object failed.", 894 // ERR("Object of class '%s' - Finalizing the object failed.",
897// klass->desc->name); 895 // klass->desc->name);
898 goto cleanup; 896 goto cleanup;
899 }
900 } 897 }
901 898
902 fptr->o.obj->finalized = EINA_TRUE; 899 fptr->o.obj->finalized = EINA_TRUE;