summaryrefslogtreecommitdiff
path: root/class.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 /class.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 'class.c')
-rw-r--r--class.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/class.c b/class.c
index a18cdbc..50f6165 100644
--- a/class.c
+++ b/class.c
@@ -54,7 +54,7 @@ clone_method(mid, body, tbl)
NODE *body;
st_table *tbl;
{
- st_insert(tbl, mid, NEW_METHOD(body->nd_body, body->nd_noex));
+ st_insert(tbl, mid, (st_data_t)NEW_METHOD(body->nd_body, body->nd_noex));
return ST_CONTINUE;
}
@@ -77,7 +77,8 @@ rb_mod_clone(module)
}
if (RCLASS(module)->m_tbl) {
RCLASS(clone)->m_tbl = st_init_numtable();
- st_foreach(RCLASS(module)->m_tbl, clone_method, RCLASS(clone)->m_tbl);
+ st_foreach(RCLASS(module)->m_tbl, clone_method,
+ (st_data_t)RCLASS(clone)->m_tbl);
}
return (VALUE)clone;
@@ -120,7 +121,8 @@ rb_singleton_class_clone(obj)
clone->iv_tbl = st_copy(RCLASS(klass)->iv_tbl);
}
clone->m_tbl = st_init_numtable();
- st_foreach(RCLASS(klass)->m_tbl, clone_method, clone->m_tbl);
+ st_foreach(RCLASS(klass)->m_tbl, clone_method,
+ (st_data_t)clone->m_tbl);
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
FL_SET(clone, FL_SINGLETON);
return (VALUE)clone;