aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--class.c19
2 files changed, 12 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 6518f58b50..c4f955588f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/class.c b/class.c
index 3ac2d81de1..985b6a019c 100644
--- a/class.c
+++ b/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