From d587c9e8b27219e68f8813fb648fc6913c93be0f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 20 Oct 2009 00:10:18 +0200 Subject: Use proper types for hash/assoc functions in `hashtab.h'. Partly fixes bug #23681 ("Function declarators with empty parentheses should not be used"). * libguile/goops.c (scm_wrap_component): Cast `scm_sloppy_assq'. * libguile/hashtab.c (scm_hash_fn_get_handle): Update to take functions of type `scm_t_hash_fn' and `scm_t_assoc_fn'. Update callers. (scm_ihashx): Change to match `scm_t_hash_fn'. (scm_sloppy_assx): Change to match `scm_t_assoc_fn'. * libguile/hashtab.h (scm_t_hash_fn, scm_t_assoc_fn): New types. (scm_t_hashtable)[hash_fn]: Change to `scm_t_hash_fn'. (scm_i_rehash, scm_hash_fn_get_handle, scm_hash_fn_create_handle_x, scm_hash_fn_ref, scm_hash_fn_set_x, scm_hash_fn_remove_x): Change to take `scm_t_hash_fn' and `scm_t_assoc_fn' parameters. * libguile/srcprop.h (scm_whash_get_handle, scm_whash_create_handle, scm_whash_lookup): Implement in terms of `scm_hashq_*' instead of `scm_hash_fn_*'. * libguile/struct.c (scm_struct_ihashq): Change to match `scm_t_hash_fn'. (scm_struct_create_handle): Cast `scm_sloppy_assq'. * libguile/struct.h (scm_struct_ihashq): Update, make internal. --- libguile/struct.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libguile/struct.c') diff --git a/libguile/struct.c b/libguile/struct.c index 7b25f7fef..9dd900e37 100644 --- a/libguile/struct.c +++ b/libguile/struct.c @@ -795,7 +795,7 @@ SCM_DEFINE (scm_struct_vtable_tag, "struct-vtable-tag", 1, 0, 0, */ unsigned long -scm_struct_ihashq (SCM obj, unsigned long n) +scm_struct_ihashq (SCM obj, unsigned long n, void *closure) { /* The length of the hash table should be a relative prime it's not necessary to shift down the address. */ @@ -809,7 +809,7 @@ scm_struct_create_handle (SCM obj) obj, SCM_BOOL_F, scm_struct_ihashq, - scm_sloppy_assq, + (scm_t_assoc_fn) scm_sloppy_assq, 0); if (scm_is_false (SCM_CDR (handle))) SCM_SETCDR (handle, scm_cons (SCM_BOOL_F, SCM_BOOL_F)); -- cgit v1.2.3