summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-13 09:56:22 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-13 09:56:22 +0000
commitaacd7710462142df7397618ffff4279e495f10f9 (patch)
tree6611fdbf0f66b471386ad19d7854275c583b8914 /io.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 'io.c')
-rw-r--r--io.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/io.c b/io.c
index 8676293a40..1aa043efae 100644
--- a/io.c
+++ b/io.c
@@ -6846,7 +6846,7 @@ io_puts_ary(VALUE ary, VALUE out, int recur)
ary = rb_check_array_type(ary);
if (NIL_P(ary)) return Qfalse;
for (i=0; i<RARRAY_LEN(ary); i++) {
- tmp = RARRAY_PTR(ary)[i];
+ tmp = RARRAY_AREF(ary, i);
rb_io_puts(1, &tmp, out);
}
return Qtrue;
@@ -8096,7 +8096,7 @@ select_internal(VALUE read, VALUE write, VALUE except, struct timeval *tp, rb_fd
if (!NIL_P(read)) {
Check_Type(read, T_ARRAY);
for (i=0; i<RARRAY_LEN(read); i++) {
- GetOpenFile(rb_io_get_io(RARRAY_PTR(read)[i]), fptr);
+ GetOpenFile(rb_io_get_io(RARRAY_AREF(read, i)), fptr);
rb_fd_set(fptr->fd, &fds[0]);
if (READ_DATA_PENDING(fptr) || READ_CHAR_PENDING(fptr)) { /* check for buffered data */
pending++;
@@ -8116,7 +8116,7 @@ select_internal(VALUE read, VALUE write, VALUE except, struct timeval *tp, rb_fd
if (!NIL_P(write)) {
Check_Type(write, T_ARRAY);
for (i=0; i<RARRAY_LEN(write); i++) {
- VALUE write_io = GetWriteIO(rb_io_get_io(RARRAY_PTR(write)[i]));
+ VALUE write_io = GetWriteIO(rb_io_get_io(RARRAY_AREF(write, i)));
GetOpenFile(write_io, fptr);
rb_fd_set(fptr->fd, &fds[1]);
if (max < fptr->fd) max = fptr->fd;
@@ -8129,7 +8129,7 @@ select_internal(VALUE read, VALUE write, VALUE except, struct timeval *tp, rb_fd
if (!NIL_P(except)) {
Check_Type(except, T_ARRAY);
for (i=0; i<RARRAY_LEN(except); i++) {
- VALUE io = rb_io_get_io(RARRAY_PTR(except)[i]);
+ VALUE io = rb_io_get_io(RARRAY_AREF(except, i));
VALUE write_io = GetWriteIO(io);
GetOpenFile(io, fptr);
rb_fd_set(fptr->fd, &fds[2]);
@@ -8160,7 +8160,7 @@ select_internal(VALUE read, VALUE write, VALUE except, struct timeval *tp, rb_fd
rb_ary_push(res, ep?rb_ary_new():rb_ary_new2(0));
if (rp) {
- list = RARRAY_PTR(res)[0];
+ list = RARRAY_AREF(res, 0);
for (i=0; i< RARRAY_LEN(read); i++) {
VALUE obj = rb_ary_entry(read, i);
VALUE io = rb_io_get_io(obj);
@@ -8173,7 +8173,7 @@ select_internal(VALUE read, VALUE write, VALUE except, struct timeval *tp, rb_fd
}
if (wp) {
- list = RARRAY_PTR(res)[1];
+ list = RARRAY_AREF(res, 1);
for (i=0; i< RARRAY_LEN(write); i++) {
VALUE obj = rb_ary_entry(write, i);
VALUE io = rb_io_get_io(obj);
@@ -8186,7 +8186,7 @@ select_internal(VALUE read, VALUE write, VALUE except, struct timeval *tp, rb_fd
}
if (ep) {
- list = RARRAY_PTR(res)[2];
+ list = RARRAY_AREF(res, 2);
for (i=0; i< RARRAY_LEN(except); i++) {
VALUE obj = rb_ary_entry(except, i);
VALUE io = rb_io_get_io(obj);