Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_x


Modified Files:
        ecore_x_netwm.c 


Log Message:


handle NULL data ret - and we can just memcpy - the netwm spec matches
imlib2/evas ARGB pixel format.x

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_netwm.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ecore_x_netwm.c     2 Jun 2005 20:14:13 -0000       1.19
+++ ecore_x_netwm.c     3 Jun 2005 01:18:58 -0000       1.20
@@ -756,12 +756,12 @@
    return 1;
 }
 
-/* FIXME: safe to use unsigned int? Maybe uin32_t? */
 int
 ecore_x_netwm_icon_get(Ecore_X_Window win, int *width, int *height, unsigned 
int **data, int *num)
 {
-   unsigned char *data_ret, *src, *dst;
-   int            num_ret, pos, len;
+   unsigned char *data_ret;
+   unsigned int  *src;
+   int            num_ret, len;
 
    if (width) *width = 0;
    if (height) *height = 0;
@@ -771,8 +771,11 @@
                                         XA_CARDINAL, 32, &data_ret, &num_ret))
      return 0;
 
-   *data = malloc((num_ret - 2) * sizeof(unsigned int));
-   if (!(*data)) return 0;
+   if (data)
+     {
+       *data = malloc((num_ret - 2) * sizeof(unsigned int));
+       if (!(*data)) return 0;
+     }
 
    if (num) *num = (num_ret - 2);
    if (width) *width = ((unsigned int *)data_ret)[0];
@@ -780,16 +783,8 @@
 
    len = ((unsigned int *)data_ret)[0] * ((unsigned int *)data_ret)[1];
    src = &(((unsigned int *)data_ret)[2]);
-   dst = *data;
-   for (pos = 0; pos < len; ++pos, src += 4, dst += 4)
-     {
-       /* FIXME: Hm, seems firefox does this wrong! */
-       dst[0] = src[0]; /* R */
-       dst[1] = src[1]; /* G */
-       dst[2] = src[2]; /* B */
-       dst[3] = src[3]; /* A */
-     }
-
+   if (data)
+     memcpy(*data, &(data_ret[2]), len * sizeof(unsigned int));
    free(data_ret);
 
    return 1;




-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to