Commit b9ea755c authored by Ian Craggs's avatar Ian Craggs

Remove reference to exit() function #342

parent ace52138
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2009, 2013 IBM Corp. * Copyright (c) 2009, 2018 IBM Corp.
* *
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
int isRed(Node* aNode); int isRed(Node* aNode);
int isBlack(Node* aNode); int isBlack(Node* aNode);
int TreeWalk(Node* curnode, int depth); /*int TreeWalk(Node* curnode, int depth);*/
int TreeMaxDepth(Tree *aTree); /*int TreeMaxDepth(Tree *aTree);*/
void TreeRotate(Tree* aTree, Node* curnode, int direction, int index); void TreeRotate(Tree* aTree, Node* curnode, int direction, int index);
Node* TreeBAASub(Tree* aTree, Node* curnode, int which, int index); Node* TreeBAASub(Tree* aTree, Node* curnode, int which, int index);
void TreeBalanceAfterAdd(Tree* aTree, Node* curnode, int index); void TreeBalanceAfterAdd(Tree* aTree, Node* curnode, int index);
...@@ -110,7 +110,7 @@ int isBlack(Node* aNode) ...@@ -110,7 +110,7 @@ int isBlack(Node* aNode)
return (aNode == NULL) || (aNode->red == 0); return (aNode == NULL) || (aNode->red == 0);
} }
#if 0
int TreeWalk(Node* curnode, int depth) int TreeWalk(Node* curnode, int depth)
{ {
if (curnode) if (curnode)
...@@ -141,7 +141,7 @@ int TreeMaxDepth(Tree *aTree) ...@@ -141,7 +141,7 @@ int TreeMaxDepth(Tree *aTree)
}*/ }*/
return rc; return rc;
} }
#endif
void TreeRotate(Tree* aTree, Node* curnode, int direction, int index) void TreeRotate(Tree* aTree, Node* curnode, int direction, int index)
{ {
...@@ -231,7 +231,8 @@ void* TreeAddByIndex(Tree* aTree, void* content, size_t size, int index) ...@@ -231,7 +231,8 @@ void* TreeAddByIndex(Tree* aTree, void* content, size_t size, int index)
if (result == 0) if (result == 0)
{ {
if (aTree->allow_duplicates) if (aTree->allow_duplicates)
exit(-99); goto exit; /* exit(-99); */
else
{ {
newel = curnode; newel = curnode;
rc = newel->content; rc = newel->content;
...@@ -262,6 +263,7 @@ void* TreeAddByIndex(Tree* aTree, void* content, size_t size, int index) ...@@ -262,6 +263,7 @@ void* TreeAddByIndex(Tree* aTree, void* content, size_t size, int index)
newel->content = content; newel->content = content;
newel->size = size; newel->size = size;
TreeBalanceAfterAdd(aTree, newel, index); TreeBalanceAfterAdd(aTree, newel, index);
exit:
return rc; return rc;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment