[前][次][番号順一覧][スレッド一覧]

ruby-changes:38651

From: ko1 <ko1@a...>
Date: Wed, 3 Jun 2015 00:07:19 +0900 (JST)
Subject: [ruby-changes:38651] ko1:r50732 (trunk): * vm_method.c (rb_alias): rename parameter names.

ko1	2015-06-03 00:06:29 +0900 (Wed, 03 Jun 2015)

  New Revision: 50732

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50732

  Log:
    * vm_method.c (rb_alias): rename parameter names.

  Modified files:
    trunk/ChangeLog
    trunk/vm_method.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50731)
+++ ChangeLog	(revision 50732)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jun  3 00:04:51 2015  Koichi Sasada  <ko1@a...>
+
+	* vm_method.c (rb_alias): rename parameter names.
+
 Tue Jun  2 23:27:18 2015  Koichi Sasada  <ko1@a...>
 
 	* method.h: remove rb_method_iseq_t::iseqval.
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 50731)
+++ vm_method.c	(revision 50732)
@@ -1348,9 +1348,9 @@ rb_hash_method_entry(st_index_t hash, co https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1348
 }
 
 void
-rb_alias(VALUE klass, ID name, ID def)
+rb_alias(VALUE klass, ID alias_name, ID original_name)
 {
-    VALUE target_klass = klass;
+    const VALUE target_klass = klass;
     VALUE defined_class;
     rb_method_entry_t *orig_me;
     rb_method_flag_t flag = NOEX_UNDEF;
@@ -1362,7 +1362,7 @@ rb_alias(VALUE klass, ID name, ID def) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1362
     rb_frozen_class_p(klass);
 
   again:
-    orig_me = search_method(klass, def, &defined_class);
+    orig_me = search_method(klass, original_name, &defined_class);
     if (orig_me && orig_me->def->type == VM_METHOD_TYPE_REFINED) {
 	orig_me = rb_resolve_refined_method(Qnil, orig_me, &defined_class);
     }
@@ -1370,15 +1370,15 @@ rb_alias(VALUE klass, ID name, ID def) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1370
     if (UNDEFINED_METHOD_ENTRY_P(orig_me) ||
 	UNDEFINED_REFINED_METHOD_P(orig_me->def)) {
 	if ((!RB_TYPE_P(klass, T_MODULE)) ||
-	    (orig_me = search_method(rb_cObject, def, &defined_class),
+	    (orig_me = search_method(rb_cObject, original_name, &defined_class),
 	     UNDEFINED_METHOD_ENTRY_P(orig_me))) {
-	    rb_print_undef(klass, def, 0);
+	    rb_print_undef(klass, original_name, 0);
 	}
     }
 
     if (orig_me->def->type == VM_METHOD_TYPE_ZSUPER) {
 	klass = RCLASS_SUPER(klass);
-	def = orig_me->def->original_id;
+	original_name = orig_me->def->original_id;
 	flag = orig_me->def->flag;
 	goto again;
     }
@@ -1397,13 +1397,13 @@ rb_alias(VALUE klass, ID name, ID def) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1397
 	}
 
 	/* make mthod entry */
-	alias_me = rb_add_method(target_klass, name, VM_METHOD_TYPE_ALIAS, rb_method_entry_clone(orig_me), flag);
+	alias_me = rb_add_method(target_klass, alias_name, VM_METHOD_TYPE_ALIAS, rb_method_entry_clone(orig_me), flag);
 	RB_OBJ_WRITE(alias_me, &alias_me->klass, defined_class);
 	alias_me->def->original_id = orig_me->called_id;
-	*(ID *)&alias_me->def->body.alias.original_me->called_id = name;
+	*(ID *)&alias_me->def->body.alias.original_me->called_id = alias_name;
     }
     else {
-	method_entry_set(target_klass, name, orig_me, flag, defined_class);
+	method_entry_set(target_klass, alias_name, orig_me, flag, defined_class);
     }
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]