summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2015-11-06 15:35:23 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2015-11-06 15:35:23 +0900
commit7b7b8a3392528e86a0e73da9639a368bee942b22 (patch)
tree1d1ff8b5096d3b23dfafb8633a4211148a81ee88 /ext
parentc1decb1fef5c77d84a93d5ac19a4961da914dd5c (diff)
downloadpsych-7b7b8a3392528e86a0e73da9639a368bee942b22.zip
merge r52447, r52448 and r52453 from ruby/ruby trunk
Diffstat (limited to 'ext')
-rw-r--r--ext/psych/psych_emitter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/psych/psych_emitter.c b/ext/psych/psych_emitter.c
index f77d8d7..67f54f1 100644
--- a/ext/psych/psych_emitter.c
+++ b/ext/psych/psych_emitter.c
@@ -159,7 +159,7 @@ static VALUE start_document(VALUE self, VALUE version, VALUE tags, VALUE imp)
}
if(RTEST(tags)) {
- int i = 0;
+ long i = 0;
#ifdef HAVE_RUBY_ENCODING_H
rb_encoding * encoding = rb_utf8_encoding();
#endif
@@ -170,7 +170,7 @@ static VALUE start_document(VALUE self, VALUE version, VALUE tags, VALUE imp)
tail = head;
for(i = 0; i < RARRAY_LEN(tags); i++) {
- VALUE tuple = RARRAY_PTR(tags)[i];
+ VALUE tuple = RARRAY_AREF(tags, i);
VALUE name;
VALUE value;
@@ -180,8 +180,8 @@ static VALUE start_document(VALUE self, VALUE version, VALUE tags, VALUE imp)
xfree(head);
rb_raise(rb_eRuntimeError, "tag tuple must be of length 2");
}
- name = RARRAY_PTR(tuple)[0];
- value = RARRAY_PTR(tuple)[1];
+ name = RARRAY_AREF(tuple, 0);
+ value = RARRAY_AREF(tuple, 1);
#ifdef HAVE_RUBY_ENCODING_H
name = rb_str_export_to_enc(name, encoding);
value = rb_str_export_to_enc(value, encoding);