From 334fe4500c234e83f250f74679f7bbe20208abba Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 3 Nov 2015 16:16:27 -0600 Subject: rts/Hash: Constify HashTable* in lookupHashTable This seems like an obvious place to apply `const` Reviewed By: simonmar, austin Differential Revision: https://phabricator.haskell.org/D1416 --- rts/Hash.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rts/Hash.h') diff --git a/rts/Hash.h b/rts/Hash.h index 136f94a18c..c2dfc26d6d 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 */ -- cgit v1.2.1