summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
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);
}
/*