зеркало из https://github.com/github/ruby.git
Follows callback declaration updates
This commit is contained in:
Родитель
4209066f0e
Коммит
6a0d2bc2af
|
@ -166,7 +166,7 @@ static VALUE array_spec_rb_assoc_new(VALUE self, VALUE first, VALUE second) {
|
||||||
return rb_assoc_new(first, second);
|
return rb_assoc_new(first, second);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE copy_ary(VALUE el, VALUE new_ary) {
|
static VALUE copy_ary(RB_BLOCK_CALL_FUNC_ARGLIST(el, new_ary)) {
|
||||||
return rb_ary_push(new_ary, el);
|
return rb_ary_push(new_ary, el);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ static VALUE array_spec_rb_iterate(VALUE self, VALUE ary) {
|
||||||
return new_ary;
|
return new_ary;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE sub_pair(VALUE el, VALUE holder) {
|
static VALUE sub_pair(RB_BLOCK_CALL_FUNC_ARGLIST(el, holder)) {
|
||||||
return rb_ary_push(holder, rb_ary_entry(el, 1));
|
return rb_ary_push(holder, rb_ary_entry(el, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ static VALUE array_spec_rb_iterate_each_pair(VALUE self, VALUE obj) {
|
||||||
return new_ary;
|
return new_ary;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE iter_yield(VALUE el, VALUE ary) {
|
static VALUE iter_yield(RB_BLOCK_CALL_FUNC_ARGLIST(el, ary)) {
|
||||||
rb_yield(el);
|
rb_yield(el);
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,10 @@ VALUE kernel_spec_call_proc(VALUE arg_array) {
|
||||||
return rb_funcall(proc, rb_intern("call"), 1, arg);
|
return rb_funcall(proc, rb_intern("call"), 1, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VALUE kernel_spec_call_proc_raise(VALUE arg_array, VALUE raised_exc) {
|
||||||
|
return kernel_spec_call_proc(arg_array);
|
||||||
|
}
|
||||||
|
|
||||||
static VALUE kernel_spec_rb_block_given_p(VALUE self) {
|
static VALUE kernel_spec_rb_block_given_p(VALUE self) {
|
||||||
return rb_block_given_p() ? Qtrue : Qfalse;
|
return rb_block_given_p() ? Qtrue : Qfalse;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +34,7 @@ VALUE kernel_spec_rb_block_lambda(VALUE self) {
|
||||||
return rb_block_lambda();
|
return rb_block_lambda();
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE block_call_inject(VALUE yield_value, VALUE data2) {
|
VALUE block_call_inject(RB_BLOCK_CALL_FUNC_ARGLIST(yield_value, data2)) {
|
||||||
/* yield_value yields the first block argument */
|
/* yield_value yields the first block argument */
|
||||||
VALUE elem = yield_value;
|
VALUE elem = yield_value;
|
||||||
VALUE elem_incr = INT2FIX(FIX2INT(elem) + 1);
|
VALUE elem_incr = INT2FIX(FIX2INT(elem) + 1);
|
||||||
|
@ -41,7 +45,7 @@ VALUE kernel_spec_rb_block_call(VALUE self, VALUE ary) {
|
||||||
return rb_block_call(ary, rb_intern("map"), 0, NULL, block_call_inject, Qnil);
|
return rb_block_call(ary, rb_intern("map"), 0, NULL, block_call_inject, Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE block_call_inject_multi_arg(VALUE yield_value, VALUE data2, int argc, VALUE argv[]) {
|
VALUE block_call_inject_multi_arg(RB_BLOCK_CALL_FUNC_ARGLIST(yield_value, data2)) {
|
||||||
/* yield_value yields the first block argument */
|
/* yield_value yields the first block argument */
|
||||||
VALUE sum = yield_value;
|
VALUE sum = yield_value;
|
||||||
VALUE elem = argv[1];
|
VALUE elem = argv[1];
|
||||||
|
@ -80,7 +84,7 @@ VALUE kernel_spec_rb_ensure(VALUE self, VALUE main_proc, VALUE arg,
|
||||||
kernel_spec_call_proc, ensure_array);
|
kernel_spec_call_proc, ensure_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE kernel_spec_call_proc_with_catch(VALUE arg, VALUE data) {
|
VALUE kernel_spec_call_proc_with_catch(RB_BLOCK_CALL_FUNC_ARGLIST(arg, data)) {
|
||||||
return rb_funcall(data, rb_intern("call"), 0);
|
return rb_funcall(data, rb_intern("call"), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +92,7 @@ VALUE kernel_spec_rb_catch(VALUE self, VALUE sym, VALUE main_proc) {
|
||||||
return rb_catch(StringValuePtr(sym), kernel_spec_call_proc_with_catch, main_proc);
|
return rb_catch(StringValuePtr(sym), kernel_spec_call_proc_with_catch, main_proc);
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE kernel_spec_call_proc_with_catch_obj(VALUE arg, VALUE data) {
|
VALUE kernel_spec_call_proc_with_catch_obj(RB_BLOCK_CALL_FUNC_ARGLIST(arg, data)) {
|
||||||
return rb_funcall(data, rb_intern("call"), 0);
|
return rb_funcall(data, rb_intern("call"), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +165,7 @@ VALUE kernel_spec_rb_rescue2(int argc, VALUE *args, VALUE self) {
|
||||||
rb_ary_push(raise_array, args[3]);
|
rb_ary_push(raise_array, args[3]);
|
||||||
|
|
||||||
return rb_rescue2(kernel_spec_call_proc, main_array,
|
return rb_rescue2(kernel_spec_call_proc, main_array,
|
||||||
kernel_spec_call_proc, raise_array, args[4], args[5], (VALUE)0);
|
kernel_spec_call_proc_raise, raise_array, args[4], args[5], (VALUE)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE kernel_spec_rb_protect_yield(VALUE self, VALUE obj, VALUE ary) {
|
static VALUE kernel_spec_rb_protect_yield(VALUE self, VALUE obj, VALUE ary) {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
VALUE proc_spec_rb_proc_new_function(VALUE args) {
|
VALUE proc_spec_rb_proc_new_function(RB_BLOCK_CALL_FUNC_ARGLIST(args, dummy)) {
|
||||||
return rb_funcall(args, rb_intern("inspect"), 0);
|
return rb_funcall(args, rb_intern("inspect"), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,8 @@ static VALUE thread_spec_rb_thread_wait_for(VALUE self, VALUE s, VALUE ms) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VALUE thread_spec_call_proc(VALUE arg_array) {
|
VALUE thread_spec_call_proc(void *arg_ptr) {
|
||||||
|
VALUE arg_array = (VALUE)arg_ptr;
|
||||||
VALUE arg = rb_ary_pop(arg_array);
|
VALUE arg = rb_ary_pop(arg_array);
|
||||||
VALUE proc = rb_ary_pop(arg_array);
|
VALUE proc = rb_ary_pop(arg_array);
|
||||||
return rb_funcall(proc, rb_intern("call"), 1, arg);
|
return rb_funcall(proc, rb_intern("call"), 1, arg);
|
||||||
|
@ -125,7 +126,7 @@ static VALUE thread_spec_rb_thread_create(VALUE self, VALUE proc, VALUE arg) {
|
||||||
rb_ary_push(args, proc);
|
rb_ary_push(args, proc);
|
||||||
rb_ary_push(args, arg);
|
rb_ary_push(args, arg);
|
||||||
|
|
||||||
return rb_thread_create((VALUE (*)(void *))thread_spec_call_proc, (void*)args);
|
return rb_thread_create(thread_spec_call_proc, (void*)args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче