diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2021-11-01 01:03:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-31 17:03:08 -0700 |
commit | a68faed02dc8e37b8f10da14dc02e33e6ed93947 (patch) | |
tree | 992c62bd3451d829d4b91fef527d3f4254254bcc | |
parent | 5ad15c9fa1ac6e6b2acfc2fe5e20148adeb85eb3 (diff) | |
download | rneovim-a68faed02dc8e37b8f10da14dc02e33e6ed93947.tar.gz rneovim-a68faed02dc8e37b8f10da14dc02e33e6ed93947.tar.bz2 rneovim-a68faed02dc8e37b8f10da14dc02e33e6ed93947.zip |
refactor: saner options for uncrustify #16196
* refactor: general good option changes
sp_deref = remove
sp_not = remove
sp_inv = remove
sp_inside_paren_cast = remove
mod_remove_duplicate_include = true
sp_after_semi = add
sp_after_semi_for = force
sp_sizeof_paren = remove
nl_return_expr = remove
nl_else_brace = remove
nl_else_if = remove
* refactor: mod_remove_extra_semicolon = true
* refactor: nl_max = 3
* refactor: sp_bool = force
* refactor: sp_compare = force
* refactor: sp_inside_paren = remove
* refactor: sp_paren_paren = remove
* refactor: sp_inside_sparen = remove
* refactor: sp_before_sparen = force
* refactor: sp_sign = remove
* refactor: sp_addr = remove
* refactor: sp_member = remove
* refactor: nl_struct_brace = remove
* refactor: nl_before_if_closing_paren = remove
* refactor: nl_fdef_brace = force
* refactor: sp_paren_comma = force
* refactor: mod_full_brace_do = add
60 files changed, 183 insertions, 238 deletions
diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c index e6756315c6..6f1fb15dac 100644 --- a/src/nvim/api/extmark.c +++ b/src/nvim/api/extmark.c @@ -94,7 +94,6 @@ static bool ns_initialized(uint64_t ns) } - static Array extmark_to_array(ExtmarkInfo extmark, bool id, bool add_dict) { Array rv = ARRAY_DICT_INIT; @@ -504,7 +503,7 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer } #define OPTION_TO_BOOL(target, name, val) \ - target = api_object_to_bool(opts-> name, #name, val, err); \ + target = api_object_to_bool(opts->name, #name, val, err); \ if (ERROR_SET(err)) { \ goto error; \ } diff --git a/src/nvim/api/private/converter.c b/src/nvim/api/private/converter.c index 0d054c7958..36da6c13a9 100644 --- a/src/nvim/api/private/converter.c +++ b/src/nvim/api/private/converter.c @@ -5,10 +5,10 @@ #include <stddef.h> #include <stdlib.h> -#include "nvim/assert.h" +#include "nvim/api/private/converter.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" -#include "nvim/api/private/converter.h" +#include "nvim/assert.h" #include "nvim/eval/typval.h" /// Helper structure for vim_to_object diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 6b3f4a29d7..d470def277 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -8,6 +8,7 @@ #include <stdlib.h> #include <string.h> +#include "nvim/api/private/converter.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/api/vim.h" @@ -28,7 +29,6 @@ #include "nvim/mark.h" #include "nvim/memline.h" #include "nvim/memory.h" -#include "nvim/api/private/converter.h" #include "nvim/msgpack_rpc/helpers.h" #include "nvim/option.h" #include "nvim/option_defs.h" @@ -607,7 +607,7 @@ void modify_keymap(Buffer buffer, bool is_unmap, String mode, String lhs, String MapArguments parsed_args = MAP_ARGUMENTS_INIT; if (opts) { #define KEY_TO_BOOL(name) \ - parsed_args. name = api_object_to_bool(opts-> name, #name, false, err); \ + parsed_args.name = api_object_to_bool(opts->name, #name, false, err); \ if (ERROR_SET(err)) { \ goto fail_and_free; \ } diff --git a/src/nvim/api/vimscript.c b/src/nvim/api/vimscript.c index ac68b0eb91..c516cedaf4 100644 --- a/src/nvim/api/vimscript.c +++ b/src/nvim/api/vimscript.c @@ -5,11 +5,11 @@ #include <limits.h> #include <stdlib.h> -#include "nvim/ascii.h" -#include "nvim/api/vimscript.h" #include "nvim/api/private/converter.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" +#include "nvim/api/vimscript.h" +#include "nvim/ascii.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" #include "nvim/eval/userfunc.h" diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 943d5fe6b5..a4c7b1816c 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -501,7 +501,7 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last) // If the buffer was in curwin and the window has changed, go back to that // window, if it still exists. This avoids that ":edit x" triggering a // "tabnext" BufUnload autocmd leaves a window behind without a buffer. - if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin)) { + if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin)) { block_autocmds(); goto_tabpage_win(the_curtab, the_curwin); unblock_autocmds(); @@ -698,7 +698,7 @@ void buf_freeall(buf_T *buf, int flags) // If the buffer was in curwin and the window has changed, go back to that // window, if it still exists. This avoids that ":edit x" triggering a // "tabnext" BufUnload autocmd leaves a window behind without a buffer. - if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin)) { + if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin)) { block_autocmds(); goto_tabpage_win(the_curtab, the_curwin); unblock_autocmds(); @@ -1042,7 +1042,6 @@ char_u *do_bufdel(int command, char_u *arg, int addr_count, int start_bnr, int e } - /* * Make the current buffer empty. * Used when it is wiped out and it's the last buffer. @@ -5172,7 +5171,6 @@ void ex_buffer_all(exarg_T *eap) } - /* * do_modelines() - process mode lines for the current file * diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 31feeb91cf..f77f0aadb0 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -147,8 +147,7 @@ struct buffheader { size_t bh_space; // space in bh_curr for appending }; -typedef struct -{ +typedef struct { buffheader_T sr_redobuff; buffheader_T sr_old_redobuff; } save_redo_T; @@ -1019,8 +1018,7 @@ typedef struct { #define MAXPOSMATCH 8 /// Same as lpos_T, but with additional field len. -typedef struct -{ +typedef struct { linenr_T lnum; ///< line number colnr_T col; ///< column number int len; ///< length: 0 - to the end of line @@ -1029,8 +1027,7 @@ typedef struct /// posmatch_T provides an array for storing match items for matchaddpos() /// function. typedef struct posmatch posmatch_T; -struct posmatch -{ +struct posmatch { llpos_T pos[MAXPOSMATCH]; ///< array of positions int cur; ///< internal position counter linenr_T toplnum; ///< top buffer line @@ -1111,8 +1108,7 @@ typedef struct { // Structure to store last cursor position and topline. Used by check_lnums() // and reset_lnums(). -typedef struct -{ +typedef struct { int w_topline_save; // original topline value int w_topline_corr; // corrected topline value pos_T w_cursor_save; // original cursor position diff --git a/src/nvim/charset.c b/src/nvim/charset.c index d2f95ad81c..8139eae131 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -947,7 +947,7 @@ void getvcol(win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *en if ((!wp->w_p_list || (wp->w_p_lcs_chars.tab1 != NUL)) && !wp->w_p_lbr && *get_showbreak_value(wp) == NUL - && !wp->w_p_bri ) { + && !wp->w_p_bri) { for (;;) { head = 0; c = *ptr; @@ -1311,7 +1311,8 @@ char_u *skiptowhite(const char_u *p) /// @param p /// /// @return Pointer to the next whitespace character. -char_u *skiptowhite_esc(char_u *p) { +char_u *skiptowhite_esc(char_u *p) +{ while (*p != ' ' && *p != '\t' && *p != NUL) { if (((*p == '\\') || (*p == Ctrl_V)) && (*(p + 1) != NUL)) { ++p; diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h index 97ae9ed5d8..611b4223da 100644 --- a/src/nvim/decoration.h +++ b/src/nvim/decoration.h @@ -31,8 +31,7 @@ typedef kvec_t(VirtTextChunk) VirtText; typedef kvec_t(struct virt_line { VirtText line; bool left_col; }) VirtLines; -struct Decoration -{ +struct Decoration { VirtText virt_text; VirtLines virt_lines; diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 7c33f0cab6..6e54c0bf0e 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -1600,7 +1600,7 @@ static void diff_read(int idx_orig, int idx_new, diffout_T *dout) } } else { assert(diffstyle == DIFF_UNIFIED); - if (STRNCMP(line, "@@ ", 3) != 0) { + if (STRNCMP(line, "@@ ", 3) != 0) { continue; // not the start of a diff block } if (parse_diff_unified(line, &lnum_orig, &count_orig, @@ -3147,7 +3147,7 @@ static int xdiff_out(void *priv, mmbuffer_t *mb, int nbuf) } // sanity check - if (STRNCMP(mb[0].ptr, "@@ ", 3) != 0) { + if (STRNCMP(mb[0].ptr, "@@ ", 3) != 0) { return 0; } diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 4542576339..e2884c242b 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -3329,7 +3329,7 @@ void get_complete_info(list_T *what_list, dict_T *retdict) // Return Insert completion mode name string static char_u *ins_compl_mode(void) { - if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET || ctrl_x_mode == CTRL_X_SCROLL || compl_started) { + if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET || ctrl_x_mode == CTRL_X_SCROLL || compl_started) { return (char_u *)ctrl_x_mode_names[ctrl_x_mode & ~CTRL_X_WANT_IDENT]; } return (char_u *)""; @@ -3904,7 +3904,6 @@ static buf_T *ins_compl_next_buf(buf_T *buf, int flag) assert(wp); while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin && wp->w_buffer->b_scanned) { - ; } buf = wp->w_buffer; } else { @@ -3917,7 +3916,6 @@ static buf_T *ins_compl_next_buf(buf_T *buf, int flag) : (!buf->b_p_bl || (buf->b_ml.ml_mfp == NULL) != (flag == 'u'))) || buf->b_scanned)) { - ; } } return buf; @@ -4427,7 +4425,7 @@ static int ins_compl_get_exp(pos_T *ini) // when ADDING, the text before the cursor matches, skip it if ((compl_cont_status & CONT_ADDING) && ins_buf == curbuf && ini->lnum == pos->lnum - && ini->col == pos->col) { + && ini->col == pos->col) { continue; } ptr = ml_get_buf(ins_buf, pos->lnum, false) + pos->col; @@ -5100,7 +5098,6 @@ static int ins_complete(int c, bool enable_pum) || ctrl_x_mode == CTRL_X_PATH_DEFINES) { if (!(compl_cont_status & CONT_ADDING)) { while (--startcol >= 0 && vim_isIDc(line[startcol])) { - ; } compl_col += ++startcol; compl_length = curs_col - startcol; @@ -5788,7 +5785,6 @@ void insertchar(int c, int flags, int second_indent) // Skip white space before the cursor i = curwin->w_cursor.col; while (--i >= 0 && ascii_iswhite(line[i])) { - ; } i++; @@ -7373,7 +7369,8 @@ void fixthisline(IndentGetter get_the_indent) } } -void fix_indent(void) { +void fix_indent(void) +{ if (p_paste) { return; } @@ -8582,7 +8579,6 @@ static void ins_mousescroll(int dir) } - static void ins_left(void) { pos_T tpos; diff --git a/src/nvim/eval.c b/src/nvim/eval.c index b31e1e81d4..19aaced7c6 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -4524,7 +4524,6 @@ static int eval_index(char_u **arg, typval_T *rettv, int evaluate, int verbose) */ key = *arg + 1; for (len = 0; ASCII_ISALNUM(key[len]) || key[len] == '_'; ++len) { - ; } if (len == 0) { return FAIL; @@ -5129,7 +5128,8 @@ failret: } /// @param ic ignore case -bool func_equal(typval_T *tv1, typval_T *tv2, bool ic) { +bool func_equal(typval_T *tv1, typval_T *tv2, bool ic) +{ char_u *s1, *s2; dict_T *d1, *d2; int a1, a2; @@ -5632,7 +5632,6 @@ bool set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack } - /// Mark all lists and dicts referenced in given mark /// /// @returns true if setting references failed somehow. @@ -10837,7 +10836,7 @@ bool common_job_callbacks(dict_T *vopts, CallbackReader *on_stdout, CallbackRead Callback *on_exit) { if (tv_dict_get_callback(vopts, S_LEN("on_stdout"), &on_stdout->cb) - &&tv_dict_get_callback(vopts, S_LEN("on_stderr"), &on_stderr->cb) + && tv_dict_get_callback(vopts, S_LEN("on_stderr"), &on_stderr->cb) && tv_dict_get_callback(vopts, S_LEN("on_exit"), on_exit)) { on_stdout->buffered = tv_dict_get_number(vopts, "stdout_buffered"); on_stderr->buffered = tv_dict_get_number(vopts, "stderr_buffered"); diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 29f7d22317..eb7d62d7a2 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -738,7 +738,8 @@ static void buf_win_common(typval_T *argvars, typval_T *rettv, bool get_nr) } /// "bufwinid(nr)" function -static void f_bufwinid(typval_T *argvars, typval_T *rettv, FunPtr fptr) { +static void f_bufwinid(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ buf_win_common(argvars, rettv, false); } @@ -1812,7 +1813,7 @@ static void f_deletebufline(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (wp->w_buffer == buf) { if (wp->w_cursor.lnum > last) { wp->w_cursor.lnum -= count; - } else if (wp->w_cursor.lnum> first) { + } else if (wp->w_cursor.lnum > first) { wp->w_cursor.lnum = first; } if (wp->w_cursor.lnum > wp->w_buffer->b_ml.ml_line_count) { @@ -4620,10 +4621,9 @@ static bool has_wsl(void) static TriState has_wsl = kNone; if (has_wsl == kNone) { Error err = ERROR_INIT; - Object o = nlua_exec( - STATIC_CSTR_AS_STRING("return vim.loop.os_uname()['release']:lower()" - ":match('microsoft') and true or false"), - (Array)ARRAY_DICT_INIT, &err); + Object o = nlua_exec(STATIC_CSTR_AS_STRING("return vim.loop.os_uname()['release']:lower()" + ":match('microsoft') and true or false"), + (Array)ARRAY_DICT_INIT, &err); assert(!ERROR_SET(&err)); assert(o.type == kObjectTypeBoolean); has_wsl = o.data.boolean ? kTrue : kFalse; @@ -11245,7 +11245,6 @@ static void f_tabpagenr(typval_T *argvars, typval_T *rettv, FunPtr fptr) } - /* * Common code for tabpagewinnr() and winnr(). */ diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 4e845cffdd..811a1d40dd 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -3162,7 +3162,7 @@ int tv_check_for_nonempty_string(const typval_T *const tv) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE { if (tv_check_for_string(tv) == FAIL) { - return FAIL; + return FAIL; } if (tv->vval.v_string == NULL || *tv->vval.v_string == NUL) { EMSG(_(e_non_empty_string_required)); diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h index 994bce899d..843f879ed0 100644 --- a/src/nvim/eval/typval.h +++ b/src/nvim/eval/typval.h @@ -831,7 +831,7 @@ extern bool tv_in_free_unref_items; /// @param li Name of the variable with current listitem_T entry. /// @param code Cycle body. #define TV_LIST_ITER(l, li, code) \ - _TV_LIST_ITER_MOD(, l, li, code) + _TV_LIST_ITER_MOD( , l, li, code) /// Iterate over a list /// diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index 3c7532df7b..6a01cbba5c 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -2349,7 +2349,7 @@ void ex_function(exarg_T *eap) // heredoc: Check for ":python <<EOF", ":lua <<EOF", etc. arg = skipwhite(skiptowhite(p)); - if (arg[0] == '<' && arg[1] =='<' + if (arg[0] == '<' && arg[1] == '<' && ((p[0] == 'p' && p[1] == 'y' && (!ASCII_ISALNUM(p[2]) || p[2] == 't' || ((p[2] == '3' || p[2] == 'x') @@ -2383,7 +2383,7 @@ void ex_function(exarg_T *eap) arg = skipwhite(skiptowhite(arg)); if (arg[0] == '=' && arg[1] == '<' - && arg[2] =='<' + && arg[2] == '<' && (p[0] == 'l' && p[1] == 'e' && (!ASCII_ISALNUM(p[2]) diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 17ab138d75..8db1f984ba 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -14,8 +14,8 @@ #include <string.h> #include "nvim/api/buffer.h" -#include "nvim/api/private/defs.h" #include "nvim/api/extmark.h" +#include "nvim/api/private/defs.h" #include "nvim/ascii.h" #include "nvim/buffer.h" #include "nvim/buffer_updates.h" @@ -303,8 +303,9 @@ void ex_align(exarg_T *eap) * Now try to move the line as much as possible to * the right. Stop when it moves too far. */ - do + do{ (void)set_indent(++new_indent, 0); + } while (linelen(NULL) <= width); --new_indent; break; @@ -1859,11 +1860,11 @@ int do_write(exarg_T *eap) /* * Not writing the whole file is only allowed with '!'. */ - if ( (eap->line1 != 1 - || eap->line2 != curbuf->b_ml.ml_line_count) - && !eap->forceit - && !eap->append - && !p_wa) { + if ((eap->line1 != 1 + || eap->line2 != curbuf->b_ml.ml_line_count) + && !eap->forceit + && !eap->append + && !p_wa) { if (p_confirm || cmdmod.confirm) { if (vim_dialog_yesno(VIM_QUESTION, NULL, (char_u *)_("Write partial file?"), 2) != VIM_YES) { @@ -3135,7 +3136,6 @@ void ex_z(exarg_T *eap) // the number of '-' and '+' multiplies the distance if (*kind == '-' || *kind == '+') { for (x = kind + 1; *x == *kind; ++x) { - ; } } @@ -4409,7 +4409,7 @@ skip: if (got_quit || profile_passed_limit(timeout)) { // Too slow, disable. set_string_option_direct("icm", -1, (char_u *)"", OPT_FREE, SID_NONE); - } else if (*p_icm != NUL && pat != NULL) { + } else if (*p_icm != NUL && pat != NULL) { if (pre_src_id == 0) { // Get a unique new src_id, saved in a static pre_src_id = (int)nvim_create_namespace((String)STRING_INIT); @@ -4724,7 +4724,6 @@ bool prepare_tagpreview(bool undo_sync) } - /* * ":help": open a read-only window on a help file */ @@ -5175,7 +5174,7 @@ int find_help_tags(const char_u *arg, int *num_matches, char_u ***matches, bool // If tag contains "({" or "([", tag terminates at the "(". // This is for help on functions, e.g.: abs({expr}). - if (*s == '(' && (s[1] == '{' || s[1] =='[')) { + if (*s == '(' && (s[1] == '{' || s[1] == '[')) { break; } diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index e169514e79..1dd37c0471 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -550,7 +550,6 @@ bool check_changed(buf_T *buf, int flags) } - /// Ask the user what to do when abandoning a changed buffer. /// Must check 'write' option first! /// diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 160ef9cfaa..f932bbae5f 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -5697,7 +5697,8 @@ void ex_comclear(exarg_T *eap) uc_clear(&curbuf->b_ucmds); } -static void free_ucmd(ucmd_T *cmd) { +static void free_ucmd(ucmd_T *cmd) +{ xfree(cmd->uc_name); xfree(cmd->uc_rep); xfree(cmd->uc_compl_arg); @@ -7207,8 +7208,7 @@ void ex_splitview(exarg_T *eap) *eap->cmd == 'v' ? WSP_VERT : 0) != FAIL) { // Reset 'scrollbind' when editing another file, but keep it when // doing ":split" without arguments. - if (*eap->arg != NUL - ) { + if (*eap->arg != NUL) { RESET_BINDING(curwin); } else { do_check_scrollbind(false); @@ -7369,7 +7369,6 @@ static void ex_resize(exarg_T *eap) if (eap->addr_count > 0) { n = eap->line2; for (wp = firstwin; wp->w_next != NULL && --n > 0; wp = wp->w_next) { - ; } } @@ -7562,7 +7561,6 @@ static void ex_nogui(exarg_T *eap) } - static void ex_swapname(exarg_T *eap) { if (curbuf->b_ml.ml_mfp == NULL || curbuf->b_ml.ml_mfp->mf_fname == NULL) { @@ -8054,8 +8052,7 @@ static void ex_operators(exarg_T *eap) default: // CMD_rshift or CMD_lshift if ( - (eap->cmdidx == CMD_rshift) ^ curwin->w_p_rl - ) { + (eap->cmdidx == CMD_rshift) ^ curwin->w_p_rl) { oa.op_type = OP_RSHIFT; } else { oa.op_type = OP_LSHIFT; diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index 3deb09241c..e0ea62dd11 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -1628,8 +1628,9 @@ void ex_endtry(exarg_T *eap) eap->errmsg = get_end_emsg(cstack); // Find the matching ":try" and report what's missing. idx = cstack->cs_idx; - do + do{ --idx; + } while (idx > 0 && !(cstack->cs_flags[idx] & CSF_TRY)); rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR, &cstack->cs_looplevel); diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 6b8b9c30b1..8e5b12b8be 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -2036,7 +2036,6 @@ static int command_line_handle_key(CommandLineState *s) return command_line_not_changed(s); - case K_SELECT: // end of Select mode mapping - ignore return command_line_not_changed(s); @@ -2462,7 +2461,8 @@ char *getcmdline_prompt(const char firstc, const char *const prompt, const int a * Return TRUE when the text must not be changed and we can't switch to * another window or buffer. Used when editing the command line etc. */ -int text_locked(void) { +int text_locked(void) +{ if (cmdwin_type != 0) { return TRUE; } @@ -2478,7 +2478,8 @@ void text_locked_msg(void) EMSG(_(get_text_locked_msg())); } -char_u *get_text_locked_msg(void) { +char_u *get_text_locked_msg(void) +{ if (cmdwin_type != 0) { return e_cmdwin; } else { @@ -5606,7 +5607,6 @@ void globpath(char_u *path, char_u *file, garray_T *ga, int expand_options) } - /********************************* * Command line history stuff * *********************************/ diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c index a3a7791d21..8726abc59d 100644 --- a/src/nvim/extmark.c +++ b/src/nvim/extmark.c @@ -48,7 +48,8 @@ # include "extmark.c.generated.h" #endif -static ExtmarkNs *buf_ns_ref(buf_T *buf, uint64_t ns_id, bool put) { +static ExtmarkNs *buf_ns_ref(buf_T *buf, uint64_t ns_id, bool put) +{ return map_ref(uint64_t, ExtmarkNs)(buf->b_extmark_ns, ns_id, put); } diff --git a/src/nvim/extmark.h b/src/nvim/extmark.h index aee679a9c7..c70db9f7aa 100644 --- a/src/nvim/extmark.h +++ b/src/nvim/extmark.h @@ -8,8 +8,7 @@ EXTERN int extmark_splice_pending INIT(= 0); -typedef struct -{ +typedef struct { uint64_t ns_id; uint64_t mark_id; int row; diff --git a/src/nvim/extmark_defs.h b/src/nvim/extmark_defs.h index 4d4d9aefb5..bbe8504ebf 100644 --- a/src/nvim/extmark_defs.h +++ b/src/nvim/extmark_defs.h @@ -12,8 +12,7 @@ typedef struct { } VirtTextChunk; -typedef struct -{ +typedef struct { uint64_t ns_id; uint64_t mark_id; // TODO(bfredl): a lot of small allocations. Should probably use diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index dfe264b08c..f7e248dce9 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -832,7 +832,6 @@ retry: } - #ifdef HAVE_ICONV // Try using iconv() if we can't convert internally. if (fio_flags == 0 @@ -1519,7 +1518,6 @@ rewind_retry: try_mac = 1; try_unix = 1; for (; p >= ptr && *p != CAR; p--) { - ; } if (p >= ptr) { for (p = ptr; p < ptr + size; ++p) { @@ -3083,7 +3081,6 @@ nobackup: } - if (converted && wb_flags == 0) { #ifdef HAVE_ICONV // Use iconv() conversion when conversion is needed and it's not done @@ -4250,7 +4247,6 @@ static int get_fio_flags(const char_u *name) } - /* * Check for a Unicode BOM (Byte Order Mark) at the start of p[size]. * "size" must be at least 2. @@ -5436,7 +5432,6 @@ char_u *vim_tempname(void) } - /// Tries matching a filename with a "pattern" ("prog" is NULL), or use the /// precompiled regprog "prog" ("pattern" is NULL). That avoids calling /// vim_regcomp() often. diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index f8cf630411..294cd60736 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1560,8 +1560,7 @@ int vgetc(void) buf[0] = (char_u)c; for (i = 1; i < n; i++) { buf[i] = (char_u)vgetorpeek(true); - if (buf[i] == K_SPECIAL - ) { + if (buf[i] == K_SPECIAL) { // Must be a K_SPECIAL - KS_SPECIAL - KE_FILLER sequence, // which represents a K_SPECIAL (0x80), // or a CSI - KS_EXTRA - KE_CSI sequence, which represents diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c index ea305188f2..f3b46eb9e4 100644 --- a/src/nvim/if_cscope.c +++ b/src/nvim/if_cscope.c @@ -1463,7 +1463,6 @@ retry: // If the line's too long for the buffer, discard it. if ((p = strchr(buf, '\n')) == NULL) { while ((ch = getc(csinfo[cnumber].fr_fp)) != EOF && ch != '\n') { - ; } return NULL; } @@ -1521,7 +1520,7 @@ static void cs_file_results(FILE *f, int *nummatches_a) context = xmalloc(strlen(cntx) + 5); - if (strcmp(cntx, "<global>")==0) { + if (strcmp(cntx, "<global>") == 0) { strcpy(context, "<<global>>"); } else { sprintf(context, "<<%s>>", cntx); diff --git a/src/nvim/lib/kvec.h b/src/nvim/lib/kvec.h index ff0a8bcb7c..34332ba34b 100644 --- a/src/nvim/lib/kvec.h +++ b/src/nvim/lib/kvec.h @@ -95,15 +95,15 @@ } while (0) #define kv_splice(v1, v0) \ - do { \ - if ((v1).capacity < (v1).size + (v0).size) { \ - (v1).capacity = (v1).size + (v0).size; \ - kv_roundup32((v1).capacity); \ - kv_resize((v1), (v1).capacity); \ - } \ - memcpy((v1).items + (v1).size, (v0).items, sizeof((v1).items[0]) * (v0).size); \ - (v1).size = (v1).size + (v0).size; \ - } while (0) + do { \ + if ((v1).capacity < (v1).size + (v0).size) { \ + (v1).capacity = (v1).size + (v0).size; \ + kv_roundup32((v1).capacity); \ + kv_resize((v1), (v1).capacity); \ + } \ + memcpy((v1).items + (v1).size, (v0).items, sizeof((v1).items[0]) * (v0).size); \ + (v1).size = (v1).size + (v0).size; \ + } while (0) #define kv_pushp(v) \ ((((v).size == (v).capacity) ? (kv_resize_full(v), 0) : 0), \ diff --git a/src/nvim/lib/queue.h b/src/nvim/lib/queue.h index 871f49c863..e5574094bc 100644 --- a/src/nvim/lib/queue.h +++ b/src/nvim/lib/queue.h @@ -38,7 +38,7 @@ typedef struct _queue { // elements results in undefined behavior. #define QUEUE_FOREACH(q, h, code) \ (q) = (h)->next; \ - while((q) != (h)) { \ + while ((q) != (h)) { \ QUEUE *next = q->next; \ code \ (q) = next; \ diff --git a/src/nvim/lua/stdlib.c b/src/nvim/lua/stdlib.c index 788819ab03..db79e9e7e9 100644 --- a/src/nvim/lua/stdlib.c +++ b/src/nvim/lua/stdlib.c @@ -229,7 +229,7 @@ static int nlua_str_utf_start(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL const char *s1 = luaL_checklstring(lstate, 1, &s1_len); long offset = luaL_checkinteger(lstate, 2); if (offset < 0 || offset > (intptr_t)s1_len) { - return luaL_error(lstate, "index out of range"); + return luaL_error(lstate, "index out of range"); } int tail_offset = mb_head_off((char_u *)s1, (char_u *)s1 + (char_u)offset - 1); lua_pushinteger(lstate, tail_offset); @@ -249,7 +249,7 @@ static int nlua_str_utf_end(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL const char *s1 = luaL_checklstring(lstate, 1, &s1_len); long offset = luaL_checkinteger(lstate, 2); if (offset < 0 || offset > (intptr_t)s1_len) { - return luaL_error(lstate, "index out of range"); + return luaL_error(lstate, "index out of range"); } int tail_offset = mb_tail_off((char_u *)s1, (char_u *)s1 + (char_u)offset - 1); lua_pushinteger(lstate, tail_offset); @@ -311,7 +311,8 @@ int nlua_regex(lua_State *lstate) return 1; } -static dict_T *nlua_get_var_scope(lua_State *lstate) { +static dict_T *nlua_get_var_scope(lua_State *lstate) +{ const char *scope = luaL_checkstring(lstate, 1); handle_T handle = (handle_T)luaL_checkinteger(lstate, 2); dict_T *dict = NULL; @@ -463,7 +464,6 @@ static int nlua_stricmp(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL } - void nlua_state_add_stdlib(lua_State *const lstate) { // stricmp diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c index 02bd612149..60a000843f 100644 --- a/src/nvim/lua/treesitter.c +++ b/src/nvim/lua/treesitter.c @@ -1195,7 +1195,8 @@ int tslua_parse_query(lua_State *L) } -static const char *query_err_string(TSQueryError err) { +static const char *query_err_string(TSQueryError err) +{ switch (err) { case TSQueryErrorSyntax: return "invalid syntax"; diff --git a/src/nvim/main.c b/src/nvim/main.c index c329c9a8f4..123872b3df 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -674,8 +674,7 @@ void getout(int exitval) profile_dump(); - if (did_emsg - ) { + if (did_emsg) { // give the user a chance to read the (error) message no_wait_return = FALSE; wait_return(FALSE); diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 7ce4e2b4f5..da3f38bc94 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -346,7 +346,6 @@ static int enc_canon_search(const char_u *name) } - /* * Find canonical encoding "name" in the list and return its properties. * Returns 0 if not found. @@ -2432,8 +2431,6 @@ static char_u *iconv_string(const vimconv_T *const vcp, char_u *str, size_t slen #endif // HAVE_ICONV - - /* * Setup "vcp" for conversion from "from" to "to". * The names must have been made canonical with enc_canonize(). diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 7b57a68033..0d3164f578 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -1638,7 +1638,7 @@ static time_t swapfile_unchanged(char *fname) } // the ID and magic number must be correct - if (ml_check_b0_id(&b0) == FAIL|| b0_magic_wrong(&b0)) { + if (ml_check_b0_id(&b0) == FAIL || b0_magic_wrong(&b0)) { ret = false; } @@ -2563,8 +2563,7 @@ static int ml_delete_int(buf_T *buf, linenr_T lnum, bool message) * If the file becomes empty the last line is replaced by an empty line. */ if (buf->b_ml.ml_line_count == 1) { // file becomes empty - if (message - ) { + if (message) { set_keep_msg((char_u *)_(no_lines_msg), 0); } diff --git a/src/nvim/menu.c b/src/nvim/menu.c index f1ae8740bb..5ada5e092d 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -38,8 +38,6 @@ #endif - - /// The character for each menu mode static char_u menu_mode_chars[] = { 'n', 'v', 's', 'o', 'i', 'c', 't' }; @@ -951,7 +949,7 @@ char_u *set_context_in_menu_cmd(expand_T *xp, const char *cmd, char_u *arg, bool if (!ascii_iswhite(*p)) { if (STRNCMP(arg, "enable", 6) == 0 - && (arg[6] == NUL || ascii_iswhite(arg[6]))) { + && (arg[6] == NUL || ascii_iswhite(arg[6]))) { p = arg + 6; } else if (STRNCMP(arg, "disable", 7) == 0 && (arg[7] == NUL || ascii_iswhite(arg[7]))) { diff --git a/src/nvim/message.c b/src/nvim/message.c index aa0618a6d9..85ae6d9ce7 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1199,11 +1199,11 @@ void wait_return(int redraw) } } while ((had_got_int && c == Ctrl_C) || c == K_IGNORE - || c == K_LEFTDRAG || c == K_LEFTRELEASE + || c == K_LEFTDRAG || c == K_LEFTRELEASE || c == K_MIDDLEDRAG || c == K_MIDDLERELEASE - || c == K_RIGHTDRAG || c == K_RIGHTRELEASE - || c == K_MOUSELEFT || c == K_MOUSERIGHT - || c == K_MOUSEDOWN || c == K_MOUSEUP + || c == K_RIGHTDRAG || c == K_RIGHTRELEASE + || c == K_MOUSELEFT || c == K_MOUSERIGHT + || c == K_MOUSEDOWN || c == K_MOUSEUP || c == K_MOUSEMOVE); os_breakcheck(); /* diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index ffc930ac1e..f4f2690e47 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -145,7 +145,6 @@ int get_leader_len(char_u *line, char_u **flags, bool backward, bool include_spa } } for (j = 0; string[j] != NUL && string[j] == line[i + j]; ++j) { - ; } if (string[j] != NUL) { continue; // string doesn't match @@ -276,7 +275,7 @@ int get_last_leader_offset(char_u *line, char_u **flags) } } for (j = 0; string[j] != NUL && string[j] == line[i + j]; ++j) { - /* do nothing */; + // do nothing } if (string[j] != NUL) { continue; diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 438ddd6fd3..dec0109879 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -4772,7 +4772,6 @@ dozet: } - /* * "Q" command. */ @@ -5780,10 +5779,10 @@ static void nv_brackets(cmdarg_T *cap) * "[m" or "]m" search for prev/next start of (Java) method. * "[M" or "]M" search for prev/next end of (Java) method. */ - if ( (cap->cmdchar == '[' - && vim_strchr((char_u *)"{(*/#mM", cap->nchar) != NULL) - || (cap->cmdchar == ']' - && vim_strchr((char_u *)"})*/#mM", cap->nchar) != NULL)) { + if ((cap->cmdchar == '[' + && vim_strchr((char_u *)"{(*/#mM", cap->nchar) != NULL) + || (cap->cmdchar == ']' + && vim_strchr((char_u *)"})*/#mM", cap->nchar) != NULL)) { if (cap->nchar == '*') { cap->nchar = '/'; } diff --git a/src/nvim/ops.c b/src/nvim/ops.c index eb37213f1a..36a5e1e7e8 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1787,7 +1787,7 @@ int op_replace(oparg_T *oap, int c) char_u *after_p = NULL; int had_ctrl_v_cr = false; - if ((curbuf->b_ml.ml_flags & ML_EMPTY ) || oap->empty) { + if ((curbuf->b_ml.ml_flags & ML_EMPTY) || oap->empty) { return OK; // nothing to do } if (c == REPLACE_CR_NCHAR) { @@ -4141,7 +4141,6 @@ static int same_leader(linenr_T lnum, int leader1_len, char_u *leader1_flags, in */ line1 = vim_strsave(ml_get(lnum)); for (idx1 = 0; ascii_iswhite(line1[idx1]); ++idx1) { - ; } line2 = ml_get(lnum + 1); for (idx2 = 0; idx2 < leader2_len; ++idx2) { diff --git a/src/nvim/option.c b/src/nvim/option.c index 06b7c75245..8badf80924 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -419,7 +419,7 @@ void set_init_1(bool clean_arg) } xfree(item); } - if(mustfree) { + if (mustfree) { xfree(p); } } @@ -2932,7 +2932,7 @@ ambw_end: // When changing the 'signcolumn' to or from 'number', recompute the // width of the number column if 'number' or 'relativenumber' is set. if (((*oldval == 'n' && *(oldval + 1) == 'u') - || (*curwin->w_p_scl == 'n' && *(curwin->w_p_scl + 1) =='u')) + || (*curwin->w_p_scl == 'n' && *(curwin->w_p_scl + 1) == 'u')) && (curwin->w_p_nu || curwin->w_p_rnu)) { curwin->w_nrwidth_line_count = 0; } @@ -7330,7 +7330,7 @@ bool tabstop_set(char_u *var, long **array) t = 1; for (cp = var; *cp != NUL;) { (*array)[t++] = atoi((char *)cp); - while (*cp != NUL && *cp != ',') { + while (*cp != NUL && *cp != ',') { cp++; } if (*cp != NUL) { diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index 5a096393d3..5b231f205b 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -401,7 +401,7 @@ static InbufPollResult inbuf_poll(int ms, MultiQueue *events) prof_inchar_enter(); } - if ((ms == - 1 || ms > 0) && events != main_loop.events && !input_eof) { + if ((ms == -1 || ms > 0) && events != main_loop.events && !input_eof) { // The pending input provoked a blocking wait. Do special events now. #6247 blocking = true; multiqueue_process_events(ch_before_blocking_events); diff --git a/src/nvim/os/pty_conpty_win.c b/src/nvim/os/pty_conpty_win.c index 0625d6994e..f9478d951f 100644 --- a/src/nvim/os/pty_conpty_win.c +++ b/src/nvim/os/pty_conpty_win.c @@ -96,7 +96,7 @@ conpty_t *os_conpty_init(char **in_name, char **out_name, uint16_t width, uint16 goto failed; } assert(width <= SHRT_MAX); - assert(height <= SHRT_MAX); + assert(height <= SHRT_MAX); COORD size = { (int16_t)width, (int16_t)height }; HRESULT hr; hr = pCreatePseudoConsole(size, in_read, out_write, 0, &conpty_object->pty); @@ -107,7 +107,7 @@ conpty_t *os_conpty_init(char **in_name, char **out_name, uint16_t width, uint16 conpty_object->si_ex.StartupInfo.cb = sizeof(conpty_object->si_ex); size_t bytes_required; - InitializeProcThreadAttributeList(NULL, 1, 0, & bytes_required); + InitializeProcThreadAttributeList(NULL, 1, 0, &bytes_required); conpty_object->si_ex.lpAttributeList = (PPROC_THREAD_ATTRIBUTE_LIST)xmalloc(bytes_required); if (!InitializeProcThreadAttributeList(conpty_object->si_ex.lpAttributeList, diff --git a/src/nvim/path.c b/src/nvim/path.c index 5b1793b111..2a80079817 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -1011,8 +1011,7 @@ static void uniquefy_paths(garray_T *gap, char_u *pattern) // /file.txt / /file.txt // c:\file.txt c:\ .\file.txt short_name = path_shorten_fname(path, curdir); - if (short_name != NULL && short_name > path + 1 - ) { + if (short_name != NULL && short_name > path + 1) { STRCPY(path, "."); add_pathsep((char *)path); STRMOVE(path + STRLEN(path), short_name); @@ -1506,8 +1505,9 @@ void simplify_filename(char_u *filename) if (vim_ispathsep(*p)) { relative = false; - do + do{ ++p; + } while (vim_ispathsep(*p)); } start = p; // remember start after "c:/" or "/" or "///" diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 57c417c9c4..d4f68c9948 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -322,8 +322,7 @@ int qf_init(win_T *wp, const char_u *restrict efile, char_u *restrict errorforma // Maximum number of bytes allowed per line while reading an errorfile. static const size_t LINE_MAXLEN = 4096; -static struct fmtpattern -{ +static struct fmtpattern { char_u convchar; char *pattern; } fmt_pat[FMT_PATTERNS] = @@ -2379,7 +2378,7 @@ static qfline_T *get_nth_valid_entry(qf_list_T *qfl, int errornr, int dir, int * static qfline_T *get_nth_entry(qf_list_T *qfl, int errornr, int *new_qfidx) { qfline_T *qf_ptr = qfl->qf_ptr; - int qf_idx = qfl->qf_index;; + int qf_idx = qfl->qf_index; // New error number is less than the current error number while (errornr < qf_idx && qf_idx > 1 && qf_ptr->qf_prev != NULL) { @@ -7168,4 +7167,3 @@ void ex_helpgrep(exarg_T *eap) } } - diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c index 9dfd8547fc..9ecde88a51 100644 --- a/src/nvim/runtime.c +++ b/src/nvim/runtime.c @@ -574,7 +574,6 @@ void runtime_search_path_validate(void) } - /// Just like do_in_path_and_pp(), using 'runtimepath' for "path". int do_in_runtimepath(char_u *name, int flags, DoInRuntimepathCB callback, void *cookie) { diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 16c81307ce..2939ea1206 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -65,8 +65,8 @@ #include <stdbool.h> #include <string.h> -#include "nvim/api/private/helpers.h" #include "nvim/api/extmark.h" +#include "nvim/api/private/helpers.h" #include "nvim/api/vim.h" #include "nvim/arabic.h" #include "nvim/ascii.h" @@ -1952,7 +1952,7 @@ static size_t fill_foldcolumn(char_u *p, win_T *wp, foldinfo_T foldinfo, linenr_ first_level = 1; } - for (i = 0; i < MIN(fdc, level); i++) { + for (i = 0; i < MIN(fdc, level); i++) { if (foldinfo.fi_lnum == lnum && first_level + i >= foldinfo.fi_low_level) { symbol = wp->w_p_fcs_chars.foldopen; @@ -6081,7 +6081,7 @@ static void prepare_search_hl(win_T *wp, linenr_T lnum) || (cur != NULL && pos_inprogress))) { next_search_hl(wp, shl, shl->first_lnum, (colnr_T)n, shl == &search_hl ? NULL : cur); - pos_inprogress = !(cur == NULL || cur->pos.cur == 0); + pos_inprogress = !(cur == NULL || cur->pos.cur == 0); if (shl->lnum != 0) { shl->first_lnum = shl->lnum + shl->rm.endpos[0].lnum @@ -6725,7 +6725,6 @@ bool grid_invalid_row(ScreenGrid *grid, int row) } - /// Copy part of a grid line for vertically split window. static void linecopy(ScreenGrid *grid, int to, int from, int col, int width) { diff --git a/src/nvim/search.c b/src/nvim/search.c index c3a5f8dbe6..c3e6fb816b 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -2530,13 +2530,14 @@ int findsent(Direction dir, long count) } if (c == '.' || c == '!' || c == '?') { tpos = pos; - do + do{ if ((c = inc(&tpos)) == -1) { break; } + } while (vim_strchr((char_u *)")]\"'", c = gchar_pos(&tpos)) != NULL); - if (c == -1 || (!cpo_J && (c == ' ' || c == '\t')) || c == NUL + if (c == -1 || (!cpo_J && (c == ' ' || c == '\t')) || c == NUL || (cpo_J && (c == ' ' && inc(&tpos) >= 0 && gchar_pos(&tpos) == ' '))) { pos = tpos; @@ -2662,12 +2663,12 @@ static int inmacro(char_u *opt, char_u *s) // Accept two characters in the option being equal to two characters // in the line. A space in the option matches with a space in the // line or the line having ended. - if ( (macro[0] == s[0] - || (macro[0] == ' ' - && (s[0] == NUL || s[0] == ' '))) - && (macro[1] == s[1] - || ((macro[1] == NUL || macro[1] == ' ') - && (s[0] == NUL || s[1] == NUL || s[1] == ' ')))) { + if ((macro[0] == s[0] + || (macro[0] == ' ' + && (s[0] == NUL || s[0] == ' '))) + && (macro[1] == s[1] + || ((macro[1] == NUL || macro[1] == ' ') + && (s[0] == NUL || s[1] == NUL || s[1] == ' ')))) { break; } ++macro; @@ -4250,7 +4251,6 @@ abort_search: } - /// Find next search match under cursor, cursor at end. /// Used while an operator is pending, and in Visual mode. /// @@ -4934,10 +4934,8 @@ void find_pattern_in_path(char_u *ptr, Direction dir, size_t len, bool whole, bo // find the file name after the end of the match for (p = incl_regmatch.endp[0]; *p && !vim_isfilec(*p); p++) { - ; } for (i = 0; vim_isfilec(p[i]); i++) { - ; } } diff --git a/src/nvim/search.h b/src/nvim/search.h index 85bcda84a4..15b8d41f39 100644 --- a/src/nvim/search.h +++ b/src/nvim/search.h @@ -84,8 +84,7 @@ typedef struct { int sa_wrapped; ///< search wrapped around } searchit_arg_T; -typedef struct searchstat -{ +typedef struct searchstat { int cur; // current position of found words int cnt; // total count of found words bool exact_match; // true if matched exactly on specified position diff --git a/src/nvim/sign.c b/src/nvim/sign.c index 1b100161bf..bbc4d6a764 100644 --- a/src/nvim/sign.c +++ b/src/nvim/sign.c @@ -23,8 +23,7 @@ /// Struct to hold the sign properties. typedef struct sign sign_T; -struct sign -{ +struct sign { sign_T *sn_next; // next sign in list int sn_typenr; // type number of sign char_u *sn_name; // name of sign @@ -434,9 +433,9 @@ sign_attrs_T *sign_get_attr(SignType type, sign_attrs_T sattrs[], int idx, int m int nr_matches = 0; for (int i = 0; i < SIGN_SHOW_MAX; i++) { - if ( (type == SIGN_TEXT && sattrs[i].sat_text != NULL) - || (type == SIGN_LINEHL && sattrs[i].sat_linehl != 0) - || (type == SIGN_NUMHL && sattrs[i].sat_numhl != 0)) { + if ((type == SIGN_TEXT && sattrs[i].sat_text != NULL) + || (type == SIGN_LINEHL && sattrs[i].sat_linehl != 0) + || (type == SIGN_NUMHL && sattrs[i].sat_numhl != 0)) { matches[nr_matches] = &sattrs[i]; nr_matches++; // attr list is sorted with most important (priority, id), thus we diff --git a/src/nvim/sign_defs.h b/src/nvim/sign_defs.h index f3ec2c45f6..46436b2c8e 100644 --- a/src/nvim/sign_defs.h +++ b/src/nvim/sign_defs.h @@ -9,8 +9,7 @@ // signs: line annotations // Sign group -typedef struct signgroup_S -{ +typedef struct signgroup_S { uint16_t sg_refcount; // number of signs in this group int sg_next_sign_id; // next sign id for this group char_u sg_name[1]; // sign group name @@ -55,5 +54,4 @@ typedef enum { } SignType; - #endif // NVIM_SIGN_DEFS_H diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 9ed421c8a0..4fec82f46b 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -1758,7 +1758,8 @@ void slang_free(slang_T *lp) } /// Frees a salitem_T -static void free_salitem(salitem_T *smp) { +static void free_salitem(salitem_T *smp) +{ xfree(smp->sm_lead); // Don't free sm_oneof and sm_rules, they point into sm_lead. xfree(smp->sm_to); @@ -1768,7 +1769,8 @@ static void free_salitem(salitem_T *smp) { } /// Frees a fromto_T -static void free_fromto(fromto_T *ftp) { +static void free_fromto(fromto_T *ftp) +{ xfree(ftp->ft_from); xfree(ftp->ft_to); } @@ -3420,7 +3422,6 @@ static void spell_suggest_file(suginfo_T *su, char_u *fname) if (STRICMP(su->su_badword, line) == 0) { // Match! Isolate the good word, until CR or NL. for (len = 0; p[len] >= ' '; ++len) { - ; } p[len] = NUL; @@ -3813,7 +3814,6 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so if (sp->ts_prefixdepth == PFD_PREFIXTREE) { // Skip over the NUL bytes, we use them later. for (n = 0; n < len && byts[arridx + n] == 0; ++n) { - ; } sp->ts_curi += n; @@ -3888,7 +3888,6 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so n = stack[sp->ts_prefixdepth].ts_arridx; len = pbyts[n++]; for (c = 0; c < len && pbyts[n + c] == 0; ++c) { - ; } if (c > 0) { c = valid_word_prefix(c, n, flags, diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index e3a6236ae4..d041f2710c 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -549,7 +549,7 @@ static inline int spell_check_magic_string(FILE *const fd) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_ALWAYS_INLINE { char buf[VIMSPELLMAGICL]; - SPELL_READ_BYTES(buf, VIMSPELLMAGICL, fd, ;); + SPELL_READ_BYTES(buf, VIMSPELLMAGICL, fd, ; ); if (memcmp(buf, VIMSPELLMAGIC, VIMSPELLMAGICL) != 0) { return SP_FORMERROR; } @@ -1030,7 +1030,7 @@ static int read_region_section(FILE *fd, slang_T *lp, int len) if (len > MAXREGIONS * 2) { return SP_FORMERROR; } - SPELL_READ_NONNUL_BYTES((char *)lp->sl_regions, (size_t)len, fd, ;); + SPELL_READ_NONNUL_BYTES((char *)lp->sl_regions, (size_t)len, fd, ; ); lp->sl_regions[len] = NUL; return 0; } @@ -1097,7 +1097,7 @@ static int read_prefcond_section(FILE *fd, slang_T *lp) if (n > 0) { char buf[MAXWLEN + 1]; buf[0] = '^'; // always match at one position only - SPELL_READ_NONNUL_BYTES(buf + 1, (size_t)n, fd, ;); + SPELL_READ_NONNUL_BYTES(buf + 1, (size_t)n, fd, ; ); buf[n + 1] = NUL; lp->sl_prefprog[i] = vim_regcomp((char_u *)buf, RE_MAGIC | RE_STRING); } @@ -5164,13 +5164,13 @@ static int offset2bytes(int nr, char_u *buf) buf[3] = b1; return 4; } - if (b3 > 1 || b2 > 0x3f ) { // 3 bytes + if (b3 > 1 || b2 > 0x3f) { // 3 bytes buf[0] = 0xc0 + b3; buf[1] = b2; buf[2] = b1; return 3; } - if (b2 > 1 || b1 > 0x7f ) { // 2 bytes + if (b2 > 1 || b1 > 0x7f) { // 2 bytes buf[0] = 0x80 + b2; buf[1] = b1; return 2; diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 11c1aa1760..b405650b0e 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -1184,7 +1184,7 @@ int vim_vsnprintf_typval(char *str, size_t str_m, const char *fmt, va_list ap, t zero_padding_insertion_ind++; } if (zero_padding_insertion_ind + 1 < str_arg_l - && tmp[zero_padding_insertion_ind] == '0' + && tmp[zero_padding_insertion_ind] == '0' && (tmp[zero_padding_insertion_ind + 1] == 'x' || tmp[zero_padding_insertion_ind + 1] == 'X' || tmp[zero_padding_insertion_ind + 1] == 'b' diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index a82fd42976..d4be2b4e34 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -1082,7 +1082,6 @@ static void syn_stack_alloc(void) // Make sure that all valid entries fit in the new array. while (syn_block->b_sst_len - syn_block->b_sst_freecount + 2 > len && syn_stack_cleanup()) { - ; } if (len < syn_block->b_sst_len - syn_block->b_sst_freecount + 2) { len = syn_block->b_sst_len - syn_block->b_sst_freecount + 2; @@ -7771,8 +7770,6 @@ int syn_id2attr(int hl_id) } - - /* * Translate a group ID to the final group ID (following links). */ diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 13cf1c376f..427bf5b7b6 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -1066,7 +1066,6 @@ void do_tags(exarg_T *eap) } - /* * Compare two strings, for length "len", ignoring case the ASCII way. * return 0 for match, < 0 for smaller, > 0 for bigger @@ -1757,7 +1756,6 @@ line_read_in: } - /* * When still at the start of the file, check for Emacs tags file * format, and for "not sorted" flag. diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index fb025265f2..13005b263e 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -725,7 +725,7 @@ void terminal_get_line_attributes(Terminal *term, win_T *wp, int linenr, int *te int attr_id = 0; - if (hl_attrs ||!fg_default || !bg_default) { + if (hl_attrs || !fg_default || !bg_default) { attr_id = hl_get_term_attr(&(HlAttrs) { .cterm_ae_attr = (int16_t)hl_attrs, .cterm_fg_color = vt_fg_idx, diff --git a/src/nvim/undo.c b/src/nvim/undo.c index de396428a7..3691a0f2d2 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -135,7 +135,8 @@ static int seen_b_u_curhead; static int seen_b_u_newhead; static int header_count; -static void u_check_tree(u_header_T *uhp, u_header_T *exp_uh_next, u_header_T *exp_uh_alt_prev) { +static void u_check_tree(u_header_T *uhp, u_header_T *exp_uh_next, u_header_T *exp_uh_alt_prev) +{ u_entry_T *uep; if (uhp == NULL) { @@ -182,7 +183,8 @@ static void u_check_tree(u_header_T *uhp, u_header_T *exp_uh_next, u_header_T *e } } -static void u_check(int newhead_may_be_NULL) { +static void u_check(int newhead_may_be_NULL) +{ seen_b_u_newhead = 0; seen_b_u_curhead = 0; header_count = 0; diff --git a/src/nvim/version.c b/src/nvim/version.c index 142c46b303..dea21fcf04 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -1992,7 +1992,8 @@ bool has_vim_patch(int n) return false; } -Dictionary version_dict(void) { +Dictionary version_dict(void) +{ Dictionary d = ARRAY_DICT_INIT; PUT(d, "major", INTEGER_OBJ(NVIM_VERSION_MAJOR)); PUT(d, "minor", INTEGER_OBJ(NVIM_VERSION_MINOR)); diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 3dba0a769d..7334dfccb7 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -164,8 +164,6 @@ enum { }; - - // Minimal size for block 0 of a swap file. // NOTE: This depends on size of struct block0! It's not done with a sizeof(), // because struct block0 is defined in memline.c (Sorry). @@ -175,7 +173,6 @@ enum { #define MAX_SWAP_PAGE_SIZE 50000 - // Boolean constants #ifndef TRUE diff --git a/src/nvim/window.c b/src/nvim/window.c index 4a21c2eee5..d00f85fa95 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -59,8 +59,6 @@ #endif - - #define NOWIN (win_T *)-1 // non-existing window #define ROWS_AVAIL (Rows - p_ch - tabline_height()) @@ -1773,7 +1771,6 @@ static void win_rotate(bool upwards, int count) // find last frame and append removed window/frame after it for (; frp->fr_next != NULL; frp = frp->fr_next) { - ; } win_append(frp->fr_win, wp1); frame_append(frp, wp1->w_frame); @@ -1783,7 +1780,6 @@ static void win_rotate(bool upwards, int count) // find last window/frame in the list and remove it for (frp = curwin->w_frame; frp->fr_next != NULL; frp = frp->fr_next) { - ; } wp1 = frp->fr_win; wp2 = wp1->w_prev; // will become last window @@ -2707,7 +2703,6 @@ void win_close_othertab(win_T *win, int free_buf, tabpage_T *tp) // Careful: Autocommands may have closed the tab page or made it the // current tab page. for (ptp = first_tabpage; ptp != NULL && ptp != tp; ptp = ptp->tp_next) { - ; } if (ptp == NULL || tp == curtab) { return; @@ -3045,7 +3040,6 @@ static tabpage_T *alt_tabpage(void) // Find the last but one tab page. for (tp = first_tabpage; tp->tp_next != curtab; tp = tp->tp_next) { - ; } return tp; } @@ -3150,12 +3144,14 @@ static void frame_new_height(frame_T *topfrp, int height, bool topfirst, bool wf break; } if (topfirst) { - do + do{ frp = frp->fr_next; + } while (wfh && frp != NULL && frame_fixed_height(frp)); } else { - do + do{ frp = frp->fr_prev; + } while (wfh && frp != NULL && frame_fixed_height(frp)); } // Increase "height" if we could not reduce enough frames. @@ -3348,12 +3344,14 @@ static void frame_new_width(frame_T *topfrp, int width, bool leftfirst, bool wfw break; } if (leftfirst) { - do + do{ frp = frp->fr_next; + } while (wfw && frp != NULL && frame_fixed_width(frp)); } else { - do + do{ frp = frp->fr_prev; + } while (wfw && frp != NULL && frame_fixed_width(frp)); } // Increase "width" if we could not reduce enough frames. @@ -4120,14 +4118,12 @@ void goto_tabpage(int n) for (i = n; i < 0; ++i) { for (tp = first_tabpage; tp->tp_next != ttp && tp->tp_next != NULL; tp = tp->tp_next) { - ; } ttp = tp; } } else if (n == 9999) { // Go to last tab page. for (tp = first_tabpage; tp->tp_next != NULL; tp = tp->tp_next) { - ; } } else { // Go to tab page "n". @@ -5006,7 +5002,6 @@ void do_autocmd_winscrolled(win_T *wp) * Save the size of all windows in "gap". */ void win_size_save(garray_T *gap) - { ga_init(gap, (int)sizeof(int), 1); ga_grow(gap, win_count() * 2 + 1); @@ -6300,7 +6295,6 @@ static void last_status_rec(frame_T *fr, bool statusline) } else { // horizontally split window, set status line for last one for (fp = fr->fr_child; fp->fr_next != NULL; fp = fp->fr_next) { - ; } last_status_rec(fp, statusline); } @@ -7160,7 +7154,8 @@ void win_ui_flush(void) } } -win_T *lastwin_nofloating(void) { +win_T *lastwin_nofloating(void) +{ win_T *res = lastwin; while (res->w_floating) { res = res->w_prev; diff --git a/src/uncrustify.cfg b/src/uncrustify.cfg index c773b3e0ab..c06bf41d47 100644 --- a/src/uncrustify.cfg +++ b/src/uncrustify.cfg @@ -160,16 +160,16 @@ sp_pp_stringify = ignore # ignore/add/remove/force/not_defined sp_before_pp_stringify = ignore # ignore/add/remove/force/not_defined # Add or remove space around boolean operators '&&' and '||'. -sp_bool = ignore # ignore/add/remove/force/not_defined +sp_bool = force # ignore/add/remove/force/not_defined # Add or remove space around compare operator '<', '>', '==', etc. -sp_compare = ignore # ignore/add/remove/force/not_defined +sp_compare = force # ignore/add/remove/force/not_defined # Add or remove space inside '(' and ')'. -sp_inside_paren = ignore # ignore/add/remove/force/not_defined +sp_inside_paren = remove # ignore/add/remove/force/not_defined # Add or remove space between nested parentheses, i.e. '((' vs. ') )'. -sp_paren_paren = ignore # ignore/add/remove/force/not_defined +sp_paren_paren = remove # ignore/add/remove/force/not_defined # Add or remove space between back-to-back parentheses, i.e. ')(' vs. ') ('. sp_cparen_oparen = ignore # ignore/add/remove/force/not_defined @@ -301,7 +301,7 @@ sp_angle_word = ignore # ignore/add/remove/force/not_defined # Add or remove space between '>' and '>' in '>>' (template stuff). # # Default: add -sp_angle_shift = ignore # ignore/add/remove/force/not_defined +sp_angle_shift = add # ignore/add/remove/force/not_defined # (C++11) Permit removal of the space between '>>' in 'foo<bar<int> >'. Note # that sp_angle_shift cannot remove the space without this option. @@ -309,10 +309,10 @@ sp_permit_cpp11_shift = false # true/false # Add or remove space before '(' of control statements ('if', 'for', 'switch', # 'while', etc.). -sp_before_sparen = ignore # ignore/add/remove/force/not_defined +sp_before_sparen = force # ignore/add/remove/force/not_defined # Add or remove space inside '(' and ')' of control statements. -sp_inside_sparen = ignore # ignore/add/remove/force/not_defined +sp_inside_sparen = remove # ignore/add/remove/force/not_defined # Add or remove space after '(' of control statements. # @@ -370,12 +370,12 @@ sp_between_semi_for_empty = ignore # ignore/add/remove/force/not_defined # Add or remove space after ';', except when followed by a comment. # # Default: add -sp_after_semi = ignore # ignore/add/remove/force/not_defined +sp_after_semi = add # ignore/add/remove/force/not_defined # Add or remove space after ';' in non-empty 'for' statements. # # Default: force -sp_after_semi_for = ignore # ignore/add/remove/force/not_defined +sp_after_semi_for = force # ignore/add/remove/force/not_defined # Add or remove space after the final semicolon of an empty part of a for # statement, as in 'for ( ; ; <here> )'. @@ -387,7 +387,7 @@ sp_before_square = ignore # ignore/add/remove/force/not_defined # Add or remove space before '[' for a variable definition. # # Default: remove -sp_before_vardef_square = ignore # ignore/add/remove/force/not_defined +sp_before_vardef_square = remove # ignore/add/remove/force/not_defined # Add or remove space before '[' for asm block. sp_before_square_asm_block = ignore # ignore/add/remove/force/not_defined @@ -432,7 +432,7 @@ sp_between_mdatype_commas = ignore # ignore/add/remove/force/not_defined # i.e. '(,' vs. '( ,'. # # Default: force -sp_paren_comma = ignore # ignore/add/remove/force/not_defined +sp_paren_comma = force # ignore/add/remove/force/not_defined # Add or remove space after the variadic '...' when preceded by a # non-punctuator. @@ -474,12 +474,12 @@ sp_before_class_colon = ignore # ignore/add/remove/force/not_defined # Add or remove space after class constructor ':'. # # Default: add -sp_after_constr_colon = ignore # ignore/add/remove/force/not_defined +sp_after_constr_colon = add # ignore/add/remove/force/not_defined # Add or remove space before class constructor ':'. # # Default: add -sp_before_constr_colon = ignore # ignore/add/remove/force/not_defined +sp_before_constr_colon = add # ignore/add/remove/force/not_defined # Add or remove space before case ':'. # @@ -502,14 +502,14 @@ sp_after_operator_sym_empty = ignore # ignore/add/remove/force/not_defined sp_after_cast = remove # ignore/add/remove/force/not_defined # Add or remove spaces inside cast parentheses. -sp_inside_paren_cast = ignore # ignore/add/remove/force/not_defined +sp_inside_paren_cast = remove # ignore/add/remove/force/not_defined # Add or remove space between the type and open parenthesis in a C++ cast, # i.e. 'int(exp)' vs. 'int (exp)'. sp_cpp_cast_paren = ignore # ignore/add/remove/force/not_defined # Add or remove space between 'sizeof' and '('. -sp_sizeof_paren = ignore # ignore/add/remove/force/not_defined +sp_sizeof_paren = remove # ignore/add/remove/force/not_defined # Add or remove space between 'sizeof' and '...'. sp_sizeof_ellipsis = ignore # ignore/add/remove/force/not_defined @@ -694,12 +694,12 @@ sp_scope_paren = ignore # ignore/add/remove/force/not_defined # Add or remove space between 'super' and '(' in 'super (something)'. # # Default: remove -sp_super_paren = ignore # ignore/add/remove/force/not_defined +sp_super_paren = remove # ignore/add/remove/force/not_defined # Add or remove space between 'this' and '(' in 'this (something)'. # # Default: remove -sp_this_paren = ignore # ignore/add/remove/force/not_defined +sp_this_paren = remove # ignore/add/remove/force/not_defined # Add or remove space between a macro name and its definition. sp_macro = ignore # ignore/add/remove/force/not_defined @@ -751,7 +751,7 @@ sp_word_brace_init_lst = ignore # ignore/add/remove/force/not_defined # Add or remove space between a variable and '{' for a namespace. # # Default: add -sp_word_brace_ns = ignore # ignore/add/remove/force/not_defined +sp_word_brace_ns = add # ignore/add/remove/force/not_defined # Add or remove space before the '::' operator. sp_before_dc = ignore # ignore/add/remove/force/not_defined @@ -765,34 +765,34 @@ sp_d_array_colon = ignore # ignore/add/remove/force/not_defined # Add or remove space after the '!' (not) unary operator. # # Default: remove -sp_not = ignore # ignore/add/remove/force/not_defined +sp_not = remove # ignore/add/remove/force/not_defined # Add or remove space after the '~' (invert) unary operator. # # Default: remove -sp_inv = ignore # ignore/add/remove/force/not_defined +sp_inv = remove # ignore/add/remove/force/not_defined # Add or remove space after the '&' (address-of) unary operator. This does not # affect the spacing after a '&' that is part of a type. # # Default: remove -sp_addr = ignore # ignore/add/remove/force/not_defined +sp_addr = remove # ignore/add/remove/force/not_defined # Add or remove space around the '.' or '->' operators. # # Default: remove -sp_member = ignore # ignore/add/remove/force/not_defined +sp_member = remove # ignore/add/remove/force/not_defined # Add or remove space after the '*' (dereference) unary operator. This does # not affect the spacing after a '*' that is part of a type. # # Default: remove -sp_deref = ignore # ignore/add/remove/force/not_defined +sp_deref = remove # ignore/add/remove/force/not_defined # Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'. # # Default: remove -sp_sign = ignore # ignore/add/remove/force/not_defined +sp_sign = remove # ignore/add/remove/force/not_defined # Add or remove space between '++' and '--' the word to which it is being # applied, as in '(--x)' or 'y++;'. @@ -1549,7 +1549,7 @@ nl_enum_identifier_colon = ignore # ignore/add/remove/force/not_defined nl_enum_colon_type = ignore # ignore/add/remove/force/not_defined # Add or remove newline between 'struct and '{'. -nl_struct_brace = ignore # ignore/add/remove/force/not_defined +nl_struct_brace = remove # ignore/add/remove/force/not_defined # Add or remove newline between 'union' and '{'. nl_union_brace = ignore # ignore/add/remove/force/not_defined @@ -1565,16 +1565,16 @@ nl_brace_else = remove # ignore/add/remove/force/not_defined nl_elseif_brace = ignore # ignore/add/remove/force/not_defined # Add or remove newline between 'else' and '{'. -nl_else_brace = ignore # ignore/add/remove/force/not_defined +nl_else_brace = remove # ignore/add/remove/force/not_defined # Add or remove newline between 'else' and 'if'. -nl_else_if = ignore # ignore/add/remove/force/not_defined +nl_else_if = remove # ignore/add/remove/force/not_defined # Add or remove newline before '{' opening brace nl_before_opening_brace_func_class_def = ignore # ignore/add/remove/force/not_defined # Add or remove newline before 'if'/'else if' closing parenthesis. -nl_before_if_closing_paren = ignore # ignore/add/remove/force/not_defined +nl_before_if_closing_paren = remove # ignore/add/remove/force/not_defined # Add or remove newline between '}' and 'finally'. nl_brace_finally = ignore # ignore/add/remove/force/not_defined @@ -1897,7 +1897,7 @@ nl_template_end = false # true/false nl_oc_msg_args = false # true/false # Add or remove newline between function signature and '{'. -nl_fdef_brace = ignore # ignore/add/remove/force/not_defined +nl_fdef_brace = force # ignore/add/remove/force/not_defined # Add or remove newline between function signature and '{', # if signature ends with ')'. Overrides nl_fdef_brace. @@ -1907,7 +1907,7 @@ nl_fdef_brace_cond = ignore # ignore/add/remove/force/not_defined nl_cpp_ldef_brace = ignore # ignore/add/remove/force/not_defined # Add or remove newline between 'return' and the return expression. -nl_return_expr = ignore # ignore/add/remove/force/not_defined +nl_return_expr = remove # ignore/add/remove/force/not_defined # Whether to add a newline after semicolons, except in 'for' statements. nl_after_semicolon = false # true/false @@ -2093,7 +2093,7 @@ donot_add_nl_before_cpp_comment = false # true/false # # The maximum number of consecutive newlines (3 = 2 blank lines). -nl_max = 0 # unsigned number +nl_max = 3 # unsigned number # The maximum number of consecutive newlines in a function. nl_max_blank_in_func = 0 # unsigned number @@ -2886,7 +2886,7 @@ cmt_insert_before_ctor_dtor = false # true/false # # Add or remove braces on a single-line 'do' statement. -mod_full_brace_do = ignore # ignore/add/remove/force/not_defined +mod_full_brace_do = add # ignore/add/remove/force/not_defined # Add or remove braces on a single-line 'for' statement. mod_full_brace_for = add # ignore/add/remove/force/not_defined @@ -2947,10 +2947,10 @@ mod_pawn_semicolon = false # true/false mod_full_paren_if_bool = false # true/false # Whether to remove superfluous semicolons. -mod_remove_extra_semicolon = false # true/false +mod_remove_extra_semicolon = true # true/false # Whether to remove duplicate include. -mod_remove_duplicate_include = false # true/false +mod_remove_duplicate_include = true # true/false # If a function body exceeds the specified number of newlines and doesn't have # a comment after the close brace, a comment will be added. @@ -3307,5 +3307,5 @@ set QUESTION REAL_FATTR_CONST set QUESTION REAL_FATTR_NONNULL_ALL set QUESTION REAL_FATTR_PURE set QUESTION REAL_FATTR_WARN_UNUSED_RESULT -# option(s) with 'not default' value: 67 +# option(s) with 'not default' value: 69 # |