summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-02 14:42:08 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-02 14:42:08 +0000
commit2156870525be05f0bd769af141c3f6cff9fff8c4 (patch)
tree3e6db7f9ecee480edff058e18bc7211a53296f64 /process.c
parent8581164ea67a13fad5e7d56aa4aa75a87f9eafb3 (diff)
downloadruby-2156870525be05f0bd769af141c3f6cff9fff8c4.tar.gz
* ruby.h (struct RArray): embed small arrays.
(RARRAY_LEN): defined for accessing array members. (RARRAY_PTR): ditto. * array.c: use RARRAY_LEN and RARRAY_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/process.c b/process.c
index 4797f5d1ff..843320193c 100644
--- a/process.c
+++ b/process.c
@@ -1167,11 +1167,11 @@ rb_check_argv(int argc, VALUE *argv)
prog = 0;
tmp = rb_check_array_type(argv[0]);
if (!NIL_P(tmp)) {
- if (RARRAY(tmp)->len != 2) {
+ if (RARRAY_LEN(tmp) != 2) {
rb_raise(rb_eArgError, "wrong first argument");
}
- prog = RARRAY(tmp)->ptr[0];
- argv[0] = RARRAY(tmp)->ptr[1];
+ prog = RARRAY_PTR(tmp)[0];
+ argv[0] = RARRAY_PTR(tmp)[1];
SafeStringValue(prog);
}
for (i = 0; i < argc; i++) {
@@ -2647,14 +2647,14 @@ proc_setgroups(VALUE obj, VALUE ary)
Check_Type(ary, T_ARRAY);
- ngroups = RARRAY(ary)->len;
+ ngroups = RARRAY_LEN(ary);
if (ngroups > maxgroups)
rb_raise(rb_eArgError, "too many groups, %lu max", (unsigned long)maxgroups);
groups = ALLOCA_N(rb_gid_t, ngroups);
- for (i = 0; i < ngroups && i < RARRAY(ary)->len; i++) {
- VALUE g = RARRAY(ary)->ptr[i];
+ for (i = 0; i < ngroups && i < RARRAY_LEN(ary); i++) {
+ VALUE g = RARRAY_PTR(ary)[i];
if (FIXNUM_P(g)) {
groups[i] = FIX2INT(g);