summaryrefslogtreecommitdiff
path: root/ext/readline/readline.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 /ext/readline/readline.c
parent8581164ea67a13fad5e7d56aa4aa75a87f9eafb3 (diff)
* 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 'ext/readline/readline.c')
-rw-r--r--ext/readline/readline.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 94aef8db61..1e64675176 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -170,12 +170,12 @@ readline_attempted_completion_function(const char *text, int start, int end)
ary = rb_funcall(proc, rb_intern("call"), 1, rb_tainted_str_new2(text));
if (TYPE(ary) != T_ARRAY)
ary = rb_Array(ary);
- matches = RARRAY(ary)->len;
+ matches = RARRAY_LEN(ary);
if (matches == 0)
return NULL;
result = ALLOC_N(char *, matches + 2);
for (i = 0; i < matches; i++) {
- temp = rb_obj_as_string(RARRAY(ary)->ptr[i]);
+ temp = rb_obj_as_string(RARRAY_PTR(ary)[i]);
result[i + 1] = ALLOC_N(char, RSTRING_LEN(temp) + 1);
strcpy(result[i + 1], RSTRING_PTR(temp));
}
@@ -661,7 +661,7 @@ filename_completion_proc_call(VALUE self, VALUE str)
free(matches[i]);
}
free(matches);
- if (RARRAY(result)->len >= 2)
+ if (RARRAY_LEN(result) >= 2)
rb_ary_shift(result);
}
else {
@@ -686,7 +686,7 @@ username_completion_proc_call(VALUE self, VALUE str)
free(matches[i]);
}
free(matches);
- if (RARRAY(result)->len >= 2)
+ if (RARRAY_LEN(result) >= 2)
rb_ary_shift(result);
}
else {