summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-15 02:19:32 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-15 02:19:32 (GMT)
commit053ead36792b9501e96ddf8932dd146db17b2e4c (patch)
tree6e0a4032b0bb0c4ceea6d3a70b5e8109f434ecdc /vm_method.c
parent47aa0056abc3fbc7f323e891d89b35a250c1ee5e (diff)
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
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vm_method.c b/vm_method.c
index 203b8b8..ff694ea 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);
}