summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-06 15:55:43 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-06 15:55:43 +0000
commit91b9d37a853d4b8629c2719328ba6473d8766959 (patch)
treeedede8c398b29110d806b1ecce1bcafa3dffb275 /hash.c
parent8eba0580798736ee144793e24afdb31d4ddb1cb5 (diff)
* st.h, st.c: Introduce new conventional typedef's, st_data_t,
st_compare_func_t, st_hash_func_t and st_each_func_t. * st.h, st.c: Do explicit function declarations and do not rely on implicit declarations. On such platforms as IA64, int argument values are NOT automatically promoted to long (64bit) values, so explicit declarations are mandatory for those functions that take long values or pointers. This fixes miniruby's coredump on FreeBSD/IA64. * class.c, eval.c, gc.c, hash.c, marshal.c, parse.y, variable.c: Add proper casts to avoid warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hash.c b/hash.c
index f2014a4..44765b7 100644
--- a/hash.c
+++ b/hash.c
@@ -144,7 +144,7 @@ static VALUE
rb_hash_foreach_call(arg)
struct rb_hash_foreach_arg *arg;
{
- st_foreach(RHASH(arg->hash)->tbl, rb_hash_foreach_iter, arg);
+ st_foreach(RHASH(arg->hash)->tbl, rb_hash_foreach_iter, (st_data_t)arg);
return Qnil;
}
@@ -276,7 +276,7 @@ rb_hash_rehash(hash)
rb_hash_modify(hash);
tbl = st_init_table_with_size(&objhash, RHASH(hash)->tbl->num_entries);
- st_foreach(RHASH(hash)->tbl, rb_hash_rehash_i, tbl);
+ st_foreach(RHASH(hash)->tbl, rb_hash_rehash_i, (st_data_t)tbl);
st_free_table(RHASH(hash)->tbl);
RHASH(hash)->tbl = tbl;
@@ -377,7 +377,7 @@ rb_hash_index(hash, value)
args[0] = value;
args[1] = Qnil;
- st_foreach(RHASH(hash)->tbl, index_i, args);
+ st_foreach(RHASH(hash)->tbl, index_i, (st_data_t)args);
return args[1];
}
@@ -449,7 +449,7 @@ rb_hash_shift(hash)
rb_hash_modify(hash);
var.stop = 0;
- st_foreach(RHASH(hash)->tbl, shift_i, &var);
+ st_foreach(RHASH(hash)->tbl, shift_i, (st_data_t)&var);
if (var.stop) {
return rb_assoc_new(var.key, var.val);
@@ -834,7 +834,7 @@ rb_hash_has_value(hash, val)
data[0] = Qfalse;
data[1] = val;
- st_foreach(RHASH(hash)->tbl, rb_hash_search_value, data);
+ st_foreach(RHASH(hash)->tbl, rb_hash_search_value, (st_data_t)data);
return data[0];
}
@@ -878,7 +878,7 @@ rb_hash_equal(hash1, hash2)
data.tbl = RHASH(hash2)->tbl;
data.result = Qtrue;
- st_foreach(RHASH(hash1)->tbl, equal_i, &data);
+ st_foreach(RHASH(hash1)->tbl, equal_i, (st_data_t)&data);
return data.result;
}