Skip to content

Commit

Permalink
Fix avl element name
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Kegler authored and Jeffrey Kegler committed May 2, 2012
1 parent 4e4b24f commit c6a4ea9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions r2/libmarpa/dev/avl/avl.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ _marpa_avl_create (avl_comparison_func *compare, void *param,
if (tree == NULL)
return NULL;

my_obstack_begin(&tree->obstack, 0, alignment);
my_obstack_begin(&tree->avl_obstack, 0, alignment);


tree->avl_root = NULL;
tree->avl_compare = compare;
tree->avl_param = param;
Expand Down Expand Up @@ -114,7 +116,7 @@ _marpa_avl_probe (AVL_TREE tree, void *item)
da[k++] = dir = cmp > 0;
}

n = q->avl_link[dir] = my_obstack_alloc (&tree->obstack, sizeof *n);
n = q->avl_link[dir] = my_obstack_alloc (&tree->avl_obstack, sizeof *n);
if (n == NULL)
return NULL;

Expand Down Expand Up @@ -293,7 +295,7 @@ _marpa_avl_delete (AVL_TREE tree, const void *item)
}
}

my_obstack_free (&tree->obstack);
my_obstack_free (&tree->avl_obstack);

assert (k > 0);
while (--k > 0)
Expand Down Expand Up @@ -708,7 +710,7 @@ void
_marpa_avl_destroy (AVL_TREE tree)
{
if (tree == NULL) return;
my_obstack_free (&tree->obstack);
my_obstack_free (&tree->avl_obstack);
my_free (tree);
}

Expand Down
4 changes: 2 additions & 2 deletions r2/libmarpa/dev/avl/avl.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct marpa_avl_table
struct avl_node *avl_root; /* Tree's root. */
avl_comparison_func *avl_compare; /* Comparison function. */
void *avl_param; /* Extra argument to |avl_compare|. */
struct obstack obstack;
struct obstack avl_obstack;
size_t avl_count; /* Number of items in tree. */
unsigned long avl_generation; /* Generation number. */
};
Expand All @@ -72,7 +72,7 @@ struct avl_traverser
unsigned long avl_generation; /* Generation number. */
};

#define AVL_OBSTACK(table) (&(table)->obstack)
#define AVL_OBSTACK(table) (&(table)->avl_obstack)

/* Table functions. */
AVL_TREE _marpa_avl_create (avl_comparison_func *, void *,
Expand Down

0 comments on commit c6a4ea9

Please sign in to comment.