/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.4
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
#define TABLE_SIZE 1023 /**< Size of lookup table/array */
+#define HASH_FUNC(K) ((K) % TABLE_SIZE)
+
+
/**
* An entry in the hash table.
*
assert(table);
assert(key);
- pos = key & (TABLE_SIZE-1);
+ pos = HASH_FUNC(key);
entry = table->Table[pos];
while (entry) {
if (entry->Key == key) {
if (key > table->MaxKey)
table->MaxKey = key;
- pos = key & (TABLE_SIZE-1);
+ pos = HASH_FUNC(key);
entry = table->Table[pos];
while (entry) {
if (entry->Key == key) {
_glthread_LOCK_MUTEX(table->Mutex);
- pos = key & (TABLE_SIZE-1);
+ pos = HASH_FUNC(key);
prev = NULL;
entry = table->Table[pos];
while (entry) {
assert(key);
/* Find the entry with given key */
- pos = key & (TABLE_SIZE - 1);
+ pos = HASH_FUNC(key);
entry = table->Table[pos];
while (entry) {
if (entry->Key == key) {
}
+#if 0 /* debug only */
+
/**
* Test walking over all the entries in a hash table.
*/
test_hash_walking();
}
+
+#endif