Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
This commit is contained in:
@@ -63,8 +63,8 @@ HashTable* InitHashTable (HashTable* T, unsigned Slots, const HashFunctions* Fun
|
||||
|
||||
void DoneHashTable (HashTable* T)
|
||||
/* Destroy the contents of a hash table. Note: This will not free the entries
|
||||
* in the table!
|
||||
*/
|
||||
** in the table!
|
||||
*/
|
||||
{
|
||||
/* Just free the array with the table pointers */
|
||||
xfree (T->Table);
|
||||
@@ -103,8 +103,8 @@ static void HT_Alloc (HashTable* T)
|
||||
|
||||
HashNode* HT_FindHash (const HashTable* T, const void* Key, unsigned Hash)
|
||||
/* Find the node with the given key. Differs from HT_Find in that the hash
|
||||
* for the key is precalculated and passed to the function.
|
||||
*/
|
||||
** for the key is precalculated and passed to the function.
|
||||
*/
|
||||
{
|
||||
HashNode* N;
|
||||
|
||||
@@ -118,8 +118,8 @@ HashNode* HT_FindHash (const HashTable* T, const void* Key, unsigned Hash)
|
||||
while (N) {
|
||||
|
||||
/* First compare the full hash, to avoid calling the compare function
|
||||
* if it is not really necessary.
|
||||
*/
|
||||
** if it is not really necessary.
|
||||
*/
|
||||
if (N->Hash == Hash &&
|
||||
T->Func->Compare (Key, T->Func->GetKey (N)) == 0) {
|
||||
/* Found */
|
||||
@@ -188,8 +188,8 @@ void HT_Remove (HashTable* T, void* Entry)
|
||||
HashNode** Q = &T->Table[Slot];
|
||||
while (1) {
|
||||
/* If the pointer is NULL, the node is not in the table which we will
|
||||
* consider a serious error.
|
||||
*/
|
||||
** consider a serious error.
|
||||
*/
|
||||
CHECK (*Q != 0);
|
||||
if (*Q == N) {
|
||||
/* Found - remove it */
|
||||
@@ -206,12 +206,12 @@ void HT_Remove (HashTable* T, void* Entry)
|
||||
|
||||
void HT_Walk (HashTable* T, int (*F) (void* Entry, void* Data), void* Data)
|
||||
/* Walk over all nodes of a hash table, optionally deleting entries from the
|
||||
* table. For each node, the user supplied function F is called, passing a
|
||||
* pointer to the entry, and the data pointer passed to HT_Walk by the caller.
|
||||
* If F returns true, the node is deleted from the hash table otherwise it's
|
||||
* left in place. While deleting the node, the node is not accessed, so it is
|
||||
* safe for F to free the memory associcated with the entry.
|
||||
*/
|
||||
** table. For each node, the user supplied function F is called, passing a
|
||||
** pointer to the entry, and the data pointer passed to HT_Walk by the caller.
|
||||
** If F returns true, the node is deleted from the hash table otherwise it's
|
||||
** left in place. While deleting the node, the node is not accessed, so it is
|
||||
** safe for F to free the memory associcated with the entry.
|
||||
*/
|
||||
{
|
||||
unsigned I;
|
||||
|
||||
@@ -231,8 +231,8 @@ void HT_Walk (HashTable* T, int (*F) (void* Entry, void* Data), void* Data)
|
||||
/* Fetch the next node in chain now, because F() may delete it */
|
||||
HashNode* Next = (*Cur)->Next;
|
||||
/* Call the user function. N is also the pointer to the entry. If
|
||||
* the function returns true, the entry is to be deleted.
|
||||
*/
|
||||
** the function returns true, the entry is to be deleted.
|
||||
*/
|
||||
if (F (*Cur, Data)) {
|
||||
/* Delete the node from the chain */
|
||||
*Cur = Next;
|
||||
|
||||
Reference in New Issue
Block a user