From 053ead36792b9501e96ddf8932dd146db17b2e4c Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 15 Mar 2014 02:19:32 +0000 Subject: [PATCH] vm_method.c: cast via VALUE * vm_method.c (rb_add_method, rb_attr): cast between pointer and ID via VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_method.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vm_method.c b/vm_method.c index 203b8b8dce..ff694ea864 100644 --- a/vm_method.c +++ b/vm_method.c @@ -467,7 +467,7 @@ rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *opts, rb_method_ 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); 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, int write, int ex) 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); }