Thanks Tom. 

But  I have one more question about the second. 

It looks that it uses dst without  allocating anything. 

Doesn't it?

And why it  execute this line ?
 *dst = CONVERT_ARGB_8888_TO_A_8(*src);  //Ok, This can be done. 

even dst never refered by anywhere...

It seems that dst should be changed to ret. 

How do you think about this?
-------------------------------------------------------------------------------------------------------------------
//evas/src/lib/engines/common/evas_convert_colorspace.c 
static inline void *
evas_common_convert_argb8888_to_a8(void *data, int w, int h, int stride,
Eina_Bool has_alpha)
{
   uint32_t *src, *end;
   uint8_t *ret, *dst;

   src = data;
   end = src + (stride * h); 
   ret = malloc(w * h); 

   if (!has_alpha)
     {   
        return memset(ret,0xff, w * h); 
     }   

   for ( ; src < end ; src ++, dst ++)  // what does dst++ purpose for ?
      *dst = CONVERT_ARGB_8888_TO_A_8(*src);  //Ok, This can be done. 
   return ret;
}





------- Original Message -------
Sender : Tom Hacohen<tom.haco...@partner.samsung.com> Engineer/STRI-SLP RTL 
Language supporting/????
Date : 2011-02-14 20:32 (GMT+09:00)
Title : Re: [E-devel] Question about evas source code.

Hey Hermet,

>    if ((p[i] == '-') || (m == 256))      // 256 ? 
>      {
>         dest[n][m] = 0;              // If the m is 256 then it will be out
> of boundary. 
>                                      // Or if the m will never be more than
> 256, then we don't need to compare "m == 256"
Looks like either a typo, or just someone overlooking something, no idea
really.

> ----------------------------------------------------------------------------
> ------------------------------------------
> Second is here. It's not critical but looks strange. 
>    for ( ; src < end ; src ++, dst ++)  // what does dst++ purpose for ?
>       *dst = CONVERT_ARGB_8888_TO_A_8(*src);  //Ok, This can be done. 

This is actually pretty common in the C world. It advances both the src
and the dst by one each time and thus copying all the cells of the array
one by one.

--
Tom.
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to