summaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'st.c')
-rw-r--r--st.c72
1 files changed, 19 insertions, 53 deletions
diff --git a/st.c b/st.c
index df4eb7e..8e78fc7 100644
--- a/st.c
+++ b/st.c
@@ -117,8 +117,7 @@ static long primes[] = {
};
static int
-new_size(size)
- int size;
+new_size(int size)
{
int i;
@@ -155,9 +154,7 @@ stat_col()
#endif
st_table*
-st_init_table_with_size(type, size)
- struct st_hash_type *type;
- int size;
+st_init_table_with_size(struct st_hash_type *type, int size)
{
st_table *tbl;
@@ -180,8 +177,7 @@ st_init_table_with_size(type, size)
}
st_table*
-st_init_table(type)
- struct st_hash_type *type;
+st_init_table(struct st_hash_type *type)
{
return st_init_table_with_size(type, 0);
}
@@ -193,8 +189,7 @@ st_init_numtable(void)
}
st_table*
-st_init_numtable_with_size(size)
- int size;
+st_init_numtable_with_size(int size)
{
return st_init_table_with_size(&type_numhash, size);
}
@@ -206,15 +201,13 @@ st_init_strtable(void)
}
st_table*
-st_init_strtable_with_size(size)
- int size;
+st_init_strtable_with_size(int size)
{
return st_init_table_with_size(&type_strhash, size);
}
void
-st_free_table(table)
- st_table *table;
+st_free_table(st_table *table)
{
register st_table_entry *ptr, *next;
int i;
@@ -253,10 +246,7 @@ st_free_table(table)
} while (0)
int
-st_lookup(table, key, value)
- st_table *table;
- register st_data_t key;
- st_data_t *value;
+st_lookup(st_table *table, register st_data_t key, st_data_t *value)
{
unsigned int hash_val, bin_pos;
register st_table_entry *ptr;
@@ -292,10 +282,7 @@ do {\
} while (0)
int
-st_insert(table, key, value)
- register st_table *table;
- register st_data_t key;
- st_data_t value;
+st_insert(register st_table *table, register st_data_t key, st_data_t value)
{
unsigned int hash_val, bin_pos;
register st_table_entry *ptr;
@@ -314,10 +301,7 @@ st_insert(table, key, value)
}
void
-st_add_direct(table, key, value)
- st_table *table;
- st_data_t key;
- st_data_t value;
+st_add_direct(st_table *table, st_data_t key, st_data_t value)
{
unsigned int hash_val, bin_pos;
@@ -327,8 +311,7 @@ st_add_direct(table, key, value)
}
static void
-rehash(table)
- register st_table *table;
+rehash(register st_table *table)
{
register st_table_entry *ptr, *next, **new_bins;
int i, old_num_bins = table->num_bins, new_num_bins;
@@ -353,8 +336,7 @@ rehash(table)
}
st_table*
-st_copy(old_table)
- st_table *old_table;
+st_copy(st_table *old_table)
{
st_table *new_table;
st_table_entry *ptr, *entry;
@@ -394,10 +376,7 @@ st_copy(old_table)
}
int
-st_delete(table, key, value)
- register st_table *table;
- register st_data_t *key;
- st_data_t *value;
+st_delete(register st_table *table, register st_data_t *key, st_data_t *value)
{
unsigned int hash_val;
st_table_entry *tmp;
@@ -436,11 +415,7 @@ st_delete(table, key, value)
}
int
-st_delete_safe(table, key, value, never)
- register st_table *table;
- register st_data_t *key;
- st_data_t *value;
- st_data_t never;
+st_delete_safe(register st_table *table, register st_data_t *key, st_data_t *value, st_data_t never)
{
unsigned int hash_val;
register st_table_entry *ptr;
@@ -467,17 +442,14 @@ st_delete_safe(table, key, value, never)
}
static int
-delete_never(key, value, never)
- st_data_t key, value, never;
+delete_never(st_data_t key, st_data_t value, st_data_t never)
{
if (value == never) return ST_DELETE;
return ST_CONTINUE;
}
void
-st_cleanup_safe(table, never)
- st_table *table;
- st_data_t never;
+st_cleanup_safe(st_table *table, st_data_t never)
{
int num_entries = table->num_entries;
@@ -486,10 +458,7 @@ st_cleanup_safe(table, never)
}
int
-st_foreach(table, func, arg)
- st_table *table;
- int (*func)();
- st_data_t arg;
+st_foreach(st_table *table, int (*func) (/* ??? */), st_data_t arg)
{
st_table_entry *ptr, *last, *tmp;
enum st_retval retval;
@@ -536,8 +505,7 @@ st_foreach(table, func, arg)
}
static int
-strhash(string)
- register const char *string;
+strhash(register const char *string)
{
register int c;
@@ -575,15 +543,13 @@ strhash(string)
}
static int
-numcmp(x, y)
- long x, y;
+numcmp(long x, long y)
{
return x != y;
}
static int
-numhash(n)
- long n;
+numhash(long n)
{
return n;
}