X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Ftower.c;h=39f9d23ce7a36d51fc959c218b0153fc5b83008f;hb=e609c7d767ffd600fd844327b292590259cbb0de;hp=bdaaffbca3460c02caa59a6d00e29edc2b17fcd7;hpb=5afa4c0d579f1ebff37b638a30ea397d58aca5f8;p=pspp diff --git a/src/libpspp/tower.c b/src/libpspp/tower.c index bdaaffbca3..39f9d23ce7 100644 --- 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]); - while (p->up != NULL) + while (p->up != NULL) { 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; } @@ -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]); - while (p->up != NULL) + while (p->up != NULL) { 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 * -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; @@ -294,7 +294,7 @@ tower_prev (const struct tower *t, const struct tower_node *node) static struct tower_node * abt_to_tower_node (const struct abt_node *abt_node) { - return abt_data (abt_node, struct tower_node, abt_node); + return ABT_DATA (abt_node, struct tower_node, abt_node); } /* Returns the tower node corresponding to the given ABT_NODE. */