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

ruby-changes:55237

From: ko1 <ko1@a...>
Date: Fri, 5 Apr 2019 17:41:10 +0900 (JST)
Subject: [ruby-changes:55237] ko1:r67444 (trunk): `rb_add_method` is void function.

ko1	2019-04-05 17:41:04 +0900 (Fri, 05 Apr 2019)

  New Revision: 67444

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

  Log:
    `rb_add_method` is void function.
    
    * method.h (rb_add_method): make it void function because
      nobody use a return value.

  Modified files:
    trunk/method.h
    trunk/vm_method.c
Index: method.h
===================================================================
--- method.h	(revision 67443)
+++ method.h	(revision 67444)
@@ -188,8 +188,8 @@ typedef struct rb_method_definition_stru https://github.com/ruby/ruby/blob/trunk/method.h#L188
 void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_visibility_t visi);
 void rb_add_method_iseq(VALUE klass, ID mid, const rb_iseq_t *iseq, rb_cref_t *cref, rb_method_visibility_t visi);
 void rb_add_refined_method_entry(VALUE refined_class, ID mid);
+void rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_visibility_t visi);
 
-rb_method_entry_t *rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_visibility_t visi);
 rb_method_entry_t *rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_visibility_t noex);
 rb_method_entry_t *rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, const rb_method_definition_t *def);
 
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 67443)
+++ vm_method.c	(revision 67444)
@@ -657,16 +657,14 @@ method_added(VALUE klass, ID mid) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L657
     }
 }
 
-rb_method_entry_t *
+void
 rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *opts, rb_method_visibility_t visi)
 {
-    rb_method_entry_t *me = rb_method_entry_make(klass, mid, klass, visi, type, NULL, mid, opts);
+    rb_method_entry_make(klass, mid, klass, visi, type, NULL, mid, opts);
 
     if (type != VM_METHOD_TYPE_UNDEF && type != VM_METHOD_TYPE_REFINED) {
 	method_added(klass, mid);
     }
-
-    return me;
 }
 
 MJIT_FUNC_EXPORTED void

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

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