@Eo guys,

On Wed, Apr 8, 2015 at 3:25 PM, Conrad Meyer <jp.an...@samsung.com> wrote:

> jpeg pushed a commit to branch master.
>
>
> http://git.enlightenment.org/core/efl.git/commit/?id=0c21b91f0fe5dd61080aaba7902907837d842c26
>
> commit 0c21b91f0fe5dd61080aaba7902907837d842c26
> Author: Conrad Meyer <jp.an...@samsung.com>
> Date:   Wed Apr 8 14:34:46 2015 +0900
>
>     Edje: Remove excessive casts and use type Edje_Object
>
>     Use type Edje_Object instead of Eo in legacy EAPI's.


I saw lots of inconsistent type usage when going through Evas legacy
headers.
Do we want to use stronger type names? I.e.:

Evas_Image for evas_object_image functions,
Evas_Object for generic evas_object functions,
And Eo only as a last resort?

I spotted those in the ABI report.


>
>     Spotted in TAsn's ABI report, under "Problems with Symbols".
>     I believe this will actually add two changes (Eo -> Edje_Object),
>     but I like the typing better ;)
> ---
>  src/lib/edje/Edje_Common.h |  2 ++
>  src/lib/edje/Edje_Legacy.h |  6 +++---
>  src/lib/edje/edje_smart.c  | 10 +++++-----
>  3 files changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/src/lib/edje/Edje_Common.h b/src/lib/edje/Edje_Common.h
> index de4861d..ecacc73 100644
> --- a/src/lib/edje/Edje_Common.h
> +++ b/src/lib/edje/Edje_Common.h
> @@ -16,6 +16,8 @@ typedef struct _Edje_Version
>
>  EAPI extern Edje_Version *edje_version;
>
> +typedef Eo Edje_Object;
> +
>  /**
>   * @typedef Edje_Color_Class
>   * Type for edje color class
> diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h
> index e5e9800..be1f06d 100644
> --- a/src/lib/edje/Edje_Legacy.h
> +++ b/src/lib/edje/Edje_Legacy.h
> @@ -189,7 +189,7 @@ EAPI void         edje_extern_object_aspect_set
>  (Evas_Object *obj, Edje_Aspect
>   * @param[in] group The name of the group, in @p file, which implements an
>  Edje object
>   */
> -EAPI Eina_Bool edje_object_file_set(Eo *obj, const char *file, const char
> *group);
> +EAPI Eina_Bool edje_object_file_set(Edje_Object *obj, const char *file,
> const char *group);
>
>  /**
>   *
> @@ -210,7 +210,7 @@ EAPI Eina_Bool edje_object_file_set(Eo *obj, const
> char *file, const char *group
>   * @param[out] group The name of the group, in @p file, which implements
> an
>  Edje object
>   */
> -EAPI void edje_object_file_get(const Eo *obj, const char **file, const
> char **group);
> +EAPI void edje_object_file_get(const Edje_Object *obj, const char **file,
> const char **group);
>
>
>  /**
> @@ -246,7 +246,7 @@ EAPI void edje_object_file_get(const Eo *obj, const
> char **file, const char **gr
>   * @param[in] group The name of the group, in @p file, which implements an
>  Edje object
>   */
> -EAPI Eina_Bool edje_object_mmap_set(Eo *obj, const Eina_File *file, const
> char *group);
> +EAPI Eina_Bool edje_object_mmap_set(Edje_Object *obj, const Eina_File
> *file, const char *group);
>
>
>  #include "edje_object.eo.legacy.h"
> diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
> index 0bf8399..97d31b2 100644
> --- a/src/lib/edje/edje_smart.c
> +++ b/src/lib/edje/edje_smart.c
> @@ -369,21 +369,21 @@ edje_object_mmap_set(Edje_Object *obj, const
> Eina_File *file, const char *group)
>  {
>     Eina_Bool ret;
>
> -   return eo_do_ret((Edje_Object *)obj, ret, efl_file_mmap_set(file,
> group));
> +   return eo_do_ret(obj, ret, efl_file_mmap_set(file, group));
>  }
>
>  EAPI Eina_Bool
> -edje_object_file_set(Eo *obj, const char *file, const char *group)
> +edje_object_file_set(Edje_Object *obj, const char *file, const char
> *group)
>  {
>     Eina_Bool ret = 0;
> -   eo_do((Eo *) obj, ret = efl_file_set(file, group));
> +   eo_do(obj, ret = efl_file_set(file, group));
>     return ret;
>  }
>
>  EAPI void
> -edje_object_file_get(const Eo *obj, const char **file, const char **group)
> +edje_object_file_get(const Edje_Object *obj, const char **file, const
> char **group)
>  {
> -   eo_do((Eo *) obj, efl_file_get(file, group));
> +   eo_do((Edje_Object *) obj, efl_file_get(file, group));
>  }
>
>  #include "edje_object.eo.c"
>
> --
>
>
ps: Sorry Conrad that I used your name. my mistake

> --
> Jean-Philippe André
>
>
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to