Remove redundant header inclusions

and some whitespace cleanup.
This commit is contained in:
Matthias Clasen 2010-09-03 20:27:45 -04:00
parent 8f81ee86ee
commit 3e2f1e3825

View File

@ -20,8 +20,10 @@
#include "config.h"
#include "glib.h"
#include "gsequence.h"
#include "gmem.h"
#include "gtestutils.h"
/**
* SECTION: sequence
* @title: Sequences
@ -106,7 +108,7 @@ struct _GSequence
* sort/sort_changed/search_iter() functions call out to the application
* g_sequence_iter_get_sequence() will return the correct sequence.
*/
GSequence * real_sequence;
GSequence * real_sequence;
};
struct _GSequenceNode
@ -144,7 +146,7 @@ static void node_insert_before (GSequenceNode *node,
GSequenceNode *new);
static void node_unlink (GSequenceNode *node);
static void node_join (GSequenceNode *left,
GSequenceNode *right);
GSequenceNode *right);
static void node_insert_sorted (GSequenceNode *node,
GSequenceNode *new,
GSequenceNode *end,
@ -631,7 +633,7 @@ g_sequence_move_range (GSequenceIter *dest,
node_join (begin, dest);
if (dest != first)
node_join (first, begin);
node_join (first, begin);
}
else
{
@ -821,7 +823,7 @@ g_sequence_sort_iter (GSequence *seq,
GSequenceNode *node = g_sequence_get_begin_iter (tmp);
node_insert_sorted (seq->end_node, node, seq->end_node,
cmp_func, cmp_data);
cmp_func, cmp_data);
}
tmp->access_prohibited = FALSE;
@ -912,9 +914,9 @@ g_sequence_sort_changed_iter (GSequenceIter *iter,
**/
GSequenceIter *
g_sequence_insert_sorted_iter (GSequence *seq,
gpointer data,
GSequenceIterCompareFunc iter_cmp,
gpointer cmp_data)
gpointer data,
GSequenceIterCompareFunc iter_cmp,
gpointer cmp_data)
{
GSequenceNode *new_node;
GSequence *tmp_seq;
@ -1460,17 +1462,17 @@ node_get_next (GSequenceNode *node)
{
n = n->right;
while (n->left)
n = n->left;
n = n->left;
}
else
{
while (NODE_RIGHT_CHILD (n))
n = n->parent;
n = n->parent;
if (n->parent)
n = n->parent;
n = n->parent;
else
n = node;
n = node;
}
return n;
@ -1485,17 +1487,17 @@ node_get_prev (GSequenceNode *node)
{
n = n->left;
while (n->right)
n = n->right;
n = n->right;
}
else
{
while (NODE_LEFT_CHILD (n))
n = n->parent;
n = n->parent;
if (n->parent)
n = n->parent;
n = n->parent;
else
n = node;
n = node;
}
return n;
@ -1514,7 +1516,7 @@ node_get_pos (GSequenceNode *node)
while (node)
{
if (NODE_RIGHT_CHILD (node))
n_smaller += N_NODES (node->parent->left) + 1;
n_smaller += N_NODES (node->parent->left) + 1;
node = node->parent;
}
@ -1524,7 +1526,7 @@ node_get_pos (GSequenceNode *node)
static GSequenceNode *
node_get_by_pos (GSequenceNode *node,
gint pos)
gint pos)
{
int i;
@ -1534,13 +1536,13 @@ node_get_by_pos (GSequenceNode *node,
{
if (i < pos)
{
node = node->right;
pos -= (i + 1);
node = node->right;
pos -= (i + 1);
}
else
{
node = node->left;
}
node = node->left;
}
}
return node;
@ -1600,7 +1602,7 @@ node_get_length (GSequenceNode *node)
static void
real_node_free (GSequenceNode *node,
GSequence *seq)
GSequence *seq)
{
if (node)
{
@ -1608,7 +1610,7 @@ real_node_free (GSequenceNode *node,
real_node_free (node->right, seq);
if (seq && seq->data_destroy_notify && node != seq->end_node)
seq->data_destroy_notify (node->data);
seq->data_destroy_notify (node->data);
g_slice_free (GSequenceNode, node);
}
@ -1616,7 +1618,7 @@ real_node_free (GSequenceNode *node,
static void
node_free (GSequenceNode *node,
GSequence *seq)
GSequence *seq)
{
node = find_root (node);
@ -1675,7 +1677,7 @@ node_rotate (GSequenceNode *node)
node->left = node->parent;
node->parent = node->parent->parent;
if (node->parent)
{
{
if (node->parent->right == node->left)
node->parent->right = node;
else
@ -1710,7 +1712,7 @@ node_update_fields_deep (GSequenceNode *node)
static void
rotate_down (GSequenceNode *node,
guint priority)
guint priority)
{
guint left, right;
@ -1720,9 +1722,9 @@ rotate_down (GSequenceNode *node,
while (priority < left || priority < right)
{
if (left > right)
node_rotate (node->left);
node_rotate (node->left);
else
node_rotate (node->right);
node_rotate (node->right);
left = node->left ? get_priority (node->left) : 0;
right = node->right ? get_priority (node->right) : 0;
@ -1746,7 +1748,7 @@ node_cut (GSequenceNode *node)
static void
node_join (GSequenceNode *left,
GSequenceNode *right)
GSequenceNode *right)
{
GSequenceNode *fake = node_new (NULL);
@ -1764,7 +1766,7 @@ node_join (GSequenceNode *left,
static void
node_insert_before (GSequenceNode *node,
GSequenceNode *new)
GSequenceNode *new)
{
new->left = node->left;
if (new->left)