diff options
author | dundargoc <gocdundar@gmail.com> | 2023-12-28 13:42:24 +0100 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-12-30 12:45:38 +0100 |
commit | c89292fcb7f2ebf06efb7c1d00c28f34c6f68fec (patch) | |
tree | b1257a572495337ca936c47839bb08aa45528c84 /src/nvim/ex_eval.c | |
parent | d634cd5b0bc3ac6bdf285432f74a1c10f12b6031 (diff) | |
download | rneovim-c89292fcb7f2ebf06efb7c1d00c28f34c6f68fec.tar.gz rneovim-c89292fcb7f2ebf06efb7c1d00c28f34c6f68fec.tar.bz2 rneovim-c89292fcb7f2ebf06efb7c1d00c28f34c6f68fec.zip |
refactor: follow style guide
Diffstat (limited to 'src/nvim/ex_eval.c')
-rw-r--r-- | src/nvim/ex_eval.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index c239e8a9ea..fd41ea1b91 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -105,7 +105,7 @@ static bool cause_abort = false; /// That is, during cancellation of an expression evaluation after an aborting /// function call or due to a parsing error, aborting() always returns the same /// value. "got_int" is also set by calling interrupt(). -int aborting(void) +bool aborting(void) { return (did_emsg && force_abort) || got_int || did_throw; } @@ -125,7 +125,7 @@ void update_force_abort(void) /// abort the script processing. Can be used to suppress an autocommand after /// execution of a failing subcommand as long as the error message has not been /// displayed and actually caused the abortion. -int should_abort(int retcode) +bool should_abort(int retcode) { return (retcode == FAIL && trylevel != 0 && !emsg_silent) || aborting(); } @@ -134,7 +134,7 @@ int should_abort(int retcode) /// ended on an error. This means that parsing commands is continued in order /// to find finally clauses to be executed, and that some errors in skipped /// commands are still reported. -int aborted_in_try(void) +bool aborted_in_try(void) FUNC_ATTR_PURE { // This function is only called after an error. In this case, "force_abort" @@ -326,7 +326,7 @@ void do_errthrow(cstack_T *cstack, char *cmdname) /// /// @return true if the current exception is discarded or, /// false otherwise. -int do_intthrow(cstack_T *cstack) +bool do_intthrow(cstack_T *cstack) { // If no interrupt occurred or no try conditional is active and no exception // is being thrown, do nothing (for compatibility of non-EH scripts). @@ -369,7 +369,7 @@ int do_intthrow(cstack_T *cstack) } /// Get an exception message that is to be stored in current_exception->value. -char *get_exception_string(void *value, except_type_T type, char *cmdname, int *should_free) +char *get_exception_string(void *value, except_type_T type, char *cmdname, bool *should_free) { char *ret; @@ -454,7 +454,7 @@ static int throw_exception(void *value, except_type_T type, char *cmdname) excp->messages = (msglist_T *)value; } - int should_free; + bool should_free; excp->value = get_exception_string(value, type, cmdname, &should_free); if (excp->value == NULL && should_free) { goto nomem; @@ -841,7 +841,7 @@ void ex_if(exarg_T *eap) cstack->cs_idx++; cstack->cs_flags[cstack->cs_idx] = 0; - int skip = CHECK_SKIP; + bool skip = CHECK_SKIP; bool error; bool result = eval_to_bool(eap->arg, &error, eap, skip); @@ -875,7 +875,7 @@ void ex_endif(exarg_T *eap) // discarded by throwing the interrupt exception later on. if (!(eap->cstack->cs_flags[eap->cstack->cs_idx] & CSF_TRUE) && dbg_check_skipped(eap)) { - (void)do_intthrow(eap->cstack); + do_intthrow(eap->cstack); } eap->cstack->cs_idx--; @@ -926,7 +926,7 @@ void ex_else(exarg_T *eap) // for a parsing errors is discarded when throwing the interrupt exception // later on. if (!skip && dbg_check_skipped(eap) && got_int) { - (void)do_intthrow(cstack); + do_intthrow(cstack); skip = true; } @@ -1132,7 +1132,7 @@ void ex_endwhile(exarg_T *eap) } } // Cleanup and rewind all contained (and unclosed) conditionals. - (void)cleanup_conditionals(cstack, CSF_WHILE | CSF_FOR, false); + cleanup_conditionals(cstack, CSF_WHILE | CSF_FOR, false); rewind_conditionals(cstack, idx, CSF_TRY, &cstack->cs_trylevel); } else if (cstack->cs_flags[cstack->cs_idx] & CSF_TRUE && !(cstack->cs_flags[cstack->cs_idx] & CSF_ACTIVE) @@ -1145,7 +1145,7 @@ void ex_endwhile(exarg_T *eap) // throw an interrupt exception if appropriate. Doing this here // prevents that an exception for a parsing error is discarded when // throwing the interrupt exception later on. - (void)do_intthrow(cstack); + do_intthrow(cstack); } // Set loop flag, so do_cmdline() will jump back to the matching @@ -1476,7 +1476,7 @@ void ex_finally(exarg_T *eap) // occurred before the ":finally". That is, discard the // original exception and replace it by an interrupt // exception. - (void)do_intthrow(cstack); + do_intthrow(cstack); } // If there is a preceding catch clause and it caught the exception, @@ -1617,7 +1617,7 @@ void ex_endtry(exarg_T *eap) // set "skip" and "rethrow". if (got_int) { skip = true; - (void)do_intthrow(cstack); + do_intthrow(cstack); // The do_intthrow() call may have reset did_throw or // cstack->cs_pending[idx]. rethrow = false; @@ -1649,7 +1649,7 @@ void ex_endtry(exarg_T *eap) // was no finally clause, finish the exception now. This happens also // after errors except when this ":endtry" is not within a ":try". // Restore "emsg_silent" if it has been reset by this try conditional. - (void)cleanup_conditionals(cstack, CSF_TRY | CSF_SILENT, true); + cleanup_conditionals(cstack, CSF_TRY | CSF_SILENT, true); if (cstack->cs_idx >= 0 && (cstack->cs_flags[cstack->cs_idx] & CSF_TRY)) { cstack->cs_idx--; |