* @author Matthias Braun, inspiration from densehash from google sparsehash
* package
* @date 17.03.2007
- * @version $Id$
*
*
* You have to specialize this file by defining:
* <li><b>GetKey(value)</b> Extracts the key from a data value</li>
* <li><b>KeysEqual(hashset,key1,key2)</b> Tests wether 2 keys are equal</li>
* <li><b>DO_REHASH</b> 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)</li>
* </ul>
#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 */
* @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;
* 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);
* 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;
* 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;
* 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;
* 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;
* 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;