From 05e2cba4dc2d2ddd48bbe849acaaa511e181a1a6 Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 2 Sep 2006 14:42:08 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@10833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/iconv/iconv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/iconv') diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 0c89c2ab1..0a5d0dfac 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -350,7 +350,7 @@ iconv_convert(iconv_t cd, VALUE str, int start, int length, struct iconv_env_t* unsigned int i; rescue = iconv_fail(error, Qnil, Qnil, env, 0); if (TYPE(rescue) == T_ARRAY) { - str = RARRAY(rescue)->len > 0 ? RARRAY(rescue)->ptr[0] : Qnil; + str = RARRAY_LEN(rescue) > 0 ? RARRAY_PTR(rescue)[0] : Qnil; } if (FIXNUM_P(str) && (i = FIX2INT(str)) <= 0xff) { char c = i; @@ -434,9 +434,9 @@ iconv_convert(iconv_t cd, VALUE str, int start, int length, struct iconv_env_t* str = rb_str_derive(str, inptr, inlen); rescue = iconv_fail(error, ret, str, env, errmsg); if (TYPE(rescue) == T_ARRAY) { - if ((len = RARRAY(rescue)->len) > 0) - rb_str_concat(ret, RARRAY(rescue)->ptr[0]); - if (len > 1 && !NIL_P(str = RARRAY(rescue)->ptr[1])) { + if ((len = RARRAY_LEN(rescue)) > 0) + rb_str_concat(ret, RARRAY_PTR(rescue)[0]); + if (len > 1 && !NIL_P(str = RARRAY_PTR(rescue)[1])) { StringValue(str); inlen = length = RSTRING_LEN(str); instart = inptr = RSTRING_PTR(str); -- cgit