[前][次][番号順一覧][スレッド一覧]

ruby-changes:29604

From: nobu <ko1@a...>
Date: Wed, 26 Jun 2013 22:43:41 +0900 (JST)
Subject: [ruby-changes:29604] nobu:r41656 (trunk): intern.h: define rb_enumerator_size_func

nobu	2013-06-26 22:43:22 +0900 (Wed, 26 Jun 2013)

  New Revision: 41656

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41656

  Log:
    intern.h: define rb_enumerator_size_func
    
    * include/ruby/intern.h (rb_enumerator_size_func): define strict
      function declaration for rb_enumeratorize_with_size().

  Modified files:
    trunk/ChangeLog
    trunk/array.c
    trunk/enum.c
    trunk/enumerator.c
    trunk/hash.c
    trunk/include/ruby/intern.h
    trunk/numeric.c
    trunk/range.c
    trunk/string.c
    trunk/struct.c
    trunk/vm_eval.c

Index: array.c
===================================================================
--- array.c	(revision 41655)
+++ array.c	(revision 41656)
@@ -1665,6 +1665,12 @@ rb_ary_insert(int argc, VALUE *argv, VAL https://github.com/ruby/ruby/blob/trunk/array.c#L1665
 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) https://github.com/ruby/ruby/blob/trunk/array.c#L1695
     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<RARRAY_LEN(ary); i++) {
 	rb_yield(RARRAY_AREF(ary, i));
     }
@@ -1718,7 +1724,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/array.c#L1724
 rb_ary_each_index(VALUE ary)
 {
     long i;
-    RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+    RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
 
     for (i=0; i<RARRAY_LEN(ary); i++) {
 	rb_yield(LONG2NUM(i));
@@ -1746,7 +1752,7 @@ rb_ary_reverse_each(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L1752
 {
     long len;
 
-    RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+    RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
     len = RARRAY_LEN(ary);
     while (len--) {
 	rb_yield(RARRAY_AREF(ary, len));
@@ -2507,7 +2513,7 @@ rb_ary_sort_by_bang(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L2513
 {
     VALUE sorted;
 
-    RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+    RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
     rb_ary_modify(ary);
     sorted = rb_block_call(ary, rb_intern("sort_by"), 0, 0, sort_by_i, 0);
     rb_ary_replace(ary, sorted);
@@ -2541,7 +2547,7 @@ rb_ary_collect(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L2547
     long i;
     VALUE collect;
 
-    RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+    RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
     collect = rb_ary_new2(RARRAY_LEN(ary));
     for (i = 0; i < RARRAY_LEN(ary); i++) {
 	rb_ary_push(collect, rb_yield(RARRAY_AREF(ary, i)));
@@ -2574,7 +2580,7 @@ rb_ary_collect_bang(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L2580
 {
     long i;
 
-    RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+    RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
     rb_ary_modify(ary);
     for (i = 0; i < RARRAY_LEN(ary); i++) {
 	rb_ary_store(ary, i, rb_yield(RARRAY_AREF(ary, i)));
@@ -2657,7 +2663,7 @@ rb_ary_select(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L2663
     VALUE result;
     long i;
 
-    RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+    RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
     result = rb_ary_new2(RARRAY_LEN(ary));
     for (i = 0; i < RARRAY_LEN(ary); i++) {
 	if (RTEST(rb_yield(RARRAY_AREF(ary, i)))) {
@@ -2688,7 +2694,7 @@ rb_ary_select_bang(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L2694
 {
     long i1, i2;
 
-    RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+    RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
     rb_ary_modify(ary);
     for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
 	VALUE v = RARRAY_AREF(ary, i1);
@@ -2724,7 +2730,7 @@ rb_ary_select_bang(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L2730
 static VALUE
 rb_ary_keep_if(VALUE ary)
 {
-    RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+    RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
     rb_ary_select_bang(ary);
     return ary;
 }
@@ -2982,7 +2988,7 @@ ary_reject_bang(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L2988
 static VALUE
 rb_ary_reject_bang(VALUE ary)
 {
-    RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+    RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
     return ary_reject_bang(ary);
 }
 
@@ -3004,7 +3010,7 @@ rb_ary_reject(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L3010
 {
     VALUE rejected_ary;
 
-    RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+    RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
     rejected_ary = rb_ary_new();
     ary_reject(ary, rejected_ary);
     return rejected_ary;
@@ -3031,7 +3037,7 @@ rb_ary_reject(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L3037
 static VALUE
 rb_ary_delete_if(VALUE ary)
 {
-    RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
+    RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
     ary_reject_bang(ary);
     return ary;
 }
@@ -4485,7 +4491,7 @@ rb_ary_sample(int argc, VALUE *argv, VAL https://github.com/ruby/ruby/blob/trunk/array.c#L4491
 }
 
 static VALUE
-rb_ary_cycle_size(VALUE self, VALUE args)
+rb_ary_cycle_size(VALUE self, VALUE args, VALUE eobj)
 {
     long mul;
     VALUE n = Qnil;
@@ -4622,7 +4628,7 @@ binomial_coefficient(long comb, long siz https://github.com/ruby/ruby/blob/trunk/array.c#L4628
 }
 
 static VALUE
-rb_ary_permutation_size(VALUE ary, VALUE args)
+rb_ary_permutation_size(VALUE ary, VALUE args, VALUE eobj)
 {
     long n = RARRAY_LEN(ary);
     long k = (args && (RARRAY_LEN(args) > 0)) ? NUM2LONG(RARRAY_AREF(args, 0)) : n;
@@ -4699,7 +4705,7 @@ rb_ary_permutation(int argc, VALUE *argv https://github.com/ruby/ruby/blob/trunk/array.c#L4705
 }
 
 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 https://github.com/ruby/ruby/blob/trunk/array.c#L4828
 }
 
 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, lon https://github.com/ruby/ruby/blob/trunk/array.c#L4921
 }
 
 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));
Index: include/ruby/intern.h
===================================================================
--- include/ruby/intern.h	(revision 41655)
+++ include/ruby/intern.h	(revision 41656)
@@ -198,7 +198,8 @@ VALUE rb_fiber_alive_p(VALUE); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L198
 VALUE rb_enum_values_pack(int, VALUE*);
 /* enumerator.c */
 VALUE rb_enumeratorize(VALUE, VALUE, int, VALUE *);
-VALUE rb_enumeratorize_with_size(VALUE, VALUE, int, VALUE *, VALUE (*)(ANYARGS));
+typedef VALUE rb_enumerator_size_func(VALUE, VALUE, VALUE);
+VALUE rb_enumeratorize_with_size(VALUE, VALUE, int, VALUE *, rb_enumerator_size_func *);
 #define RETURN_SIZED_ENUMERATOR(obj, argc, argv, size_fn) do {		\
 	if (!rb_block_given_p())					\
 	    return rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()),\
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41655)
+++ ChangeLog	(revision 41656)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jun 26 22:43:20 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* include/ruby/intern.h (rb_enumerator_size_func): define strict
+	  function declaration for rb_enumeratorize_with_size().
+
 Wed Jun 26 21:01:22 2013  Hiroshi Shirosaki  <h.shirosaki@g...>
 
 	* test/ruby/test_io.rb (TestIO#test_write_32bit_boundary): skip if
Index: enumerator.c
===================================================================
--- enumerator.c	(revision 41655)
+++ enumerator.c	(revision 41656)
@@ -120,7 +120,7 @@ struct enumerator { https://github.com/ruby/ruby/blob/trunk/enumerator.c#L120
     VALUE feedvalue;
     VALUE stop_exc;
     VALUE size;
-    VALUE (*size_fn)(ANYARGS);
+    rb_enumerator_size_func *size_fn;
 };
 
 static VALUE rb_cGenerator, rb_cYielder;
@@ -474,6 +474,12 @@ enumerator_with_index_i(VALUE val, VALUE https://github.com/ruby/ruby/blob/trunk/enumerator.c#L474
 static VALUE
 enumerator_size(VALUE obj);
 
+static VALUE
+enumerator_enum_size(VALUE obj, VALUE args, VALUE eobj)
+{
+    return enumerator_size(obj);
+}
+
 /*
  * call-seq:
  *   e.with_index(offset = 0) {|(*args), idx| ... }
@@ -492,7 +498,7 @@ enumerator_with_index(int argc, VALUE *a https://github.com/ruby/ruby/blob/trunk/enumerator.c#L498
     VALUE memo;
 
     rb_scan_args(argc, argv, "01", &memo);
-    RETURN_SIZED_ENUMERATOR(obj, argc, argv, enumerator_size);
+    RETURN_SIZED_ENUMERATOR(obj, argc, argv, enumerator_enum_size);
     if (NIL_P(memo))
 	memo = INT2FIX(0);
     else
@@ -557,7 +563,7 @@ enumerator_with_object_i(VALUE val, VALU https://github.com/ruby/ruby/blob/trunk/enumerator.c#L563
 static VALUE
 enumerator_with_object(VALUE obj, VALUE memo)
 {
-    RETURN_SIZED_ENUMERATOR(obj, 1, &memo, enumerator_size);
+    RETURN_SIZED_ENUMERATOR(obj, 1, &memo, enumerator_enum_size);
     enumerator_block_call(obj, enumerator_with_object_i, memo);
 
     return memo;
Index: enum.c
===================================================================
--- enum.c	(revision 41655)
+++ enum.c	(revision 41656)
@@ -312,7 +312,7 @@ find_all_i(VALUE i, VALUE ary, int argc, https://github.com/ruby/ruby/blob/trunk/enum.c#L312
 }
 
 static VALUE
-enum_size(VALUE self, VALUE args)
+enum_size(VALUE self, VALUE args, VALUE eobj)
 {
     VALUE r;
     r = rb_check_funcall(self, id_size, 0, 0);
@@ -1795,13 +1795,13 @@ each_slice_i(VALUE i, VALUE m, int argc, https://github.com/ruby/ruby/blob/trunk/enum.c#L1795
 }
 
 static VALUE
-enum_each_slice_size(VALUE obj, VALUE args)
+enum_each_slice_size(VALUE obj, VALUE args, VALUE eobj)
 {
     VALUE n, size;
     long slice_size = NUM2LONG(RARRAY_AREF(args, 0));
     if (slice_size <= 0) rb_raise(rb_eArgError, "invalid slice size");
 
-    size = enum_size(obj, 0);
+    size = enum_size(obj, 0, 0);
     if (size == Qnil) return Qnil;
 
     n = rb_funcall(size, '+', 1, LONG2NUM(slice_size-1));
@@ -1862,13 +1862,13 @@ each_cons_i(VALUE i, VALUE args, int arg https://github.com/ruby/ruby/blob/trunk/enum.c#L1862
 }
 
 static VALUE
-enum_each_cons_size(VALUE obj, VALUE args)
+enum_each_cons_size(VALUE obj, VALUE args, VALUE eobj)
 {
     VALUE n, size;
     long cons_size = NUM2LONG(RARRAY_AREF(args, 0));
     if (cons_size <= 0) rb_raise(rb_eArgError, "invalid size");
 
-    size = enum_size(obj, 0);
+    size = enum_size(obj, 0, 0);
     if (size == Qnil) return Qnil;
 
     n = rb_funcall(size, '+', 1, LONG2NUM(1 - cons_size));
@@ -2251,11 +2251,11 @@ cycle_i(VALUE i, VALUE ary, int argc, VA https://github.com/ruby/ruby/blob/trunk/enum.c#L2251
 }
 
 static VALUE
-enum_cycle_size(VALUE self, VALUE args)
+enum_cycle_size(VALUE self, VALUE args, VALUE eobj)
 {
     long mul;
     VALUE n = Qnil;
-    VALUE size = enum_size(self, args);
+    VALUE size = enum_size(self, args, 0);
 
     if (size == Qnil) return Qnil;
 
Index: string.c
===================================================================
--- string.c	(revision 41655)
+++ string.c	(revision 41656)
@@ -6291,7 +6291,7 @@ rb_str_lines(int argc, VALUE *argv, VALU https://github.com/ruby/ruby/blob/trunk/string.c#L6291
 }
 
 static VALUE
-rb_str_each_byte_size(VALUE str, VALUE args)
+rb_str_each_byte_size(VALUE str, VALUE args, VALUE eobj)
 {
     return LONG2FIX(RSTRING_LEN(str));
 }
@@ -6371,7 +6371,7 @@ rb_str_bytes(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L6371
 }
 
 static VALUE
-rb_str_each_char_size(VALUE str)
+rb_str_each_char_size(VALUE str, VALUE args, VALUE eobj)
 {
     long len = RSTRING_LEN(str);
     if (!single_byte_optimizable(str)) {
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 41655)
+++ vm_eval.c	(revision 41656)
@@ -998,7 +998,7 @@ loop_i(void) https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L998
 }
 
 static VALUE
-rb_f_loop_size(VALUE self, VALUE args)
+rb_f_loop_size(VALUE self, VALUE args, VALUE eobj)
 {
     return DBL2NUM(INFINITY);
 }
Index: range.c
===================================================================
--- range.c	(revision 41655)
+++ range.c	(revision 41656)
@@ -327,7 +327,7 @@ discrete_object_p(VALUE obj) https://github.com/ruby/ruby/blob/trunk/range.c#L327
 }
 
 static VALUE
-range_step_size(VALUE range, VALUE args)
+range_step_size(VALUE range, VALUE args, VALUE eobj)
 {
     VALUE b = RANGE_BEG(range), e = RANGE_END(range);
     VALUE step = INT2FIX(1);
@@ -716,6 +716,12 @@ range_size(VALUE range) https://github.com/ruby/ruby/blob/trunk/range.c#L716
     return Qnil;
 }
 
+static VALUE
+range_enum_size(VALUE range, VALUE args, VALUE eobj)
+{
+    return range_size(range);
+}
+
 /*
  *  call-seq:
  *     rng.each {| i | block } -> rng
@@ -742,7 +748,7 @@ range_each(VALUE range) https://github.com/ruby/ruby/blob/trunk/range.c#L748
 {
     VALUE beg, end;
 
-    RETURN_SIZED_ENUMERATOR(range, 0, 0, range_size);
+    RETURN_SIZED_ENUMERATOR(range, 0, 0, range_enum_size);
 
     beg = RANGE_BEG(range);
     end = RANGE_END(range);
Index: struct.c
===================================================================
--- struct.c	(revision 41655)
+++ struct.c	(revision 41656)
@@ -460,6 +460,12 @@ rb_struct_new(VALUE klass, ...) https://github.com/ruby/ruby/blob/trunk/struct.c#L460
 static VALUE
 rb_struct_size(VALUE s);
 
+static VALUE
+struct_enum_size(VALUE s, VALUE args, VALUE eobj)
+{
+    return rb_struct_size(s);
+}
+
 /*
  *  call-seq:
  *     struct.each {|obj| block }  -> struct
@@ -484,7 +490,7 @@ rb_struct_each(VALUE s) https://github.com/ruby/ruby/blob/trunk/struct.c#L490
 {
     long i;
 
-    RETURN_SIZED_ENUMERATOR(s, 0, 0, rb_struct_size);
+    RETURN_SIZED_ENUMERATOR(s, 0, 0, struct_enum_size);
     for (i=0; i<RSTRUCT_LEN(s); i++) {
 	rb_yield(RSTRUCT_GET(s, i));
     }
@@ -516,7 +522,7 @@ rb_struct_each_pair(VALUE s) https://github.com/ruby/ruby/blob/trunk/struct.c#L522
     VALUE members;
     long i;
 
-    RETURN_SIZED_ENUMERATOR(s, 0, 0, rb_struct_size);
+    RETURN_SIZED_ENUMERATOR(s, 0, 0, struct_enum_size);
     members = rb_struct_members(s);
     for (i=0; i<RSTRUCT_LEN(s); i++) {
 	VALUE key = rb_ary_entry(members, i);
@@ -827,7 +833,7 @@ rb_struct_select(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/struct.c#L833
     long i;
 
     rb_check_arity(argc, 0, 0);
-    RETURN_SIZED_ENUMERATOR(s, 0, 0, rb_struct_size);
+    RETURN_SIZED_ENUMERATOR(s, 0, 0, struct_enum_size);
     result = rb_ary_new();
     for (i = 0; i < RSTRUCT_LEN(s); i++) {
 	if (RTEST(rb_yield(RSTRUCT_GET(s, i)))) {
Index: hash.c
===================================================================
--- hash.c	(revision 41655)
+++ hash.c	(revision 41656)
@@ -1014,6 +1014,12 @@ delete_if_i(VALUE key, VALUE value, VALU https://github.com/ruby/ruby/blob/trunk/hash.c#L1014
 
 static VALUE rb_hash_size(VALUE hash);
 
+static VALUE
+hash_enum_size(VALUE hash, VALUE args, VALUE eobj)
+{
+    return rb_hash_size(hash);
+}
+
 /*
  *  call-seq:
  *     hsh.delete_if {| key, value | block }  -> hsh
@@ -1032,7 +1038,7 @@ static VALUE rb_hash_size(VALUE hash); https://github.com/ruby/ruby/blob/trunk/hash.c#L1038
 VALUE
 rb_hash_delete_if(VALUE hash)
 {
-    RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
+    RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
     rb_hash_modify_check(hash);
     if (RHASH(hash)->ntbl)
 	rb_hash_foreach(hash, delete_if_i, hash);
@@ -1053,7 +1059,7 @@ rb_hash_reject_bang(VALUE hash) https://github.com/ruby/ruby/blob/trunk/hash.c#L1059
 {
     st_index_t n;
 
-    RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
+    RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
     rb_hash_modify(hash);
     if (!RHASH(hash)->ntbl)
         return Qnil;
@@ -1130,7 +1136,7 @@ rb_hash_select(VALUE hash) https://github.com/ruby/ruby/blob/trunk/hash.c#L1136
 {
     VALUE result;
 
-    RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
+    RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
     result = rb_hash_new();
     rb_hash_foreach(hash, select_i, result);
     return result;
@@ -1159,7 +1165,7 @@ rb_hash_select_bang(VALUE hash) https://github.com/ruby/ruby/blob/trunk/hash.c#L1165
 {
     st_index_t n;
 
-    RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
+    RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
     rb_hash_modify_check(hash);
     if (!RHASH(hash)->ntbl)
         return Qnil;
@@ -1184,7 +1190,7 @@ rb_hash_select_bang(VALUE hash) https://github.com/ruby/ruby/blob/trunk/hash.c#L1190
 VALUE
 rb_hash_keep_if(VALUE hash)
 {
-    RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
+    RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
     rb_hash_modify_check(hash);
     if (RHASH(hash)->ntbl)
 	rb_hash_foreach(hash, keep_if_i, hash);
@@ -1424,7 +1430,7 @@ each_value_i(VALUE key, VALUE value) https://github.com/ruby/ruby/blob/trunk/hash.c#L1430
 static VALUE
 rb_hash_each_value(VALUE hash)
 {
-    RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
+    RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
     rb_hash_foreach(hash, each_value_i, 0);
     return hash;
 }
@@ -1457,7 +1463,7 @@ each_key_i(VALUE key, VALUE value) https://github.com/ruby/ruby/blob/trunk/hash.c#L1463
 static VALUE
 rb_hash_each_key(VALUE hash)
 {
-    RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
+    RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
     rb_hash_foreach(hash, each_key_i, 0);
     return hash;
 }
@@ -1494,7 +1500,7 @@ each_pair_i(VALUE key, VALUE value) https://github.com/ruby/ruby/blob/trunk/hash.c#L1500
 static VALUE
 rb_hash_each_pair(VALUE hash)
 {
-    RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
+    RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
     rb_hash_foreach(hash, each_pair_i, 0);
     return hash;
 }
@@ -2667,7 +2673,7 @@ env_keys(void) https://github.com/ruby/ruby/blob/trunk/hash.c#L2673
 }
 
 static VALUE
-rb_env_size(VALUE ehash)
+rb_env_size(VALUE ehash, VALUE args, VALUE eobj)
 {
     char **env;
     long cnt = 0;
Index: numeric.c
===================================================================
--- numeric.c	(revision 41655)
+++ numeric.c	(revision 41656)
@@ -1829,7 +1829,7 @@ ruby_num_interval_step_size(VALUE from, https://github.com/ruby/ruby/blob/trunk/numeric.c#L1829
 }
 
 static VALUE
-num_step_size(VALUE from, VALUE args)
+num_step_size(VALUE from, VALUE args, VALUE eobj)
 {
     VALUE to = RARRAY_AREF(args, 0);
     VALUE step = (RARRAY_LEN(args) > 1) ? RARRAY_AREF(args, 1) : INT2FIX(1);
@@ -3473,7 +3473,7 @@ fix_size(VALUE fix) https://github.com/ruby/ruby/blob/trunk/numeric.c#L3473
 }
 
 static VALUE
-int_upto_size(VALUE from, VALUE args)
+int_upto_size(VALUE from, VALUE args, VALUE eobj)
 {
     return ruby_num_interval_step_size(from, RARRAY_AREF(args, 0), INT2FIX(1), FALSE);
 }
@@ -3520,7 +3520,7 @@ int_upto(VALUE from, VALUE to) https://github.com/ruby/ruby/blob/trunk/numeric.c#L3520
 }
 
 static VALUE
-int_downto_size(VALUE from, VALUE args)
+int_downto_size(VALUE from, VALUE args, VALUE eobj)
 {
     return ruby_num_interval_step_size(from, RARRAY_AREF(args, 0), INT2FIX(-1), FALSE);
 }
@@ -3568,7 +3568,7 @@ int_downto(VALUE from, VALUE to) https://github.com/ruby/ruby/blob/trunk/numeric.c#L3568
 }
 
 static VALUE
-int_dotimes_size(VALUE num)
+int_dotimes_size(VALUE num, VALUE args, VALUE eobj)
 {
     if (FIXNUM_P(num)) {
 	if (NUM2LONG(num) <= 0) return INT2FIX(0);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]