while (np)
{
- register node *node_right;
-
/* Descent on left children. */
while (np->left)
{
np = np->left;
}
/* Free node without left children. */
- node_right = np->right;
+ node *node_right = np->right;
free (np->name);
free (np->regex);
free (np);
else
{
/* Ctags Mode */
- register int dif;
node **next_node = &cur_node;
while ((cur_node = *next_node) != NULL)
{
- dif = strcmp (np->name, cur_node->name);
+ int dif = strcmp (np->name, cur_node->name);
/*
* If this tag name matches an existing one, then
* do not add the node, but maybe print a warning.
node *np = *npp;
stkentry *stack = NULL;
- if (np == NULL)
- return;
-
if (CTAGS)
{
while (np)
{
/* Pop nodes from stack, invalidating them, until we find one
with a right child. */
- do {
- np = pop_node (&stack);
- if (np && np->fdp == badfdp)
- np->valid = false;
- } while (np && np->right == NULL);
+ while ((np = pop_node (&stack)) != NULL)
+ {
+ if (np->fdp == badfdp)
+ np->valid = false;
+ if (np->right != NULL)
+ break;
+ }
}
/* Process the right child, if any. */
if (np)
}
else
{
- node super_root, *np_parent;
+ node super_root, *np_parent = NULL;
super_root.left = np;
- super_root.fdp = (fdesc *)-1;
+ super_root.fdp = (fdesc *) -1;
np = &super_root;
while (np)
np_parent->left = np->left; /* detach subtree from the tree */
np->left = NULL; /* isolate it */
free_tree (np); /* free it */
- np = np_parent->left; /* continue with rest of tree */
+
+ /* Continue with rest of tree. */
+ np = np_parent ? np_parent->left : NULL;
}
}
*npp = super_root.left;
}
static void
-put_entry (register node *np)
+put_entry (node *np)
{
register char *sp;
static fdesc *fdp = NULL;
/* Output this entry */
- if (np && np->valid)
+ if (np->valid)
{
if (!CTAGS)
{
}
static void
-put_entries (register node *np)
+put_entries (node *np)
{
stkentry *stack = NULL;
/* Output this subentry. */
put_entry (np);
/* Stack subentries that follow this one. */
- if (!np->right)
+ while (!np->right)
{
/* Output subentries that precede the next one. */
- do {
- np = pop_node (&stack);
- put_entry (np);
- } while (np && np->right == NULL);
+ np = pop_node (&stack);
+ if (!np)
+ break;
+ put_entry (np);
}
if (np)
np = np->right;