summaryrefslogtreecommitdiff
path: root/utils/HashTable.h
diff options
context:
space:
mode:
authorchatty1993-12-22 12:25:29 +0000
committerchatty1993-12-22 12:25:29 +0000
commit5bbc69b1ccaf26b1f4670668bc11aba86e92139d (patch)
treede803ea73107e80cf0037f2747025c9870ea5c47 /utils/HashTable.h
parent2451f7f434fe53586ac3cd3e5859f061aeaf56b6 (diff)
downloadivy-league-5bbc69b1ccaf26b1f4670668bc11aba86e92139d.zip
ivy-league-5bbc69b1ccaf26b1f4670668bc11aba86e92139d.tar.gz
ivy-league-5bbc69b1ccaf26b1f4670668bc11aba86e92139d.tar.bz2
ivy-league-5bbc69b1ccaf26b1f4670668bc11aba86e92139d.tar.xz
Hash functions must now return unsigned int
Simplified HashStats and CollStats changed arg of operator new
Diffstat (limited to 'utils/HashTable.h')
-rw-r--r--utils/HashTable.h21
1 files 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);
};