1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

enumerator.c: use rb_enumerator_size_func

* enumerator.c (rb_enumeratorize_with_size): use strict definition
  rb_enumerator_size_func.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-06-26 14:22:23 +00:00
parent 7b52f3a722
commit e5178a2550
2 changed files with 11 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Wed Jun 26 23:22:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enumerator.c (rb_enumeratorize_with_size): use strict definition
rb_enumerator_size_func.
Wed Jun 26 23:11:14 2013 Kouhei Sutou <kou@cozmixng.org>
* gc.c (is_before_sweep): Add a missing space before a parenthesis.

View file

@ -266,7 +266,7 @@ enumerator_allocate(VALUE klass)
}
static VALUE
enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, VALUE *argv, VALUE (*size_fn)(ANYARGS), VALUE size)
enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, VALUE *argv, rb_enumerator_size_func *size_fn, VALUE size)
{
struct enumerator *ptr;
@ -402,10 +402,10 @@ rb_enumeratorize(VALUE obj, VALUE meth, int argc, VALUE *argv)
}
static VALUE
lazy_to_enum_i(VALUE self, VALUE meth, int argc, VALUE *argv, VALUE (*size_fn)(ANYARGS));
lazy_to_enum_i(VALUE self, VALUE meth, int argc, VALUE *argv, rb_enumerator_size_func *size_fn);
VALUE
rb_enumeratorize_with_size(VALUE obj, VALUE meth, int argc, VALUE *argv, VALUE (*size_fn)(ANYARGS))
rb_enumeratorize_with_size(VALUE obj, VALUE meth, int argc, VALUE *argv, rb_enumerator_size_func *size_fn)
{
/* Similar effect as calling obj.to_enum, i.e. dispatching to either
Kernel#to_enum vs Lazy#to_enum */
@ -1355,7 +1355,7 @@ lazy_initialize(int argc, VALUE *argv, VALUE self)
}
static VALUE
lazy_set_method(VALUE lazy, VALUE args, VALUE (*size_fn)(ANYARGS))
lazy_set_method(VALUE lazy, VALUE args, rb_enumerator_size_func *size_fn)
{
ID id = rb_frame_this_func();
struct enumerator *e = enumerator_ptr(lazy);
@ -1412,10 +1412,10 @@ enumerable_lazy(VALUE obj)
}
static VALUE
lazy_to_enum_i(VALUE obj, VALUE meth, int argc, VALUE *argv, VALUE (*size_fn)(ANYARGS))
lazy_to_enum_i(VALUE obj, VALUE meth, int argc, VALUE *argv, rb_enumerator_size_func *size_fn)
{
return enumerator_init(enumerator_allocate(rb_cLazy),
obj, meth, argc, argv, size_fn, Qnil);
obj, meth, argc, argv, size_fn, Qnil);
}
/*