* class.c (class_instance_method_list): get rid of warning about

arguement type mismatch, and inline method_list().
  [ruby-core:01198]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2003-06-26 12:34:51 +00:00
Родитель 79edd1af70
Коммит 8c8e4f59c2
2 изменённых файлов: 28 добавлений и 26 удалений

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

@ -1,3 +1,9 @@
Thu Jun 26 21:34:49 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* class.c (class_instance_method_list): get rid of warning about
arguement type mismatch, and inline method_list().
[ruby-core:01198]
Wed Jun 25 12:52:58 2003 Matthew Dempsky <jivera@flame.org>
* class.c (rb_generic_class_instance_methods): merge argument

48
class.c
Просмотреть файл

@ -529,17 +529,33 @@ method_entry(key, body, list)
}
static VALUE
method_list(mod, recur, func)
class_instance_method_list(argc, argv, mod, func)
int argc;
VALUE *argv;
VALUE mod;
int recur;
int (*func)();
int (*func) _((ID, long, VALUE));
{
VALUE ary;
int recur;
st_table *list;
VALUE klass, ary;
if (argc == 0) {
#if RUBY_VERSION_CODE < 181
rb_warn("%s: parameter will default to 'true' as of 1.8.1", rb_id2name(rb_frame_last_func()));
recur = Qfalse;
#else
recur = Qtrue;
#endif
}
else {
VALUE r;
rb_scan_args(argc, argv, "01", &r);
recur = RTEST(r);
}
list = st_init_numtable();
for (klass = mod; klass; klass = RCLASS(klass)->super) {
st_foreach(RCLASS(klass)->m_tbl, method_entry, (st_data_t)list);
for (; mod; mod = RCLASS(mod)->super) {
st_foreach(RCLASS(mod)->m_tbl, method_entry, (st_data_t)list);
if (!recur) break;
}
ary = rb_ary_new();
@ -549,26 +565,6 @@ method_list(mod, recur, func)
return ary;
}
static VALUE
class_instance_method_list(argc, argv, mod, func)
int argc;
VALUE *argv;
VALUE mod;
void (*func)();
{
VALUE recur;
rb_scan_args(argc, argv, "01", &recur);
if (argc == 0) {
#if RUBY_VERSION_CODE < 181
rb_warn("%s: parameter will default to 'true' as of 1.8.1", rb_id2name(rb_frame_last_func()));
#else
recur = Qtrue;
#endif
}
return method_list(mod, RTEST(recur), func);
}
VALUE
rb_class_instance_methods(argc, argv, mod)
int argc;