Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype for AVLTreeCompareFunc is incorrect, causing confusion #3

Open
curlybeast opened this issue Jun 18, 2015 · 0 comments
Open

Comments

@curlybeast
Copy link

At line 119 of https://github.com/fragglet/c-algorithms/blob/master/src/avl-tree.h, there is a function pointer for AVLTreeCompareFunc declared.

The declaration is:

typedef int (*AVLTreeCompareFunc)(AVLTreeValue value1, AVLTreeValue value2);

But the documentation (and code) shows that this function is for comparing the keys of two nodes in the tree, so the declaration should actually be:

typedef int (*AVLTreeCompareFunc)(AVLTreeKey key1, AVLTreeKey key2);

As both AVLTreeKey and AVLTreeValue are themselves typedefed as **void ***, it doesn’t actually make any difference to the function operation, but it makes the prototype confusing.

nitsel88 added a commit to nitsel88/c-algorithms that referenced this issue Oct 23, 2015
Fix to change the prototype to be in sync with the definition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant