summaryrefslogtreecommitdiff
path: root/numeric.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 /numeric.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 'numeric.c')
-rw-r--r--numeric.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/numeric.c b/numeric.c
index 413e9a9bbc..69cc71968d 100644
--- a/numeric.c
+++ b/numeric.c
@@ -260,8 +260,8 @@ do_coerce(VALUE *x, VALUE *y, int err)
return FALSE;
}
- *x = RARRAY_PTR(ary)[0];
- *y = RARRAY_PTR(ary)[1];
+ *x = RARRAY_AREF(ary, 0);
+ *y = RARRAY_AREF(ary, 1);
return TRUE;
}
@@ -1846,8 +1846,8 @@ ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl)
static VALUE
num_step_size(VALUE from, VALUE args)
{
- VALUE to = RARRAY_PTR(args)[0];
- VALUE step = (RARRAY_LEN(args) > 1) ? RARRAY_PTR(args)[1] : INT2FIX(1);
+ VALUE to = RARRAY_AREF(args, 0);
+ VALUE step = (RARRAY_LEN(args) > 1) ? RARRAY_AREF(args, 1) : INT2FIX(1);
return ruby_num_interval_step_size(from, to, step, FALSE);
}
/*
@@ -3490,7 +3490,7 @@ fix_size(VALUE fix)
static VALUE
int_upto_size(VALUE from, VALUE args)
{
- return ruby_num_interval_step_size(from, RARRAY_PTR(args)[0], INT2FIX(1), FALSE);
+ return ruby_num_interval_step_size(from, RARRAY_AREF(args, 0), INT2FIX(1), FALSE);
}
/*
@@ -3537,7 +3537,7 @@ int_upto(VALUE from, VALUE to)
static VALUE
int_downto_size(VALUE from, VALUE args)
{
- return ruby_num_interval_step_size(from, RARRAY_PTR(args)[0], INT2FIX(-1), FALSE);
+ return ruby_num_interval_step_size(from, RARRAY_AREF(args, 0), INT2FIX(-1), FALSE);
}
/*