summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-bin-debugger
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-09-20 19:13:17 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-09-20 19:13:17 +0900
commitd6dd6f0e7bb8977ed97a032256d34033ac15905a (patch)
treef07699b3752fd8738b9a8dce9e1511663a3c9d64 /mrbgems/mruby-bin-debugger
parent8be78dbf9d41a7cbe5c6228ec872a787de0f5adc (diff)
downloadmruby-d6dd6f0e7bb8977ed97a032256d34033ac15905a.tar.gz
mruby-d6dd6f0e7bb8977ed97a032256d34033ac15905a.zip
Update `struct` initializer to work with relatively older `C++`.
Diffstat (limited to 'mrbgems/mruby-bin-debugger')
-rw-r--r--mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c3
-rw-r--r--mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c8
2 files changed, 6 insertions, 5 deletions
diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c b/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c
index 14b75aba7..0714f3f21 100644
--- a/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c
+++ b/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c
@@ -141,7 +141,8 @@ static listcmd_parser_state*
listcmd_parser_state_new(mrb_state *mrb)
{
listcmd_parser_state *st = (listcmd_parser_state*)mrb_malloc(mrb, sizeof(listcmd_parser_state));
- *st = (listcmd_parser_state){0};
+ static const listcmd_parser_state st_zero = {0};
+ *st = st_zero;
return st;
}
diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c b/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c
index e409e3301..ee2ae0aca 100644
--- a/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c
+++ b/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c
@@ -186,9 +186,9 @@ static mrb_debug_context*
mrb_debug_context_new(mrb_state *mrb)
{
mrb_debug_context *dbg = (mrb_debug_context*)mrb_malloc(mrb, sizeof(mrb_debug_context));
+ static const mrb_debug_context dbg_zero = {0};
- *dbg = (mrb_debug_context){0};
-
+ *dbg = dbg_zero;
dbg->xm = DBG_INIT;
dbg->xphase = DBG_PHASE_BEFORE_RUN;
dbg->next_bpno = 1;
@@ -225,9 +225,9 @@ static mrdb_state*
mrdb_state_new(mrb_state *mrb)
{
mrdb_state *mrdb = (mrdb_state*)mrb_malloc(mrb, sizeof(mrdb_state));
+ static const mrdb_state mrdb_zero = {0};
- *mrdb = (mrdb_state){0};
-
+ *mrdb = mrdb_zero;
mrdb->dbg = mrb_debug_context_get(mrb);
mrdb->command = (char*)mrb_malloc(mrb, MAX_COMMAND_LINE+1);
mrdb->print_no = 1;