diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1999-07-31 09:04:46 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1999-07-31 09:04:46 +0000 |
commit | b94903c2c12b68fcac5ccffc4640253ef4fbfbe8 (patch) | |
tree | 05bdd4d496385a759a21f0aaa469f93bf3258139 /libguile/hashtab.c | |
parent | 82a48a57472ee1bad498ff58982e8cf66f423478 (diff) | |
download | guile-b94903c2c12b68fcac5ccffc4640253ef4fbfbe8.tar.gz |
* hashtab.c: Bugfix: Don't declare s_hash_fold without storage
size. (Thanks to James Dean Palmer.)
Diffstat (limited to 'libguile/hashtab.c')
-rw-r--r-- | libguile/hashtab.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/libguile/hashtab.c b/libguile/hashtab.c index 8ef309217..c2fb1ce7a 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -529,7 +529,23 @@ scm_hashx_remove_x (hash, assoc, delete, table, obj) return scm_hash_fn_remove_x (table, obj, scm_ihashx, scm_sloppy_assx, scm_delx_x, 0); } -static const char s_hash_fold[]; +static SCM +fold_proc (void *proc, SCM key, SCM data, SCM value) +{ + return scm_apply ((SCM) proc, SCM_LIST3 (key, data, value), SCM_EOL); +} + +SCM_PROC (s_hash_fold, "hash-fold", 3, 0, 0, scm_hash_fold); + +SCM +scm_hash_fold (SCM proc, SCM init, SCM table) +{ + SCM_ASSERT (SCM_NIMP (table) && SCM_VECTORP (table), + table, SCM_ARG1, s_hash_fold); + SCM_ASSERT (SCM_NIMP (proc) && SCM_NFALSEP (scm_procedure_p (proc)), + proc, SCM_ARG2, s_hash_fold); + return scm_internal_hash_fold (fold_proc, (void *) proc, init, table); +} SCM scm_internal_hash_fold (SCM (*fn) (), void *closure, SCM init, SCM table) @@ -553,24 +569,6 @@ scm_internal_hash_fold (SCM (*fn) (), void *closure, SCM init, SCM table) return result; } -static SCM -fold_proc (void *proc, SCM key, SCM data, SCM value) -{ - return scm_apply ((SCM) proc, SCM_LIST3 (key, data, value), SCM_EOL); -} - -SCM_PROC (s_hash_fold, "hash-fold", 3, 0, 0, scm_hash_fold); - -SCM -scm_hash_fold (SCM proc, SCM init, SCM table) -{ - SCM_ASSERT (SCM_NIMP (table) && SCM_VECTORP (table), - table, SCM_ARG1, s_hash_fold); - SCM_ASSERT (SCM_NIMP (proc) && SCM_NFALSEP (scm_procedure_p (proc)), - proc, SCM_ARG2, s_hash_fold); - return scm_internal_hash_fold (fold_proc, (void *) proc, init, table); -} - |