From b6ea75cfc9712b77a0886c4348d6fb519641e40e Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Mon, 21 Jan 2008 03:11:44 +0000 Subject: de K&Rify, fix prototypes --- zwgc/dictionary.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'zwgc/dictionary.c') diff --git a/zwgc/dictionary.c b/zwgc/dictionary.c index c30d73f..f6a3c74 100644 --- a/zwgc/dictionary.c +++ b/zwgc/dictionary.c @@ -66,8 +66,8 @@ static const char rcsid_dictionary_c[] = "$Id$"; * that size is a prime number. */ -TYPE_T_dictionary TYPE_T_dictionary_Create(size) - int size; +TYPE_T_dictionary +TYPE_T_dictionary_Create(int size) { int i; TYPE_T_dictionary result; @@ -94,8 +94,8 @@ TYPE_T_dictionary TYPE_T_dictionary_Create(size) * TYPE_T_dictionary_Enumerate. */ -void TYPE_T_dictionary_Destroy(d) - TYPE_T_dictionary d; +void +TYPE_T_dictionary_Destroy(TYPE_T_dictionary d) { int i; TYPE_T_dictionary_binding *binding_ptr, *new_binding_ptr; @@ -124,9 +124,8 @@ void TYPE_T_dictionary_Destroy(d) * writable by proc. */ -void TYPE_T_dictionary_Enumerate(d, proc) - TYPE_T_dictionary d; - void (*proc)(/* TYPE_T_dictionary_binding *b */); +void TYPE_T_dictionary_Enumerate(TYPE_T_dictionary d, + void (*proc)(TYPE_T_dictionary_binding *)) { int i; TYPE_T_dictionary_binding *binding_ptr; @@ -149,8 +148,8 @@ void TYPE_T_dictionary_Enumerate(d, proc) * keys over the table's slots. */ -static unsigned int dictionary__hash(s) - char *s; +static unsigned int +dictionary__hash(char *s) { unsigned int result = 0; @@ -174,9 +173,9 @@ static unsigned int dictionary__hash(s) * Note the access restrictions on bindings... */ -TYPE_T_dictionary_binding *TYPE_T_dictionary_Lookup(d, key) - TYPE_T_dictionary d; - char *key; +TYPE_T_dictionary_binding * +TYPE_T_dictionary_Lookup(TYPE_T_dictionary d, + char *key) { TYPE_T_dictionary_binding *binding_ptr; @@ -206,10 +205,10 @@ TYPE_T_dictionary_binding *TYPE_T_dictionary_Lookup(d, key) * in this case. */ -TYPE_T_dictionary_binding *TYPE_T_dictionary_Define(d, key, already_existed) - TYPE_T_dictionary d; - char *key; - int *already_existed; +TYPE_T_dictionary_binding * +TYPE_T_dictionary_Define(TYPE_T_dictionary d, + char *key, + int *already_existed) { TYPE_T_dictionary_binding **ptr_to_the_slot, *binding_ptr; @@ -245,9 +244,8 @@ TYPE_T_dictionary_binding *TYPE_T_dictionary_Define(d, key, already_existed) * before making this call. */ -void TYPE_T_dictionary_Delete(d, b) - TYPE_T_dictionary d; - TYPE_T_dictionary_binding *b; +void TYPE_T_dictionary_Delete(TYPE_T_dictionary d, + TYPE_T_dictionary_binding *b) { TYPE_T_dictionary_binding **ptr_to_binding_ptr; -- cgit v1.2.3