* 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
This commit is contained in:
nobu 2009-02-26 10:29:13 +00:00
Родитель 25d66aebcc
Коммит cbc7f1b89b
2 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,7 @@
Thu Feb 26 19:29:10 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (hash_foreach_iter): fix for prototype.
Thu Feb 26 18:36:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (INSNS, newline.c, miniprelude.c, prelude.c),

8
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;