summaryrefslogtreecommitdiff
path: root/queue.h
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2005-04-07 19:19:16 +0000
committermatthijs <matthijs@openttd.org>2005-04-07 19:19:16 +0000
commitda3621c1804e6da9cefd712da9d0dd48fff61add (patch)
tree034da873c7ef2d41762a674839ff36339133a41e /queue.h
parent9c3813e21374c71da7c1c49cf52d68546815c1b0 (diff)
downloadopenttd-da3621c1804e6da9cefd712da9d0dd48fff61add.tar.xz
(svn r2165) - Codechange: [NPF] Properly enummed NPF hash size, it is easily changable now.
- Codechange: [NPF] Improved the NPF hash calculation slightly. - Codechange: [NPF] Increased hash size, should speed up somewhat.
Diffstat (limited to 'queue.h')
-rw-r--r--queue.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/queue.h b/queue.h
index 56ecd2a3e..c4a1bf0ee 100644
--- a/queue.h
+++ b/queue.h
@@ -4,6 +4,7 @@
//#define NOFREE
//#define QUEUE_DEBUG
//#define HASH_DEBUG
+//#define HASH_STATS
typedef struct Queue Queue;
@@ -142,7 +143,8 @@ struct HashNode {
void* value;
HashNode* next;
};
-/* Generates a hash code from the given key pair. You should make sure that
+/**
+ * Generates a hash code from the given key pair. You should make sure that
* the resulting range is clearly defined.
*/
typedef uint Hash_HashProc(uint key1, uint key2);
@@ -184,7 +186,7 @@ void* Hash_Get(Hash* h, uint key1, uint key2);
Hash* new_Hash(Hash_HashProc* hash, int num_buckets);
/* Builds a new hash in an existing struct. Make sure that hash() always
* returns a hash less than num_buckets! Call delete_hash after use */
-void init_Hash(Hash* h, Hash_HashProc* hash, int num_buckets);
+void init_Hash(Hash* h, Hash_HashProc* hash, uint num_buckets);
/*
* Deletes the hash and cleans up. Only cleans up memory allocated by new_Hash
* & friends. If free is true, it will call free() on all the values that