From d35bfdac74ceae1c70781667a1efc3378163fe1b Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 26 Nov 2018 18:48:48 +0000 Subject: [PATCH] fix for ansi-pedantic compile option. * iseq.c (iseq_add_local_tracepoint_i): extract aggregate initialization. See https://travis-ci.org/ruby/ruby/jobs/459881277 * iseq.c (iseq_remove_local_tracepoint_i): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- iseq.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/iseq.c b/iseq.c index 110932b650..063c872c24 100644 --- a/iseq.c +++ b/iseq.c @@ -3024,7 +3024,11 @@ iseq_add_local_tracepoint_i(const rb_iseq_t *iseq, void *p) int rb_iseq_add_local_tracepoint_recursively(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval) { - struct trace_set_local_events_struct data = {turnon_events, tpval, 0}; + struct trace_set_local_events_struct data; + data.turnon_events = turnon_events; + data.tpval = tpval; + data.n = 0; + iseq_add_local_tracepoint_i(iseq, (void *)&data); if (0) rb_funcall(Qnil, rb_intern("puts"), 1, rb_iseq_disasm(iseq)); /* for debug */ return data.n; @@ -3075,7 +3079,10 @@ iseq_remove_local_tracepoint_i(const rb_iseq_t *iseq, void *p) int rb_iseq_remove_local_tracepoint_recursively(const rb_iseq_t *iseq, VALUE tpval) { - struct trace_clear_local_events_struct data = {tpval, 0}; + struct trace_clear_local_events_struct data; + data.tpval = tpval; + data.n = 0; + iseq_remove_local_tracepoint_i(iseq, (void *)&data); return data.n; }