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:
@@ -65,7 +65,10 @@ static HashNode* HT_GetHashNode (void* Entry);
|
||||
/* Given a pointer to the user entry data, return a pointer to the hash node */
|
||||
|
||||
static int HT_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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -136,9 +139,12 @@ static HashNode* HT_GetHashNode (void* Entry)
|
||||
|
||||
|
||||
static int HT_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.
|
||||
*/
|
||||
{
|
||||
return (*(const unsigned*)Key1 == *(const unsigned*)Key2);
|
||||
return (int)*(const unsigned*)Key1 - (int)*(const unsigned*)Key2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -70,7 +70,10 @@ static HashNode* HT_GetHashNode (void* Entry);
|
||||
/* Given a pointer to the user entry data, return a pointer to the hash node */
|
||||
|
||||
static int HT_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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -175,9 +178,12 @@ static HashNode* HT_GetHashNode (void* Entry)
|
||||
|
||||
|
||||
static int HT_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.
|
||||
*/
|
||||
{
|
||||
return (strcmp (Key1, Key2) == 0);
|
||||
return strcmp (Key1, Key2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user