I'd say it's good as is, if the other is fewer lines of code, then
better. But please cast to const char*  to avoid possible mistakes and
writing to that pointer.

On Thu, Aug 20, 2009 at 3:18 AM, Vincent Torri<[email protected]> wrote:
>
> here is a patch. Another patch would be to cast when computing the
> delta's. Which one do you prefer ?
>
> Vincent
>
> Index: eina_fixed_bitmap.c
> ===================================================================
> --- eina_fixed_bitmap.c (revision 41856)
> +++ eina_fixed_bitmap.c (working copy)
> @@ -62,8 +62,8 @@
>  _eina_rbtree_inlist_delta(void)
>  {
>     Eina_Fixed_Bitmap_Pool tmp;
> -   void *a = &tmp.__rbtree;
> -   void *b = &tmp.__in_list;
> +   char *a = (char *)&tmp.__rbtree;
> +   char *b = (char *)&tmp.__in_list;
>
>     return a - b;
>  }
> @@ -79,8 +79,8 @@
>  static int
>  _eina_fixed_cmp_key(const Eina_Rbtree *node, const void *key, __UNUSED__
> int length, Eina_Fixed_Bitmap *mp)
>  {
> -   const void *a = node;
> -   const void *b = key;
> +   char *a = (char *)node;
> +   char *b = (char *)key;
>     int delta;
>     int limit;
>
> @@ -146,7 +146,7 @@
>  {
>     Eina_Fixed_Bitmap *mp = data;
>     Eina_Fixed_Bitmap_Pool *pool;
> -   void *a;
> +   char *a;
>     Eina_Bool push_front = EINA_FALSE;
>     int delta;
>
> @@ -156,8 +156,8 @@
>     if (!pool) return ;
>     if (pool->bitmask != 0xFFFFFFFF) push_front = EINA_TRUE;
>
> -   a = pool;
> -   delta = (ptr - a - sizeof (Eina_Fixed_Bitmap_Pool)) / mp->item_size;
> +   a = (char *)pool;
> +   delta = ((char *)ptr - a - sizeof (Eina_Fixed_Bitmap_Pool)) /
> mp->item_size;
>
>     assert(delta >= 0 && delta < 32);
>
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>



-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [email protected]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to