Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/ecore

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


Modified Files:
        ecore_x_netwm.c 


Log Message:


actually just handle datatype properly.

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore_x_netwm.c     23 Jul 2008 20:58:47 -0000      1.2
+++ ecore_x_netwm.c     23 Jul 2008 21:01:36 -0000      1.3
@@ -847,9 +847,10 @@
 EAPI int
 ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
 {
-   int                  num, i, j, numret;
-   Ecore_X_Atom        *atoms = NULL, *atoms2 = NULL;
-
+   int                  num, i;
+   Ecore_X_Atom        *atoms = NULL;
+   Ecore_X_Window_Type *atoms2 = NULL;
+   
    if (types) *types = NULL;
    num = ecore_x_window_prop_atom_list_get(win,
                                           ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
@@ -859,27 +860,14 @@
        if (atoms) free(atoms);
        return 0;
      }
-   numret = 0;
-   for (i = 0; i < num; i++)
-     {
-       atoms[i] = _ecore_x_netwm_window_type_type_get(atoms[i]);
-       if (atoms[i] != 0) numret++;
-     }
-   if (numret == 0) return 0;
-   atoms2 = malloc(numret * sizeof(Ecore_X_Window_Type));
+   atoms2 = malloc(num * sizeof(Ecore_X_Window_Type));
    if (!atoms2) return 0;
-   for (j = 0, i = 0; i < num; i++)
-     {
-        if (atoms[i] != 0)
-         {
-            atoms2[j] = atoms[i];
-            j++;
-         }
-     }
+   for (i = 0; i < num; i++)
+     atoms2[i] = _ecore_x_netwm_window_type_type_get(atoms[i]);
    free(atoms);
    if (types) *types = atoms2;
    else free(atoms2);
-   return numret;
+   return num;
 }
 
 static Ecore_X_Atom



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to