From 5bbc69b1ccaf26b1f4670668bc11aba86e92139d Mon Sep 17 00:00:00 2001 From: chatty Date: Wed, 22 Dec 1993 12:25:29 +0000 Subject: Hash functions must now return unsigned int Simplified HashStats and CollStats changed arg of operator new --- utils/HashTable.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/utils/HashTable.h b/utils/HashTable.h index 798d7c9..ce751ac 100644 --- a/utils/HashTable.h +++ b/utils/HashTable.h @@ -42,7 +42,7 @@ inline void SetInfo (CcuHashItem* p) { Info = p; } inline CcuHashItem* GetInfo () const { return Info; } inline const void* GetKey () const { return Key; } - void* operator new (unsigned int); + void* operator new (unsigned long); void operator delete (void*); }; @@ -61,7 +61,7 @@ public: }; -typedef int (*HASH_F) (const void*, int); +typedef unsigned int (*HASH_F) (const void*, int); typedef int (*HCMP_F) (const void*, const void*); typedef void* (*HCP_F) (const void*); typedef void (*HDEL_F) (const void*); @@ -84,6 +84,8 @@ protected : CcuHashCell* AddCell (CcuHashCell**, const void*) const; public: +static unsigned int HashPtr (const void*, int); + CcuHashTable (unsigned int, HASH_F = 0, HCP_F = 0, HDEL_F = 0, HCMP_F = 0); CcuHashTable (const CcuHashTable&); ~CcuHashTable (); @@ -96,23 +98,24 @@ inline int GetSize () const { return Size; } CcuHashCellRef operator [] (const void*) const; #ifdef TUNE - void HashStats (int fd = 2); - void CollStats (int fd = 2); + void HashStats (); + void CollStats (); #endif }; class CcuDictionnary : public CcuHashTable { protected: -static void* CopyKey (const void*); -static void DeleteKey (void*); -static int CompareKey (const void*, const void*); -static int HashKey (const void*, int); - +static void* CopyString (const void*); +static void DeleteString (void*); +static int CompareString (const void*, const void*); + + public: CcuDictionnary (int size, HASH_F = 0); ~CcuDictionnary (); void KeyCopy (int); +static unsigned int HashString (const void*, int); }; -- cgit v1.1