Change API for the Compare function

git-svn-id: svn://svn.cc65.org/cc65/trunk@2573 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-10-23 14:54:58 +00:00
parent ed2dfd50e9
commit 39ad3d6da0
4 changed files with 23 additions and 8 deletions

View File

@@ -96,7 +96,7 @@ HashNode* HT_Find (const HashTable* T, const void* Key)
* if it is not really necessary.
*/
if (N->Hash == Hash &&
T->Func->Compare (Key, T->Func->GetKey (N->Entry))) {
T->Func->Compare (Key, T->Func->GetKey (N->Entry)) == 0) {
/* Found */
break;
}

View File

@@ -75,7 +75,10 @@ struct HashFunctions {
/* Given a pointer to the user entry data, return a pointer to the hash node */
int (*Compare) (const void* Key1, const void* Key2);
/* Compare two keys for equality */
/* Compare two keys. The function must return a value less than zero if
* Key1 is smaller than Key2, zero if both are equal, and a value greater
* than zero if Key1 is greater then Key2.
*/
};
/* Hash table */