summaryrefslogtreecommitdiff
path: root/src/util/Hash.c
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-09-12 12:54:35 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-09-12 12:54:35 +0000
commitf1085f4af8f7f9d4d1d38dbc9346494c50753a9f (patch)
tree0001f300c5f70dc83a713661acae35820eb5c657 /src/util/Hash.c
parentae293177391a74c1e8e93ec6c6090b0c70401d2e (diff)
Added a 'volatile' qualifier to all variables which hold the result of a
modulo operation. This just servers as a temporary workaround for a Hitachi compiler bug. git-svn-id: http://svn.cactuscode.org/flesh/trunk@1813 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/util/Hash.c')
-rw-r--r--src/util/Hash.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/util/Hash.c b/src/util/Hash.c
index 37fd18b1..e71776f1 100644
--- a/src/util/Hash.c
+++ b/src/util/Hash.c
@@ -177,7 +177,8 @@ int Util_HashAdd(uHash *hash,
int retval;
iHashEntry *entry;
iHashEntry *lastentry;
- unsigned int location;
+ /* FIXME: workaround for Hitachi compiler bug */
+ volatile unsigned int location;
int duplicate;
int i;
@@ -293,7 +294,9 @@ int Util_HashDelete(uHash *hash,
unsigned int hashval)
{
iHashEntry *entry;
- unsigned int location;
+ /* FIXME: the volatile qualifier just serves as a workaround
+ for the Hitachi compiler bug */
+ volatile unsigned int location;
/* Calculate the hash value if necessary */
if(!hashval)
@@ -453,7 +456,9 @@ static iHashEntry *HashFind(uHash *hash,
unsigned int hashval)
{
iHashEntry *entry;
- unsigned int location;
+ /* FIXME: the volatile qualifier just serves as a workaround
+ for the Hitachi compiler bug */
+ volatile unsigned int location;
/* Calculate the hash value if necessary */
if(!hashval)
@@ -468,7 +473,7 @@ static iHashEntry *HashFind(uHash *hash,
entry = hash->array[location];
/* Find the entry on the list.*/
- for(entry = hash->array[location]; entry; entry = entry->next)
+ for(; entry; entry = entry->next)
{
if(hashval == entry->hash)
{
@@ -502,7 +507,9 @@ static int HashRehash(uHash *hash)
unsigned int new_size;
unsigned int old_location;
- unsigned int location;
+ /* FIXME: the volatile qualifier just serves as a workaround
+ for the Hitachi compiler bug */
+ volatile unsigned int location;
unsigned int new_fill;