Fix compilation warning: move function to proper location

Move _count_nodes() auxiliar function inside the
G_ENABLE_DEBUG define, where other auxiliar functions are.
This commit is contained in:
Javier Jardón 2010-04-12 21:22:34 +02:00
parent 3e5d49f52b
commit 5bcf3ba72a

View File

@ -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)