#ifdef STATS
-void
-MANGLEP(stats) (SET *table)
+void MANGLEP(stats) (SET *table)
{
int nfree = 0;
#ifdef PSET
table->naccess, table->ncollision, table->nkey, table->ndups, table->max_chain_len, nfree);
}
-static inline void
-stat_chain_len (SET *table, int chain_len)
+static inline void stat_chain_len(SET *table, int chain_len)
{
table->ncollision += chain_len;
if (table->max_chain_len < chain_len) table->max_chain_len = chain_len;
#else /* !STATS */
-# define stat_chain_len(table, chain_len) ((void)0)
+# define stat_chain_len(table, chain_len) ((void)chain_len)
# define stat_access(table) ((void)0)
# define stat_dup(table) ((void)0)
const char *MANGLEP(tag);
-void
-MANGLEP(describe) (SET *table)
+void MANGLEP(describe) (SET *table)
{
unsigned i, j, collide;
Element *ptr;
#endif /* !DEBUG */
-SET *
-(PMANGLE(new)) (MANGLEP(cmp_fun) cmp, int nslots)
+SET *(PMANGLE(new)) (MANGLEP(cmp_fun) cmp, int nslots)
{
int i;
SET *table = XMALLOC(SET);
else {
assert (nslots >= 0);
/* Adjust nslots up to next power of 2, minimum SEGMENT_SIZE */
- for (i = SEGMENT_SIZE; i < nslots; i <<= 1);
+ for (i = SEGMENT_SIZE; i < nslots; i <<= 1) {
+ }
nslots = i >> SEGMENT_SIZE_SHIFT;
}
}
-void
-PMANGLE(del) (SET *table)
+void PMANGLE(del) (SET *table)
{
#ifdef DEBUG
MANGLEP(tag) = table->tag;
xfree (table);
}
-int
-MANGLEP(count) (SET *table)
+int MANGLEP(count) (SET *table)
{
return table->nkey;
}
* do one iteration step, return 1
* if still data in the set, 0 else
*/
-static inline int
-iter_step (SET *table)
+static inline int iter_step(SET *table)
{
if (++table->iter_j >= SEGMENT_SIZE) {
table->iter_j = 0;
/*
* finds the first entry in the table
*/
-void *
-MANGLEP(first) (SET *table)
+void * MANGLEP(first) (SET *table)
{
assert (!table->iter_tail);
table->iter_i = 0;
/*
* returns next entry in the table
*/
-void *
-MANGLEP(next) (SET *table)
+void *MANGLEP(next) (SET *table)
{
if (!table->iter_tail)
return NULL;
return table->iter_tail->entry.dptr;
}
-void
-MANGLEP(break) (SET *table)
+void MANGLEP(break) (SET *table)
{
table->iter_tail = NULL;
}
/*
* limit the hash value
*/
-static inline unsigned
-Hash (SET *table, unsigned h)
+static inline unsigned Hash(SET *table, unsigned h)
{
unsigned address;
address = h & (table->maxp - 1); /* h % table->maxp */
* returns non-zero if the number of elements in
* the set is greater then number of segments * MAX_LOAD_FACTOR
*/
-static inline int
-loaded (SET *table)
+static inline int loaded(SET *table)
{
return ( ++table->nkey
> (table->nseg << SEGMENT_SIZE_SHIFT) * MAX_LOAD_FACTOR);
* after all segments were split, table->p is set to zero and
* table->maxp is duplicated.
*/
-static void
-expand_table (SET *table)
+static void expand_table(SET *table)
{
unsigned NewAddress;
int OldSegmentIndex, NewSegmentIndex;
}
-void *
-MANGLE(_,_search) (SET *table,
+void * MANGLE(_,_search) (SET *table,
const void *key,
#ifndef PSET
size_t size,
return x != y;
}
-void *
-pset_remove (SET *table, const void *key, unsigned hash)
+void *pset_remove(SET *table, const void *key, unsigned hash)
{
unsigned h;
Segment *CurrentSegment;
}
-void *
-(pset_find) (SET *se, const void *key, unsigned hash)
+void *(pset_find) (SET *se, const void *key, unsigned hash)
{
return pset_find (se, key, hash);
}
-void *
-(pset_insert) (SET *se, const void *key, unsigned hash)
+void *(pset_insert) (SET *se, const void *key, unsigned hash)
{
return pset_insert (se, key, hash);
}
#else /* !PSET */
-void *
-(set_find) (set *se, const void *key, size_t size, unsigned hash)
+void *(set_find) (set *se, const void *key, size_t size, unsigned hash)
{
return set_find (se, key, size, hash);
}
-void *
-(set_insert) (set *se, const void *key, size_t size, unsigned hash)
+void *(set_insert) (set *se, const void *key, size_t size, unsigned hash)
{
return set_insert (se, key, size, hash);
}
-set_entry *
-(set_hinsert) (set *se, const void *key, size_t size, unsigned hash)
+set_entry *(set_hinsert) (set *se, const void *key, size_t size, unsigned hash)
{
return set_hinsert (se, key, size, hash);
}