diff options
author | Ludovic Courtès <ludo@gnu.org> | 2009-10-26 23:56:03 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2009-10-27 00:24:09 +0100 |
commit | a07010bf1828704edd9a40cadb0eaf820b8f3638 (patch) | |
tree | 78f6c3141b4d357aa537ecb78f0a346819b2f141 /libguile/hashtab.c | |
parent | f044da55c5b0c0cf444a25e5bd9a76fea5a95f2d (diff) | |
download | guile-a07010bf1828704edd9a40cadb0eaf820b8f3638.tar.gz |
Use proper fold/for-each function types in `hashtab.h'.
* libguile/hashtab.h (scm_t_hash_fold_fn, scm_t_hash_handle_fn): New
types.
(scm_internal_hash_fold, scm_internal_hash_for_each_handle): Use them.
* libguile/hashtab.c (scm_internal_hash_fold): Take an
`scm_t_hash_fold_fn'. Update callers.
(scm_internal_hash_for_each_handle): Take an `scm_t_hash_handle_fn'.
Update callers.
Diffstat (limited to 'libguile/hashtab.c')
-rw-r--r-- | libguile/hashtab.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libguile/hashtab.c b/libguile/hashtab.c index 511197781..4ba2ef9ab 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -1039,7 +1039,8 @@ SCM_DEFINE (scm_hashx_remove_x, "hashx-remove!", 4, 0, 0, static const char s_scm_hash_fold[]; SCM -scm_internal_hash_fold (SCM (*fn) (), void *closure, SCM init, SCM table) +scm_internal_hash_fold (scm_t_hash_fold_fn fn, void *closure, + SCM init, SCM table) { long i, n; SCM buckets, result = init; @@ -1103,7 +1104,8 @@ scm_internal_hash_fold (SCM (*fn) (), void *closure, SCM init, SCM table) static const char s_scm_hash_for_each[]; void -scm_internal_hash_for_each_handle (SCM (*fn) (), void *closure, SCM table) +scm_internal_hash_for_each_handle (scm_t_hash_handle_fn fn, void *closure, + SCM table) { long i, n; SCM buckets; @@ -1145,7 +1147,8 @@ SCM_DEFINE (scm_hash_fold, "hash-fold", 3, 0, 0, SCM_VALIDATE_PROC (1, proc); if (!SCM_HASHTABLE_P (table)) SCM_VALIDATE_VECTOR (3, table); - return scm_internal_hash_fold (scm_call_3, (void *) SCM_UNPACK (proc), init, table); + return scm_internal_hash_fold ((scm_t_hash_fold_fn) scm_call_3, + (void *) SCM_UNPACK (proc), init, table); } #undef FUNC_NAME @@ -1185,7 +1188,7 @@ SCM_DEFINE (scm_hash_for_each_handle, "hash-for-each-handle", 2, 0, 0, if (!SCM_HASHTABLE_P (table)) SCM_VALIDATE_VECTOR (2, table); - scm_internal_hash_for_each_handle (call, + scm_internal_hash_for_each_handle ((scm_t_hash_handle_fn) call, (void *) SCM_UNPACK (proc), table); return SCM_UNSPECIFIED; |