projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
INSTALL: Mention the spread-sheet-widget dependency
[pspp]
/
src
/
libpspp
/
tower.c
diff --git
a/src/libpspp/tower.c
b/src/libpspp/tower.c
index bdaaffbca3460c02caa59a6d00e29edc2b17fcd7..c7c36ab16de922ca8771de967c66dc76f1c0674b 100644
(file)
--- a/
src/libpspp/tower.c
+++ b/
src/libpspp/tower.c
@@
-50,10
+50,10
@@
tower_node_get_level (const struct tower_node *node)
{
const struct abt_node *p = &node->abt_node;
unsigned long level = get_subtree_size (p->down[0]);
{
const struct abt_node *p = &node->abt_node;
unsigned long level = get_subtree_size (p->down[0]);
- while (p->up != NULL)
+ while (p->up != NULL)
{
if (p == p->up->down[1])
{
if (p == p->up->down[1])
- level += (get_subtree_size (p->up->down[0])
+ level += (get_subtree_size (p->up->down[0])
+ abt_to_tower_node (p->up)->size);
p = p->up;
}
+ abt_to_tower_node (p->up)->size);
p = p->up;
}
@@
-72,7
+72,7
@@
tower_node_get_index (const struct tower_node *node)
{
const struct abt_node *p = &node->abt_node;
unsigned long index = get_subtree_count (p->down[0]);
{
const struct abt_node *p = &node->abt_node;
unsigned long index = get_subtree_count (p->down[0]);
- while (p->up != NULL)
+ while (p->up != NULL)
{
if (p == p->up->down[1])
index += get_subtree_count (p->up->down[0]) + 1;
{
if (p == p->up->down[1])
index += get_subtree_count (p->up->down[0]) + 1;
@@
-233,7
+233,7
@@
tower_lookup (const struct tower *t_,
less than the number of nodes in T (as returned by
tower_count). */
struct tower_node *
less than the number of nodes in T (as returned by
tower_count). */
struct tower_node *
-tower_get (const struct tower *t_, unsigned long int index)
+tower_get (const struct tower *t_, unsigned long int index)
{
struct tower *t = CONST_CAST (struct tower *, t_);
struct abt_node *p;
{
struct tower *t = CONST_CAST (struct tower *, t_);
struct abt_node *p;