summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-29 07:59:14 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-29 07:59:14 (GMT)
commit7566c49068869c222385ffb26bf91b666b3390b1 (patch)
treeabb203e4d6cf86b42d8e7b9d260abf2daef57e00 /enumerator.c
parentf0e73fc9862c8d2c57a89349fb79012b826b8245 (diff)
ruby/ruby.h: RB_BLOCK_CALL_FUNC_ARGLIST
* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration argument list of rb_block_call_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/enumerator.c b/enumerator.c
index 038773e..242530c 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -493,7 +493,7 @@ enumerator_each(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-enumerator_with_index_i(VALUE val, VALUE m, int argc, VALUE *argv, VALUE blockarg)
+enumerator_with_index_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
VALUE *memo = (VALUE *)m;
VALUE idx = *memo;
@@ -557,7 +557,7 @@ enumerator_each_with_index(VALUE obj)
}
static VALUE
-enumerator_with_object_i(VALUE val, VALUE memo, int argc, VALUE *argv, VALUE blockarg)
+enumerator_with_object_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, memo))
{
if (argc <= 1)
return rb_yield_values(2, val, memo);
@@ -604,7 +604,7 @@ enumerator_with_object(VALUE obj, VALUE memo)
}
static VALUE
-next_ii(VALUE i, VALUE obj, int argc, VALUE *argv, VALUE blockarg)
+next_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, obj))
{
struct enumerator *e = enumerator_ptr(obj);
VALUE feedvalue = Qnil;
@@ -1147,7 +1147,7 @@ static VALUE yielder_yield_push(VALUE obj, VALUE args)
}
static VALUE
-yielder_yield_i(VALUE obj, VALUE memo, int argc, VALUE *argv, VALUE blockarg)
+yielder_yield_i(RB_BLOCK_CALL_FUNC_ARGLIST(obj, memo))
{
return rb_yield_values2(argc, argv);
}
@@ -1318,7 +1318,7 @@ lazy_receiver_size(VALUE generator, VALUE args, VALUE lazy)
}
static VALUE
-lazy_init_iterator(VALUE val, VALUE m, int argc, VALUE *argv, VALUE blockarg)
+lazy_init_iterator(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
VALUE result;
if (argc == 1) {
@@ -1344,7 +1344,7 @@ lazy_init_iterator(VALUE val, VALUE m, int argc, VALUE *argv, VALUE blockarg)
}
static VALUE
-lazy_init_block_i(VALUE val, VALUE m, int argc, VALUE *argv, VALUE blockarg)
+lazy_init_block_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
rb_block_call(m, id_each, argc-1, argv+1, lazy_init_iterator, val);
return Qnil;
@@ -1504,7 +1504,7 @@ lazy_to_enum(int argc, VALUE *argv, VALUE self)
}
static VALUE
-lazy_map_func(VALUE val, VALUE m, int argc, VALUE *argv, VALUE blockarg)
+lazy_map_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
VALUE result = rb_yield_values2(argc - 1, &argv[1]);
@@ -1525,7 +1525,7 @@ lazy_map(VALUE obj)
}
static VALUE
-lazy_flat_map_i(VALUE i, VALUE yielder, int argc, VALUE *argv, VALUE blockarg)
+lazy_flat_map_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, yielder))
{
return rb_funcall2(yielder, id_yield, argc, argv);
}
@@ -1554,7 +1554,7 @@ lazy_flat_map_to_ary(VALUE obj, VALUE yielder)
}
static VALUE
-lazy_flat_map_func(VALUE val, VALUE m, int argc, VALUE *argv, VALUE blockarg)
+lazy_flat_map_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
VALUE result = rb_yield_values2(argc - 1, &argv[1]);
if (RB_TYPE_P(result, T_ARRAY)) {
@@ -1610,7 +1610,7 @@ lazy_flat_map(VALUE obj)
}
static VALUE
-lazy_select_func(VALUE val, VALUE m, int argc, VALUE *argv, VALUE blockarg)
+lazy_select_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
VALUE element = rb_enum_values_pack(argc - 1, argv + 1);
@@ -1633,7 +1633,7 @@ lazy_select(VALUE obj)
}
static VALUE
-lazy_reject_func(VALUE val, VALUE m, int argc, VALUE *argv, VALUE blockarg)
+lazy_reject_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
VALUE element = rb_enum_values_pack(argc - 1, argv + 1);
@@ -1656,7 +1656,7 @@ lazy_reject(VALUE obj)
}
static VALUE
-lazy_grep_func(VALUE val, VALUE m, int argc, VALUE *argv, VALUE blockarg)
+lazy_grep_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
VALUE i = rb_enum_values_pack(argc - 1, argv + 1);
VALUE result = rb_funcall(m, id_eqq, 1, i);
@@ -1668,7 +1668,7 @@ lazy_grep_func(VALUE val, VALUE m, int argc, VALUE *argv, VALUE blockarg)
}
static VALUE
-lazy_grep_iter(VALUE val, VALUE m, int argc, VALUE *argv, VALUE blockarg)
+lazy_grep_iter(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
VALUE i = rb_enum_values_pack(argc - 1, argv + 1);
VALUE result = rb_funcall(m, id_eqq, 1, i);
@@ -1702,7 +1702,7 @@ next_stopped(VALUE obj)
}
static VALUE
-lazy_zip_arrays_func(VALUE val, VALUE arrays, int argc, VALUE *argv, VALUE blockarg)
+lazy_zip_arrays_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, arrays))
{
VALUE yielder, ary, memo;
long i, count;
@@ -1722,7 +1722,7 @@ lazy_zip_arrays_func(VALUE val, VALUE arrays, int argc, VALUE *argv, VALUE block
}
static VALUE
-lazy_zip_func(VALUE val, VALUE zip_args, int argc, VALUE *argv, VALUE blockarg)
+lazy_zip_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, zip_args))
{
VALUE yielder, ary, arg, v;
long i;
@@ -1787,7 +1787,7 @@ lazy_zip(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-lazy_take_func(VALUE val, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+lazy_take_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, args))
{
long remain;
VALUE memo = rb_attr_get(argv[0], id_memo);
@@ -1836,7 +1836,7 @@ lazy_take(VALUE obj, VALUE n)
}
static VALUE
-lazy_take_while_func(VALUE val, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+lazy_take_while_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, args))
{
VALUE result = rb_yield_values2(argc - 1, &argv[1]);
if (!RTEST(result)) return Qundef;
@@ -1870,7 +1870,7 @@ lazy_drop_size(VALUE generator, VALUE args, VALUE lazy)
}
static VALUE
-lazy_drop_func(VALUE val, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+lazy_drop_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, args))
{
long remain;
VALUE memo = rb_attr_get(argv[0], id_memo);
@@ -1900,7 +1900,7 @@ lazy_drop(VALUE obj, VALUE n)
}
static VALUE
-lazy_drop_while_func(VALUE val, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+lazy_drop_while_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, args))
{
VALUE memo = rb_attr_get(argv[0], id_memo);
if (NIL_P(memo) && !RTEST(rb_yield_values2(argc - 1, &argv[1]))) {