From cbc7f1b89bee06ccad0915821762c41251a97aff Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 26 Feb 2009 10:29:13 +0000 Subject: [PATCH] * hash.c (hash_foreach_iter): fix for prototype. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ hash.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc30ab9f7f..1d0f702861 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Feb 26 19:29:10 2009 Nobuyoshi Nakada + + * hash.c (hash_foreach_iter): fix for prototype. + Thu Feb 26 18:36:09 2009 Nobuyoshi Nakada * common.mk (INSNS, newline.c, miniprelude.c, prelude.c), diff --git a/hash.c b/hash.c index c916ff3ab7..214143ce13 100644 --- a/hash.c +++ b/hash.c @@ -152,20 +152,20 @@ struct hash_foreach_arg { }; static int -hash_foreach_iter(VALUE key, VALUE value, struct hash_foreach_arg *arg) +hash_foreach_iter(st_data_t key, st_data_t value, struct hash_foreach_arg *arg) { int status; st_table *tbl; tbl = RHASH(arg->hash)->ntbl; - if (key == Qundef) return ST_CONTINUE; - status = (*arg->func)(key, value, arg->arg); + if ((VALUE)key == Qundef) return ST_CONTINUE; + status = (*arg->func)((VALUE)key, (VALUE)value, arg->arg); if (RHASH(arg->hash)->ntbl != tbl) { rb_raise(rb_eRuntimeError, "rehash occurred during iteration"); } switch (status) { case ST_DELETE: - st_delete_safe(tbl, (st_data_t*)&key, 0, Qundef); + st_delete_safe(tbl, &key, 0, Qundef); FL_SET(arg->hash, HASH_DELETED); case ST_CONTINUE: break;