diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-13 09:56:22 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-13 09:56:22 +0000 |
commit | aacd7710462142df7397618ffff4279e495f10f9 (patch) | |
tree | 6611fdbf0f66b471386ad19d7854275c583b8914 /marshal.c | |
parent | 12bf73637b960cf0ef463f966554595ff2c37ecd (diff) |
* *.c, parse.y, insns.def: use RARRAY_AREF/ASET macro
instead of using RARRAY_PTR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r-- | marshal.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -783,7 +783,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit) w_long(len, arg); for (i=0; i<RARRAY_LEN(obj); i++) { - w_object(RARRAY_PTR(obj)[i], arg, limit); + w_object(RARRAY_AREF(obj, i), arg, limit); if (len != RARRAY_LEN(obj)) { rb_raise(rb_eRuntimeError, "array modified during dump"); } @@ -820,7 +820,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit) w_long(len, arg); mem = rb_struct_members(obj); for (i=0; i<len; i++) { - w_symbol(SYM2ID(RARRAY_PTR(mem)[i]), arg); + w_symbol(SYM2ID(RARRAY_AREF(mem, i)), arg); w_object(RSTRUCT_PTR(obj)[i], arg, limit); } } @@ -1462,7 +1462,7 @@ append_extmod(VALUE obj, VALUE extmod) { long i = RARRAY_LEN(extmod); while (i > 0) { - VALUE m = RARRAY_PTR(extmod)[--i]; + VALUE m = RARRAY_AREF(extmod, --i); rb_extend_object(obj, m); } return obj; @@ -1756,11 +1756,11 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod) for (i=0; i<len; i++) { slot = r_symbol(arg); - if (RARRAY_PTR(mem)[i] != ID2SYM(slot)) { + if (RARRAY_AREF(mem, i) != ID2SYM(slot)) { rb_raise(rb_eTypeError, "struct %s not compatible (:%s for :%s)", rb_class2name(klass), rb_id2name(slot), - rb_id2name(SYM2ID(RARRAY_PTR(mem)[i]))); + rb_id2name(SYM2ID(RARRAY_AREF(mem, i)))); } rb_ary_push(values, r_object(arg)); arg->readable -= 2; |