From: tasn Date: Thu, 9 Feb 2012 10:32:14 +0000 (+0000) Subject: Eina model: Made i_method_resolve a macro (for interface as well) X-Git-Tag: 2.0_alpha~33^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6734783c34b5f77ef7e639e005867fe77e5a1d96;p=framework%2Fuifw%2Feina.git Eina model: Made i_method_resolve a macro (for interface as well) Same as the previous commit about "Type" this time about Interface. This will also hopefully remove the likelihood for hacks. Previous functions are still available as method_offset_resolve. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@67786 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/include/eina_model.h b/src/include/eina_model.h index ebc3842..9e5aa01 100644 --- a/src/include/eina_model.h +++ b/src/include/eina_model.h @@ -961,9 +961,9 @@ EAPI Eina_Bool eina_model_interface_deep_copy(const Eina_Model_Interface *iface, const Eina_Model *src, Eina_Model *dst) EINA_ARG_NONNULL(1, 2, 3); -EAPI const void *eina_model_interface_method_resolve(const Eina_Model_Interface *iface, - const Eina_Model *model, - unsigned int offset) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT EINA_PURE; +#define eina_model_interface_method_resolve(iface, model, struct_type, method) eina_model_interface_method_offset_resolve((iface), (model), offsetof(struct_type, method)) + +EAPI const void *eina_model_interface_method_offset_resolve(const Eina_Model_Interface *iface, const Eina_Model *model, unsigned int offset) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT EINA_PURE; struct _Eina_Model_Event_Description diff --git a/src/lib/eina_model.c b/src/lib/eina_model.c index 0b986b9..de5de0b 100644 --- a/src/lib/eina_model.c +++ b/src/lib/eina_model.c @@ -4829,8 +4829,8 @@ eina_model_interface_deep_copy(const Eina_Model_Interface *iface, const Eina_Mod return deep_copy(src, dst); } -EAPI const void * -eina_model_interface_method_resolve(const Eina_Model_Interface *iface, const Eina_Model *model, unsigned int offset) +EAPI const void +*eina_model_interface_method_offset_resolve(const Eina_Model_Interface *iface, const Eina_Model *model, unsigned int offset) { EINA_MODEL_INTERFACE_IMPLEMENTED_CHECK_VAL(iface, model, NULL); EINA_SAFETY_ON_FALSE_RETURN_VAL(offset >= sizeof(Eina_Model_Interface), NULL);