diff --git a/rts/FileLock.c b/rts/FileLock.c index cd2dc1d1dc627ed78b039e61a9792d564ee59dee..f8e11ee1bf33db44ea8796f55fdeff95d00f1d57 100644 --- a/rts/FileLock.c +++ b/rts/FileLock.c @@ -41,7 +41,7 @@ static int cmpLocks(StgWord w1, StgWord w2) return (l1->device == l2->device && l1->inode == l2->inode); } -static int hashLock(HashTable *table, StgWord w) +static int hashLock(const HashTable *table, StgWord w) { Lock *l = (Lock *)w; StgWord key = l->inode ^ (l->inode >> 32) ^ l->device ^ (l->device >> 32); diff --git a/rts/Hash.c b/rts/Hash.c index aab3b2361bf1899a1bb293006543509e5d13e79d..b0939c49bcd456bb3446ee9306091e61bc5c53df 100644 --- a/rts/Hash.c +++ b/rts/Hash.c @@ -58,7 +58,7 @@ struct hashtable { * -------------------------------------------------------------------------- */ int -hashWord(HashTable *table, StgWord key) +hashWord(const HashTable *table, StgWord key) { int bucket; @@ -76,7 +76,7 @@ hashWord(HashTable *table, StgWord key) } int -hashStr(HashTable *table, char *key) +hashStr(const HashTable *table, char *key) { int h, bucket; char *s; @@ -187,7 +187,7 @@ expand(HashTable *table) } void * -lookupHashTable(HashTable *table, StgWord key) +lookupHashTable(const HashTable *table, StgWord key) { int bucket; int segment; diff --git a/rts/Hash.h b/rts/Hash.h index 136f94a18cf0dab06a6ed9e592e6ac87d5cb716a..c2dfc26d6da7574d790818c9a239daa5f8757d07 100644 --- a/rts/Hash.h +++ b/rts/Hash.h @@ -15,7 +15,7 @@ typedef struct hashtable HashTable; /* abstract */ /* Hash table access where the keys are StgWords */ HashTable * allocHashTable ( void ); -void * lookupHashTable ( HashTable *table, StgWord key ); +void * lookupHashTable ( const HashTable *table, StgWord key ); void insertHashTable ( HashTable *table, StgWord key, void *data ); void * removeHashTable ( HashTable *table, StgWord key, void *data ); @@ -44,11 +44,11 @@ HashTable * allocStrHashTable ( void ); (removeHashTable(table, (StgWord)key, data)) /* Hash tables for arbitrary keys */ -typedef int HashFunction(HashTable *table, StgWord key); +typedef int HashFunction(const HashTable *table, StgWord key); typedef int CompareFunction(StgWord key1, StgWord key2); HashTable * allocHashTable_(HashFunction *hash, CompareFunction *compare); -int hashWord(HashTable *table, StgWord key); -int hashStr(HashTable *table, char *key); +int hashWord(const HashTable *table, StgWord key); +int hashStr(const HashTable *table, char *key); /* Freeing hash tables */