diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-04-03 16:56:27 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-04-03 16:56:27 +0900 |
| commit | 77331d127b6ab202e703bd7297ab6aabf4a314e9 (patch) | |
| tree | e86c5ee7c9f4a5a867d63745607f525116b84d19 /mrbgems/mruby-bin-debugger | |
| parent | fbf4089d2f9480b5f5c9b8cdc312ad5e8417f62e (diff) | |
| download | mruby-77331d127b6ab202e703bd7297ab6aabf4a314e9.tar.gz mruby-77331d127b6ab202e703bd7297ab6aabf4a314e9.zip | |
Unify `else` clause style
Diffstat (limited to 'mrbgems/mruby-bin-debugger')
| -rw-r--r-- | mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c | 6 | ||||
| -rw-r--r-- | mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c | 24 | ||||
| -rw-r--r-- | mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c | 6 |
3 files changed, 24 insertions, 12 deletions
diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c b/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c index 0c5002feb..4553a965a 100644 --- a/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +++ b/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c @@ -31,7 +31,8 @@ check_lineno(mrb_irep_debug_info_file *info_file, uint16_t lineno) return lineno; } } - } else { + } + else { for (l_idx = 0; l_idx < count; ++l_idx) { if (lineno == info_file->lines.flat_map[l_idx].line) { return lineno; @@ -198,7 +199,8 @@ mrb_debug_set_break_line(mrb_state *mrb, mrb_debug_context *dbg, const char *fil result = check_file_lineno(dbg->root_irep, file, lineno); if (result == 0) { return MRB_DEBUG_BREAK_INVALID_FILE; - }else if (result == MRB_DEBUG_BP_FILE_OK) { + } + else if (result == MRB_DEBUG_BP_FILE_OK) { return MRB_DEBUG_BREAK_INVALID_LINENO; } diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c b/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c index 27022369a..6bbe4cfbb 100644 --- a/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c +++ b/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c @@ -259,7 +259,8 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c if ((body = strrchr(args, ':')) == NULL) { body = args; type = check_bptype(body); - } else { + } + else { if (body == args) { printf(BREAK_ERR_MSG_INVALIDSTR, args); return MRB_DEBUG_BPTYPE_NONE; @@ -274,7 +275,8 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c if (l <= 65535) { *line = l; *file = (body == args)? mrb_debug_get_filename(dbg->irep, (uint32_t)(dbg->pc - dbg->irep->iseq)): args; - } else { + } + else { puts(BREAK_ERR_MSG_RANGEOVER); type = MRB_DEBUG_BPTYPE_NONE; } @@ -285,11 +287,13 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c if (ISUPPER(*body)||ISLOWER(*body)||(*body == '_')) { *method = body; *cname = NULL; - } else { + } + else { printf(BREAK_ERR_MSG_INVALIDMETHOD, args); type = MRB_DEBUG_BPTYPE_NONE; } - } else { + } + else { if (ISUPPER(*args)) { switch(*body) { case '@': case '$': case '?': case '.': case ',': case ':': @@ -302,7 +306,8 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c *cname = args; break; } - } else { + } + else { printf(BREAK_ERR_MSG_INVALIDCLASS, args); type = MRB_DEBUG_BPTYPE_NONE; } @@ -343,12 +348,15 @@ dbgcmd_break(mrb_state *mrb, mrdb_state *mrdb) if (ret >= 0) { if (type == MRB_DEBUG_BPTYPE_LINE) { printf(BREAK_SET_MSG_LINE, ret, file, line); - } else if ((type == MRB_DEBUG_BPTYPE_METHOD)&&(cname == NULL)) { + } + else if ((type == MRB_DEBUG_BPTYPE_METHOD)&&(cname == NULL)) { printf(BREAK_SET_MSG_METHOD, ret, method); - } else { + } + else { printf(BREAK_SET_MSG_CLASS_METHOD, ret, cname, method); } - } else { + } + else { switch (ret) { case MRB_DEBUG_BREAK_INVALID_LINENO: printf(BREAK_ERR_MSG_INVALIDLINENO, line, file); diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c b/mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c index 1aefb691d..cb4c738fc 100644 --- a/mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c +++ b/mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c @@ -13,7 +13,8 @@ dbgcmd_run(mrb_state *mrb, mrdb_state *mrdb) if (dbg->xm == DBG_INIT){ dbg->xm = DBG_RUN; - } else { + } + else { dbg->xm = DBG_QUIT; if (dbg->xphase == DBG_PHASE_RUNNING){ struct RClass *exc; @@ -40,7 +41,8 @@ dbgcmd_continue(mrb_state *mrb, mrdb_state *mrdb) if (dbg->xphase == DBG_PHASE_AFTER_RUN){ puts("The program is not running."); dbg->xm = DBG_QUIT; - } else { + } + else { dbg->xm = DBG_RUN; } return DBGST_CONTINUE; |
