From 5e2f227d219fe67c8c57aa32dafb61ac4591fb20 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 26 Jun 2013 13:43:22 +0000 Subject: intern.h: define rb_enumerator_size_func * include/ruby/intern.h (rb_enumerator_size_func): define strict function declaration for rb_enumeratorize_with_size(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'array.c') diff --git a/array.c b/array.c index 269400b62e..b5518bbf16 100644 --- a/array.c +++ b/array.c @@ -1665,6 +1665,12 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary) static VALUE rb_ary_length(VALUE ary); +static VALUE +ary_enum_length(VALUE ary, VALUE args, VALUE eobj) +{ + return rb_ary_length(ary); +} + /* * call-seq: * ary.each { |item| block } -> ary @@ -1689,7 +1695,7 @@ rb_ary_each(VALUE array) long i; volatile VALUE ary = array; - RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length); + RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length); for (i=0; i 0)) ? NUM2LONG(RARRAY_AREF(args, 0)) : n; @@ -4699,7 +4705,7 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary) } static VALUE -rb_ary_combination_size(VALUE ary, VALUE args) +rb_ary_combination_size(VALUE ary, VALUE args, VALUE eobj) { long n = RARRAY_LEN(ary); long k = NUM2LONG(RARRAY_AREF(args, 0)); @@ -4822,7 +4828,7 @@ rpermute0(long n, long r, long *p, long index, VALUE values) } static VALUE -rb_ary_repeated_permutation_size(VALUE ary, VALUE args) +rb_ary_repeated_permutation_size(VALUE ary, VALUE args, VALUE eobj) { long n = RARRAY_LEN(ary); long k = NUM2LONG(RARRAY_AREF(args, 0)); @@ -4915,7 +4921,7 @@ rcombinate0(long n, long r, long *p, long index, long rest, VALUE values) } static VALUE -rb_ary_repeated_combination_size(VALUE ary, VALUE args) +rb_ary_repeated_combination_size(VALUE ary, VALUE args, VALUE eobj) { long n = RARRAY_LEN(ary); long k = NUM2LONG(RARRAY_AREF(args, 0)); -- cgit v1.2.3