mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* class.c (ins_methods_push): Change type and name of parameters
to make more clear. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
32a586d738
commit
1f9af2a953
2 changed files with 12 additions and 12 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat Jun 6 15:05:47 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* class.c (ins_methods_push): Change type and name of parameters
|
||||
to make more clear.
|
||||
|
||||
Sat Jun 6 08:52:13 2015 Eric Wong <e@80x24.org>
|
||||
|
||||
* test/socket/test_nonblock.rb: try to avoid EMSGSIZE
|
||||
|
|
19
class.c
19
class.c
|
@ -1065,24 +1065,19 @@ rb_mod_ancestors(VALUE mod)
|
|||
}
|
||||
|
||||
static int
|
||||
ins_methods_push(ID name, long type, VALUE ary, rb_method_visibility_t visi)
|
||||
ins_methods_push(ID name, rb_method_visibility_t visi, VALUE ary, rb_method_visibility_t expected_visi)
|
||||
{
|
||||
if (type == METHOD_VISI_UNDEF) return ST_CONTINUE;
|
||||
if (visi == METHOD_VISI_UNDEF) return ST_CONTINUE;
|
||||
|
||||
switch (visi) {
|
||||
switch (expected_visi) {
|
||||
case METHOD_VISI_UNDEF:
|
||||
return ST_CONTINUE;
|
||||
if (visi != METHOD_VISI_PRIVATE) rb_ary_push(ary, ID2SYM(name));
|
||||
break;
|
||||
case METHOD_VISI_PRIVATE:
|
||||
case METHOD_VISI_PROTECTED:
|
||||
case METHOD_VISI_PUBLIC:
|
||||
visi = (type == (long)visi);
|
||||
if (visi == expected_visi) rb_ary_push(ary, ID2SYM(name));
|
||||
break;
|
||||
default:
|
||||
visi = (type != METHOD_VISI_PRIVATE);
|
||||
break;
|
||||
}
|
||||
if (visi) {
|
||||
rb_ary_push(ary, ID2SYM(name));
|
||||
}
|
||||
return ST_CONTINUE;
|
||||
}
|
||||
|
@ -1090,7 +1085,7 @@ ins_methods_push(ID name, long type, VALUE ary, rb_method_visibility_t visi)
|
|||
static int
|
||||
ins_methods_i(st_data_t name, st_data_t type, st_data_t ary)
|
||||
{
|
||||
return ins_methods_push((ID)name, (rb_method_visibility_t)type, (VALUE)ary, -1); /* everything but private */
|
||||
return ins_methods_push((ID)name, (rb_method_visibility_t)type, (VALUE)ary, METHOD_VISI_UNDEF); /* everything but private */
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in a new issue