[gtk+] Fix compilation warning: move function to proper location



commit 5bcf3ba72a7d54625b3996cefb05dba0aae6da42
Author: Javier Jardón <jjardon gnome org>
Date:   Mon Apr 12 21:22:34 2010 +0200

    Fix compilation warning: move function to proper location
    
    Move _count_nodes() auxiliar function inside the
    G_ENABLE_DEBUG define, where other auxiliar functions are.

 gtk/gtkrbtree.c |   42 ++++++++++++++++++++----------------------
 1 files changed, 20 insertions(+), 22 deletions(-)
---
diff --git a/gtk/gtkrbtree.c b/gtk/gtkrbtree.c
index 207c2a8..c33a9ed 100644
--- a/gtk/gtkrbtree.c
+++ b/gtk/gtkrbtree.c
@@ -33,8 +33,6 @@ static void        _gtk_rbtree_insert_fixup       (GtkRBTree  *tree,
 						   GtkRBNode  *node);
 static void        _gtk_rbtree_remove_node_fixup  (GtkRBTree  *tree,
 						   GtkRBNode  *node);
-static gint        _count_nodes                   (GtkRBTree  *tree,
-						   GtkRBNode  *node);
 static inline void _fixup_validation              (GtkRBTree  *tree,
 						   GtkRBNode  *node);
 static inline void _fixup_parity                  (GtkRBTree  *tree,
@@ -1469,25 +1467,6 @@ _gtk_rbtree_traverse (GtkRBTree             *tree,
     }
 }
 
-static gint
-_count_nodes (GtkRBTree *tree,
-	      GtkRBNode *node)
-{
-  gint res;
-  if (node == tree->nil)
-    return 0;
-
-  g_assert (node->left);
-  g_assert (node->right);
-  
-  res = (_count_nodes (tree, node->left) +
-	 _count_nodes (tree, node->right) + 1);
-
-  if (res != node->count)
-    g_print ("Tree failed\n");
-  return res;
-}
-
 static inline
 void _fixup_validation (GtkRBTree *tree,
 			GtkRBNode *node)
@@ -1572,6 +1551,25 @@ count_parity (GtkRBTree *tree,
   return res;
 }
 
+static gint
+_count_nodes (GtkRBTree *tree,
+              GtkRBNode *node)
+{
+  gint res;
+  if (node == tree->nil)
+    return 0;
+
+  g_assert (node->left);
+  g_assert (node->right);
+
+  res = (_count_nodes (tree, node->left) +
+         _count_nodes (tree, node->right) + 1);
+
+  if (res != node->count)
+    g_print ("Tree failed\n");
+  return res;
+}
+
 static void
 _gtk_rbtree_test_height (GtkRBTree *tree,
                          GtkRBNode *node)
@@ -1677,7 +1675,7 @@ _gtk_rbtree_test_structure (GtkRBTree *tree)
   g_assert (tree->root->parent == tree->nil);
   _gtk_rbtree_test_structure_helper (tree, tree->root);
 }
-			    
+
 void
 _gtk_rbtree_test (const gchar *where,
                   GtkRBTree   *tree)



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