gegl r1891 - in trunk: . gegl/buffer gegl/graph



Author: neo
Date: Tue Jan 22 14:41:15 2008
New Revision: 1891
URL: http://svn.gnome.org/viewvc/gegl?rev=1891&view=rev

Log:
2008-01-22  Sven Neumann  <sven gimp org>

	* gegl/graph/gegl-pad.c (gegl_pad_get_depends_on): iterate over
	the list using a (GSList *) iter instead of an integer index.

	* gegl/buffer/gegl-buffer-save.c: count the tiles while adding
	them instead of requesting the list length.


Modified:
   trunk/ChangeLog
   trunk/gegl/buffer/gegl-buffer-save.c
   trunk/gegl/graph/gegl-pad.c

Modified: trunk/gegl/buffer/gegl-buffer-save.c
==============================================================================
--- trunk/gegl/buffer/gegl-buffer-save.c	(original)
+++ trunk/gegl/buffer/gegl-buffer-save.c	Tue Jan 22 14:41:15 2008
@@ -228,7 +228,9 @@
                       tx += info->x_tile_shift / factor;
                       ty += info->y_tile_shift / factor;
 
-                      info->tiles = g_list_prepend (info->tiles, tile_entry_new (tx, ty, z));
+                      info->tiles = g_list_prepend (info->tiles,
+                                                    tile_entry_new (tx, ty, z));
+                      info->header.tile_count++;
                     }
                   bufx += (tile_width - offsetx) * factor;
                 }
@@ -241,7 +243,6 @@
     info->tiles = g_list_reverse (info->tiles);
   }
 
-  info->header.tile_count = g_list_length (info->tiles);
   /* FIXME: sort the index into Z-order */
 
   info->tiles = g_list_sort (info->tiles, z_order_compare);

Modified: trunk/gegl/graph/gegl-pad.c
==============================================================================
--- trunk/gegl/graph/gegl-pad.c	(original)
+++ trunk/gegl/graph/gegl-pad.c	Tue Jan 22 14:41:15 2008
@@ -175,10 +175,10 @@
 
   if (gegl_pad_is_input (self))
     {
-      gint i;
-      for (i = 0; i < g_slist_length (self->connections); i++)
+      GSList *iter;
+      for (iter = self->connections; iter; iter = g_slist_next (iter))
         {
-          GeglConnection *connection = g_slist_nth_data (self->connections, i);
+          GeglConnection *connection = iter->data;
           if (connection)
             {
               depends_on = g_slist_prepend (depends_on,
@@ -196,11 +196,10 @@
       if (!strcmp (gegl_node_get_name (self->node), "proxynop-input"))
         {
           GeglNode *graph = GEGL_NODE (g_object_get_data (G_OBJECT (self->node), "graph"));
-          GSList   *llink = graph->sources;
 
-          for (llink = graph->sources; llink; llink = g_slist_next (llink))
+          for (iter = graph->sources; iter; iter = g_slist_next (iter))
             {
-              GeglConnection *connection = llink->data;
+              GeglConnection *connection = iter->data;
               depends_on = g_slist_prepend (depends_on,
                                             gegl_connection_get_source_pad (connection));
             }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]