From: cuz Date: Wed, 22 Oct 2003 18:47:05 +0000 (+0000) Subject: Cosmetic changes X-Git-Tag: V2.12.0~1235 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5e07b14e8dd0062e16c80dc80367700feed72517;p=cc65 Cosmetic changes git-svn-id: svn://svn.cc65.org/cc65/trunk@2559 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/common/hashtab.c b/src/common/hashtab.c index 7ba78ce1e..72319a6a2 100644 --- a/src/common/hashtab.c +++ b/src/common/hashtab.c @@ -74,7 +74,7 @@ static void HT_Alloc (HashTable* T) -HashNode* HT_Find (const HashTable* T, const void* Index) +HashNode* HT_Find (const HashTable* T, const void* Key) /* Find the node with the given index */ { unsigned Hash; @@ -86,7 +86,7 @@ HashNode* HT_Find (const HashTable* T, const void* Index) } /* Generate the hash over the index */ - Hash = T->Func->GenHash (Index); + Hash = T->Func->GenHash (Key); /* Search for the entry in the given chain */ N = T->Table[Hash % T->Slots]; @@ -96,7 +96,7 @@ HashNode* HT_Find (const HashTable* T, const void* Index) * if it is not really necessary. */ if (N->Hash == Hash && - T->Func->Compare (Index, T->Func->GetIndex (N->Entry))) { + T->Func->Compare (Key, T->Func->GetIndex (N->Entry))) { /* Found */ break; } @@ -111,11 +111,11 @@ HashNode* HT_Find (const HashTable* T, const void* Index) -void* HT_FindEntry (const HashTable* T, const void* Index) +void* HT_FindEntry (const HashTable* T, const void* Key) /* Find the node with the given index and return the corresponding entry */ { /* First, search for the hash node */ - HashNode* N = HT_Find (T, Index); + HashNode* N = HT_Find (T, Key); /* Convert the node into an entry if necessary */ return N? N->Entry : 0; diff --git a/src/common/hashtab.h b/src/common/hashtab.h index 14e1398e9..24e492716 100644 --- a/src/common/hashtab.h +++ b/src/common/hashtab.h @@ -65,8 +65,8 @@ struct HashNode { typedef struct HashFunctions HashFunctions; struct HashFunctions { - unsigned (*GenHash) (const void* Index); - /* Generate the hash over an index. */ + unsigned (*GenHash) (const void* Key); + /* Generate the hash over a key. */ const void* (*GetIndex) (void* Entry); /* Given a pointer to the user entry data, return a pointer to the index */ @@ -74,8 +74,8 @@ struct HashFunctions { HashNode* (*GetHashNode) (void* Entry); /* Given a pointer to the user entry data, return a pointer to the hash node */ - int (*Compare) (const void* Index1, const void* Index2); - /* Compare two indices for equality */ + int (*Compare) (const void* Key1, const void* Key2); + /* Compare two keys for equality */ }; /* Hash table */ @@ -169,11 +169,11 @@ INLINE HashTable* NewHashTable (unsigned Slots, const HashFunctions* Func) void FreeHashTable (HashTable* T); /* Free a hash table. Note: This will not free the entries in the table! */ -HashNode* HT_Find (const HashTable* T, const void* Index); -/* Find the node with the given index */ +HashNode* HT_Find (const HashTable* T, const void* Key); +/* Find the node with the given key*/ -void* HT_FindEntry (const HashTable* T, const void* Index); -/* Find the node with the given index and return the corresponding entry */ +void* HT_FindEntry (const HashTable* T, const void* Key); +/* Find the node with the given key and return the corresponding entry */ void HT_Insert (HashTable* T, HashNode* N); /* Insert a node into the given hash table */