summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-13 09:56:22 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-13 09:56:22 (GMT)
commitaacd7710462142df7397618ffff4279e495f10f9 (patch)
tree6611fdbf0f66b471386ad19d7854275c583b8914 /pack.c
parent12bf73637b960cf0ef463f966554595ff2c37ecd (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 'pack.c')
-rw-r--r--pack.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pack.c b/pack.c
index 644ffd9..ea83b0c 100644
--- a/pack.c
+++ b/pack.c
@@ -421,8 +421,8 @@ pack_pack(VALUE ary, VALUE fmt)
idx = 0;
#define TOO_FEW (rb_raise(rb_eArgError, toofew), 0)
-#define THISFROM (items > 0 ? RARRAY_PTR(ary)[idx] : TOO_FEW)
-#define NEXTFROM (items-- > 0 ? RARRAY_PTR(ary)[idx++] : TOO_FEW)
+#define THISFROM (items > 0 ? RARRAY_AREF(ary, idx) : TOO_FEW)
+#define NEXTFROM (items-- > 0 ? RARRAY_AREF(ary, idx++) : TOO_FEW)
while (p < pend) {
int explicit_endian = 0;
@@ -1020,9 +1020,9 @@ pack_pack(VALUE ary, VALUE fmt)
VALUE big128 = rb_uint2big(128);
while (RB_TYPE_P(from, T_BIGNUM)) {
from = rb_big_divmod(from, big128);
- c = castchar(NUM2INT(RARRAY_PTR(from)[1]) | 0x80); /* mod */
+ c = castchar(NUM2INT(RARRAY_AREF(from, 1)) | 0x80); /* mod */
rb_str_buf_cat(buf, &c, sizeof(char));
- from = RARRAY_PTR(from)[0]; /* div */
+ from = RARRAY_AREF(from, 0); /* div */
}
}