mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
79edd1af70
commit
8c8e4f59c2
2 changed files with 28 additions and 26 deletions
|
@ -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>
|
Wed Jun 25 12:52:58 2003 Matthew Dempsky <jivera@flame.org>
|
||||||
|
|
||||||
* class.c (rb_generic_class_instance_methods): merge argument
|
* class.c (rb_generic_class_instance_methods): merge argument
|
||||||
|
|
48
class.c
48
class.c
|
@ -529,17 +529,33 @@ method_entry(key, body, list)
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
method_list(mod, recur, func)
|
class_instance_method_list(argc, argv, mod, func)
|
||||||
|
int argc;
|
||||||
|
VALUE *argv;
|
||||||
VALUE mod;
|
VALUE mod;
|
||||||
int recur;
|
int (*func) _((ID, long, VALUE));
|
||||||
int (*func)();
|
|
||||||
{
|
{
|
||||||
|
VALUE ary;
|
||||||
|
int recur;
|
||||||
st_table *list;
|
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();
|
list = st_init_numtable();
|
||||||
for (klass = mod; klass; klass = RCLASS(klass)->super) {
|
for (; mod; mod = RCLASS(mod)->super) {
|
||||||
st_foreach(RCLASS(klass)->m_tbl, method_entry, (st_data_t)list);
|
st_foreach(RCLASS(mod)->m_tbl, method_entry, (st_data_t)list);
|
||||||
if (!recur) break;
|
if (!recur) break;
|
||||||
}
|
}
|
||||||
ary = rb_ary_new();
|
ary = rb_ary_new();
|
||||||
|
@ -549,26 +565,6 @@ method_list(mod, recur, func)
|
||||||
return ary;
|
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
|
VALUE
|
||||||
rb_class_instance_methods(argc, argv, mod)
|
rb_class_instance_methods(argc, argv, mod)
|
||||||
int argc;
|
int argc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue