[gegl/newiter] iterator: code review cleanup



commit 22fcca04eeaf6eac37ce5f64bd9ce5adf907857d
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Tue Sep 10 16:12:22 2013 -0700

    iterator: code review cleanup

 gegl/buffer/gegl-buffer-iterator.c |   12 ++++++------
 gegl/buffer/gegl-buffer-iterator.h |    2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-iterator.c b/gegl/buffer/gegl-buffer-iterator.c
index fdfda20..844f4b0 100644
--- a/gegl/buffer/gegl-buffer-iterator.c
+++ b/gegl/buffer/gegl-buffer-iterator.c
@@ -36,14 +36,14 @@
 
 #define GEGL_ITERATOR_INCOMPATIBLE (1 << 2)
 
-typedef enum _GeglIteratorState {
+typedef enum {
   GeglIteratorState_Start,
   GeglIteratorState_InTile,
   GeglIteratorState_InRows,
   GeglIteratorState_Invalid,
 } GeglIteratorState;
 
-typedef enum _GeglIteratorTileMode {
+typedef enum {
   GeglIteratorTileMode_Invalid,
   GeglIteratorTileMode_DirectTile,
   GeglIteratorTileMode_LinearTile,
@@ -114,13 +114,14 @@ gegl_buffer_iterator_add (GeglBufferIterator           *iter,
                           unsigned int         flags,
                           GeglAbyssPolicy      abyss_policy)
 {
+  int                     index;
   GeglBufferIteratorPriv *priv = iter->priv;
 
-  int index = priv->num_buffers++;
+  g_return_val_if_fail (priv->num_buffers < GEGL_BUFFER_MAX_ITERATORS, 0);
 
-  SubIterState *sub = &priv->sub_iter[index];
+  index = priv->num_buffers++;
 
-  g_return_val_if_fail (priv->num_buffers <= GEGL_BUFFER_MAX_ITERATORS, 0);
+  SubIterState *sub = &priv->sub_iter[index];
 
   if (!format)
     format = gegl_buffer_get_format (buf);
@@ -418,7 +419,6 @@ prepare_iteration (GeglBufferIterator *iter)
           (priv->origin_tile.height != buf->tile_height))
         {
           /* Check if the buffer is a linear buffer */
-          // (g_object_get_data (G_OBJECT (buf), "is-linear"))
           if ((buf->extent.x      == -buf->shift_x) &&
               (buf->extent.y      == -buf->shift_y) &&
               (buf->extent.width  == buf->tile_width) &&
diff --git a/gegl/buffer/gegl-buffer-iterator.h b/gegl/buffer/gegl-buffer-iterator.h
index 636900f..9954971 100644
--- a/gegl/buffer/gegl-buffer-iterator.h
+++ b/gegl/buffer/gegl-buffer-iterator.h
@@ -1,5 +1,4 @@
 /* This file is part of GEGL.
- * ck
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -15,6 +14,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright 2008 Øyvind Kolås <pippin gimp org>
+ *           2013 Daniel Sabo
  */
 
 #ifndef __GEGL_BUFFER_ITERATOR_H__


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