From 154d9872945cc99f52058c1687b90cb6c5e1feb0 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 28 Jan 2015 00:46:51 +0900 Subject: [PATCH] don't use C99's designated initializer --- extlib/benz/include/picrin/irep.h | 5 +++++ extlib/benz/vm.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/extlib/benz/include/picrin/irep.h b/extlib/benz/include/picrin/irep.h index cf612c0e..bba4e2f3 100644 --- a/extlib/benz/include/picrin/irep.h +++ b/extlib/benz/include/picrin/irep.h @@ -60,6 +60,11 @@ struct pic_code { } u; }; +#define PIC_INIT_CODE_I(code, op, ival) do { \ + code.insn = op; \ + code.u.i = ival; \ + } while (0) + struct pic_irep { PIC_OBJECT_HEADER pic_sym *name; diff --git a/extlib/benz/vm.c b/extlib/benz/vm.c index 682a873c..5b426cd8 100644 --- a/extlib/benz/vm.c +++ b/extlib/benz/vm.c @@ -1151,14 +1151,14 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value args) pic_value pic_apply_trampoline(pic_state *pic, struct pic_proc *proc, pic_value args) { - static const pic_code iseq[2] = { - { OP_NOP, { .i = 0 } }, - { OP_TAILCALL, { .i = -1 } } - }; + static pic_code iseq[2]; pic_value v, it, *sp; pic_callinfo *ci; + PIC_INIT_CODE_I(iseq[0], OP_NOP, 0); + PIC_INIT_CODE_I(iseq[1], OP_TAILCALL, -1); + *pic->sp++ = pic_obj_value(proc); sp = pic->sp;