vm_eval.c: suppress warnings
* vm_eval.c (iterate_method): split to suppress false warnings by gcc 4.4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dd6ab6b811
commit
2303483dde
29
vm_eval.c
29
vm_eval.c
@ -1099,32 +1099,28 @@ static const char *
|
|||||||
vm_frametype_name(const rb_control_frame_t *cfp);
|
vm_frametype_name(const rb_control_frame_t *cfp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
VALUE
|
static VALUE
|
||||||
rb_iterate(VALUE (* it_proc) (VALUE), VALUE data1,
|
rb_iterate0(VALUE (* it_proc) (VALUE), VALUE data1,
|
||||||
VALUE (* bl_proc) (ANYARGS), VALUE data2)
|
const struct vm_ifunc *const ifunc,
|
||||||
|
rb_thread_t *const th)
|
||||||
{
|
{
|
||||||
int state;
|
int state;
|
||||||
volatile VALUE retval = Qnil;
|
volatile VALUE retval = Qnil;
|
||||||
struct vm_ifunc *ifunc = bl_proc ?
|
rb_control_frame_t *const cfp = th->cfp;
|
||||||
IFUNC_NEW(bl_proc, data2, rb_frame_this_func()) : 0;
|
|
||||||
rb_thread_t *th = GET_THREAD();
|
|
||||||
rb_control_frame_t *volatile cfp = th->cfp;
|
|
||||||
|
|
||||||
TH_PUSH_TAG(th);
|
TH_PUSH_TAG(th);
|
||||||
state = TH_EXEC_TAG();
|
state = TH_EXEC_TAG();
|
||||||
if (state == 0) {
|
if (state == 0) {
|
||||||
VAR_INITIALIZED(th);
|
|
||||||
VAR_INITIALIZED(ifunc);
|
|
||||||
iter_retry:
|
iter_retry:
|
||||||
{
|
{
|
||||||
rb_block_t *blockptr;
|
rb_block_t *blockptr;
|
||||||
if (bl_proc) {
|
if (ifunc) {
|
||||||
blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(th->cfp);
|
blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp);
|
||||||
blockptr->iseq = (void *)ifunc;
|
blockptr->iseq = (void *)ifunc;
|
||||||
blockptr->proc = 0;
|
blockptr->proc = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
blockptr = VM_CF_BLOCK_PTR(th->cfp);
|
blockptr = VM_CF_BLOCK_PTR(cfp);
|
||||||
}
|
}
|
||||||
th->passed_block = blockptr;
|
th->passed_block = blockptr;
|
||||||
}
|
}
|
||||||
@ -1156,6 +1152,15 @@ rb_iterate(VALUE (* it_proc) (VALUE), VALUE data1,
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VALUE
|
||||||
|
rb_iterate(VALUE (* it_proc)(VALUE), VALUE data1,
|
||||||
|
VALUE (* bl_proc)(ANYARGS), VALUE data2)
|
||||||
|
{
|
||||||
|
return rb_iterate0(it_proc, data1,
|
||||||
|
bl_proc ? IFUNC_NEW(bl_proc, data2, rb_frame_this_func()) : 0,
|
||||||
|
GET_THREAD());
|
||||||
|
}
|
||||||
|
|
||||||
struct iter_method_arg {
|
struct iter_method_arg {
|
||||||
VALUE obj;
|
VALUE obj;
|
||||||
ID mid;
|
ID mid;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user