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

ruby-changes:33262

From: nobu <ko1@a...>
Date: Sat, 15 Mar 2014 11:19:40 +0900 (JST)
Subject: [ruby-changes:33262] nobu:r45341 (trunk): vm_method.c: cast via VALUE

nobu	2014-03-15 11:19:32 +0900 (Sat, 15 Mar 2014)

  New Revision: 45341

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

  Log:
    vm_method.c: cast via VALUE
    
    * vm_method.c (rb_add_method, rb_attr): cast between pointer and
      ID via VALUE.

  Modified files:
    trunk/vm_method.c
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 45340)
+++ vm_method.c	(revision 45341)
@@ -467,7 +467,7 @@ rb_add_method(VALUE klass, ID mid, rb_me https://github.com/ruby/ruby/blob/trunk/vm_method.c#L467
 	break;
       case VM_METHOD_TYPE_ATTRSET:
       case VM_METHOD_TYPE_IVAR:
-	def->body.attr.id = (ID)opts;
+	def->body.attr.id = (ID)(VALUE)opts;
 	RB_OBJ_WRITE(klass, &def->body.attr.location, Qfalse);
 	th = GET_THREAD();
 	cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp);
@@ -868,7 +868,7 @@ extern ID rb_check_attr_id(ID id); https://github.com/ruby/ruby/blob/trunk/vm_method.c#L868
 void
 rb_attr(VALUE klass, ID id, int read, int write, int ex)
 {
-    ID attriv;
+    VALUE attriv;
     VALUE aname;
     rb_method_flag_t noex;
 
@@ -894,7 +894,7 @@ rb_attr(VALUE klass, ID id, int read, in https://github.com/ruby/ruby/blob/trunk/vm_method.c#L894
     if (NIL_P(aname)) {
 	rb_raise(rb_eArgError, "argument needs to be symbol or string");
     }
-    attriv = rb_intern_str(rb_sprintf("@%"PRIsVALUE, aname));
+    attriv = (VALUE)rb_intern_str(rb_sprintf("@%"PRIsVALUE, aname));
     if (read) {
 	rb_add_method(klass, id, VM_METHOD_TYPE_IVAR, (void *)attriv, noex);
     }

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

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