From 64a641cf2799c88ec11c002fc21badfb47983bf2 Mon Sep 17 00:00:00 2001 From: knu Date: Mon, 6 Jan 2003 15:55:43 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@3303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- class.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'class.c') diff --git a/class.c b/class.c index a18cdbcc9..50f61655e 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; -- cgit