[Pkg-e-commits] [SCM] Enlightenment DR17 graphical layout and animation library branch, upstream-vcs, updated. f5b4e4555670cc3b4a24802eb44d7d47c379bee4

raster raster at alioth.debian.org
Fri May 23 22:08:34 UTC 2008


The following commit has been merged in the upstream-vcs branch:
commit 5de86538c5e062271e4f884e824d77dfee8eab04
Author: raster <raster>
Date:   Thu Apr 17 01:13:48 2008 +0000

    fix valgrind warning in match code

diff --git a/src/lib/edje_match.c b/src/lib/edje_match.c
index b398e5d..273d2ac 100644
--- a/src/lib/edje_match.c
+++ b/src/lib/edje_match.c
@@ -68,7 +68,7 @@ _edje_match_states_alloc(Edje_Patterns *ppat, int n)
    ALIGN(struct_size);
    struct_size += states_has_size;
 
-   l = malloc(n * struct_size);
+   l = calloc(1, n * struct_size);
    if (!l) return 0;
 
    ppat->states = l;
@@ -92,19 +92,21 @@ _edje_match_states_insert(Edje_States    *list,
                           size_t          idx,
                           size_t          pos)
 {
-   {
-      const size_t i = idx * (patterns_max_length + 1) + pos;
-
-      if (list->size > i && list->has[i]) return;
-      list->has[i] = 1;
-   }
-
-   const size_t i = list->size;
+   size_t i;
 
+   i = (idx * (patterns_max_length + 1)) + pos;
+   
+   if (list->size > i)
+     {
+	if (list->has[i]) return;
+     }
+   list->has[i] = 1;
+   
+   i = list->size;
    list->states[i].idx = idx;
    list->states[i].pos = pos;
    list->has[i] = 0;
-   ++list->size;
+   list->size++;
 }
 
 static void
@@ -118,11 +120,11 @@ _edje_match_states_clear(Edje_States     *list,
 /* Token manipulation. */
 
 enum status
-  {
-    patterns_not_found		= 0,
-    patterns_found		= 1,
-    patterns_syntax_error	= 2
-  };
+{
+   patterns_not_found		= 0,
+   patterns_found		= 1,
+   patterns_syntax_error	= 2
+};
 
 static size_t
 _edje_match_patterns_exec_class_token(enum status	*status,

-- 
Enlightenment DR17 graphical layout and animation library



More information about the Pkg-e-commits mailing list