X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fadt%2Fhashset.c;h=811078742941fe61ec4c63d84fc548a98946437e;hb=493bdbad35484ae790f9d098c439048c95091d3f;hp=505baa589a0b193f4e9137c8aea72cbfad65ae97;hpb=1a26f4853c07d1ecd68a097409dd602edfe29eff;p=libfirm diff --git a/ir/adt/hashset.c b/ir/adt/hashset.c index 505baa589..811078742 100644 --- a/ir/adt/hashset.c +++ b/ir/adt/hashset.c @@ -47,7 +47,7 @@ *
  • GetKey(value) Extracts the key from a data value
  • *
  • KeysEqual(hashset,key1,key2) Tests wether 2 keys are equal
  • *
  • DO_REHASH Instead of storing the hash-values, recalculate - * them on demand from the datavalues. (usefull if + * them on demand from the datavalues. (useful if * calculating the hash-values takes less time than * a memory access)
  • * @@ -84,7 +84,7 @@ #ifdef DO_REHASH #define HashSetEntry ValueType -#define EntrySetHash(entry,new_hash) +#define EntrySetHash(entry,new_hash) (void)0 #define EntryGetHash(self,entry) Hash(self, GetKey(entry)) #define EntryGetValue(entry) (entry) #else /* ! DO_REHASH */ @@ -219,8 +219,7 @@ size_t hashset_size(const HashSet *self) * @note also see comments for hashset_insert() * @internal */ -static inline -InsertReturnValue insert_nogrow(HashSet *self, KeyType key) +static inline InsertReturnValue insert_nogrow(HashSet *self, KeyType key) { size_t num_probes = 0; size_t num_buckets = self->num_buckets; @@ -270,8 +269,7 @@ InsertReturnValue insert_nogrow(HashSet *self, KeyType key) * calculate shrink and enlarge limits * @internal */ -static inline -void reset_thresholds(HashSet *self) +static inline void reset_thresholds(HashSet *self) { self->enlarge_threshold = (size_t) HT_OCCUPANCY_FLT(self->num_buckets); self->shrink_threshold = (size_t) HT_EMPTY_FLT(self->num_buckets); @@ -284,8 +282,7 @@ void reset_thresholds(HashSet *self) * contains no deleted entries and the element doesn't exist in the hashset yet. * @internal */ -static -void insert_new(HashSet *self, unsigned hash, ValueType value) +static void insert_new(HashSet *self, unsigned hash, ValueType value) { size_t num_probes = 0; size_t num_buckets = self->num_buckets; @@ -326,8 +323,7 @@ void insert_new(HashSet *self, unsigned hash, ValueType value) * Resize the hashset * @internal */ -static inline -void resize(HashSet *self, size_t new_size) +static inline void resize(HashSet *self, size_t new_size) { size_t num_buckets = self->num_buckets; size_t i; @@ -371,8 +367,7 @@ static inline void resize(HashSet *self, size_t new_size); * grow the hashset if adding 1 more elements would make it too crowded * @internal */ -static inline -void maybe_grow(HashSet *self) +static inline void maybe_grow(HashSet *self) { size_t resize_to; @@ -388,8 +383,7 @@ void maybe_grow(HashSet *self) * shrink the hashset if it is only sparsely filled * @internal */ -static inline -void maybe_shrink(HashSet *self) +static inline void maybe_shrink(HashSet *self) { size_t size; size_t resize_to; @@ -516,8 +510,7 @@ void hashset_remove(HashSet *self, ConstKeyType key) * Initializes hashset with a specific size * @internal */ -static inline -void init_size(HashSet *self, size_t initial_size) +static inline void init_size(HashSet *self, size_t initial_size) { if (initial_size < 4) initial_size = 4;