diff options
| author | dundargoc <gocdundar@gmail.com> | 2023-10-20 15:10:33 +0200 |
|---|---|---|
| committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-10-23 20:06:21 +0200 |
| commit | 5f03a1eaabfc8de2b3a9c666fcd604763f41e152 (patch) | |
| tree | 2a4e38bf7ac44749bd876d5e4d822f8ac604c2ae /src/nvim | |
| parent | e606604322815abd3dc91a5595a0aa976a9aded7 (diff) | |
| download | rneovim-5f03a1eaabfc8de2b3a9c666fcd604763f41e152.tar.gz rneovim-5f03a1eaabfc8de2b3a9c666fcd604763f41e152.tar.bz2 rneovim-5f03a1eaabfc8de2b3a9c666fcd604763f41e152.zip | |
build(lint): remove unnecessary clint.py rules
Uncrustify is the source of truth where possible.
Remove any redundant checks from clint.py.
Diffstat (limited to 'src/nvim')
70 files changed, 512 insertions, 503 deletions
diff --git a/src/nvim/api/extmark.h b/src/nvim/api/extmark.h index a7baad496f..7c300350e1 100644 --- a/src/nvim/api/extmark.h +++ b/src/nvim/api/extmark.h @@ -8,8 +8,8 @@ #include "nvim/map.h" #include "nvim/types.h" -EXTERN Map(String, int) namespace_ids INIT(= MAP_INIT); -EXTERN handle_T next_namespace_id INIT(= 1); +EXTERN Map(String, int) namespace_ids INIT( = MAP_INIT); +EXTERN handle_T next_namespace_id INIT( = 1); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/extmark.h.generated.h" diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index e5ad30a10f..9cf4620acd 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -128,9 +128,9 @@ #define api_free_window(value) #define api_free_tabpage(value) -EXTERN PMap(int) buffer_handles INIT(= MAP_INIT); -EXTERN PMap(int) window_handles INIT(= MAP_INIT); -EXTERN PMap(int) tabpage_handles INIT(= MAP_INIT); +EXTERN PMap(int) buffer_handles INIT( = MAP_INIT); +EXTERN PMap(int) window_handles INIT( = MAP_INIT); +EXTERN PMap(int) tabpage_handles INIT( = MAP_INIT); #define handle_get_buffer(h) pmap_get(int)(&buffer_handles, (h)) #define handle_get_window(h) pmap_get(int)(&window_handles, (h)) diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 6ce1f41e39..52022cba5d 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -2197,8 +2197,8 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error * } if (statuscol_lnum) { HlPriId line = { 0 }; - HlPriId cul = { 0 }; - HlPriId num = { 0 }; + HlPriId cul = { 0 }; + HlPriId num = { 0 }; linenr_T lnum = statuscol_lnum; int num_signs = buf_get_signattrs(wp->w_buffer, lnum, sattrs, &num, &line, &cul); decor_redraw_signs(wp->w_buffer, lnum - 1, &num_signs, sattrs, &num, &line, &cul); diff --git a/src/nvim/autocmd.h b/src/nvim/autocmd.h index 324a31be47..0992fca929 100644 --- a/src/nvim/autocmd.h +++ b/src/nvim/autocmd.h @@ -79,12 +79,12 @@ typedef kvec_t(AutoCmd) AutoCmdVec; // // Relying on this value requires one to reset it prior calling // apply_autocmds_group. -EXTERN bool au_did_filetype INIT(= false); +EXTERN bool au_did_filetype INIT( = false); /// For CursorMoved event -EXTERN win_T *last_cursormoved_win INIT(= NULL); +EXTERN win_T *last_cursormoved_win INIT( = NULL); /// For CursorMoved event, only used when last_cursormoved_win == curwin -EXTERN pos_T last_cursormoved INIT(= { 0, 0, 0 }); +EXTERN pos_T last_cursormoved INIT( = { 0, 0, 0 }); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "autocmd.h.generated.h" diff --git a/src/nvim/buffer.h b/src/nvim/buffer.h index 10d35ffc7e..2351ddc61b 100644 --- a/src/nvim/buffer.h +++ b/src/nvim/buffer.h @@ -69,8 +69,8 @@ enum bfa_values { BFA_IGNORE_ABORT = 8, // do not abort for aborting() }; -EXTERN char *msg_loclist INIT(= N_("[Location List]")); -EXTERN char *msg_qflist INIT(= N_("[Quickfix List]")); +EXTERN char *msg_loclist INIT( = N_("[Location List]")); +EXTERN char *msg_qflist INIT( = N_("[Quickfix List]")); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "buffer.h.generated.h" diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 5b223daeb0..812ac60eb0 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -361,7 +361,7 @@ typedef struct { #define BUF_UPDATE_CALLBACKS_INIT { LUA_NOREF, LUA_NOREF, LUA_NOREF, \ LUA_NOREF, LUA_NOREF, false, false } -EXTERN int curbuf_splice_pending INIT(= 0); +EXTERN int curbuf_splice_pending INIT( = 0); #define BUF_HAS_QF_ENTRY 1 #define BUF_HAS_LL_ENTRY 2 @@ -913,7 +913,7 @@ enum { // NE -> kFloatAnchorEast // SW -> kFloatAnchorSouth // SE -> kFloatAnchorSouth | kFloatAnchorEast -EXTERN const char *const float_anchor_str[] INIT(= { "NW", "NE", "SW", "SE" }); +EXTERN const char *const float_anchor_str[] INIT( = { "NW", "NE", "SW", "SE" }); typedef enum { kFloatRelativeEditor = 0, @@ -922,8 +922,8 @@ typedef enum { kFloatRelativeMouse = 3, } FloatRelative; -EXTERN const char *const float_relative_str[] INIT(= { "editor", "win", - "cursor", "mouse" }); +EXTERN const char *const float_relative_str[] INIT( = { "editor", "win", + "cursor", "mouse" }); typedef enum { kWinStyleUnused = 0, diff --git a/src/nvim/bufwrite.c b/src/nvim/bufwrite.c index c151da7ab7..a3d05f28be 100644 --- a/src/nvim/bufwrite.c +++ b/src/nvim/bufwrite.c @@ -818,7 +818,7 @@ static int buf_write_make_backup(char *fname, bool append, FileInfo *file_info_o while (*dirp) { // Isolate one directory name, using an entry in 'bdir'. size_t dir_len = copy_option_part(&dirp, IObuff, IOSIZE, ","); - char *p = IObuff + dir_len; + char *p = IObuff + dir_len; bool trailing_pathseps = after_pathsep(IObuff, p) && p[-1] == p[-2]; if (trailing_pathseps) { IObuff[dir_len - 2] = NUL; diff --git a/src/nvim/channel.h b/src/nvim/channel.h index deb693373c..281e1aa2be 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -108,9 +108,9 @@ struct Channel { bool callback_scheduled; }; -EXTERN PMap(uint64_t) channels INIT(= MAP_INIT); +EXTERN PMap(uint64_t) channels INIT( = MAP_INIT); -EXTERN Callback on_print INIT(= CALLBACK_INIT); +EXTERN Callback on_print INIT( = CALLBACK_INIT); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "channel.h.generated.h" diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h index fef5ff7c2a..b82beaeef3 100644 --- a/src/nvim/decoration.h +++ b/src/nvim/decoration.h @@ -26,8 +26,8 @@ typedef enum { kVTInline, } VirtTextPos; -EXTERN const char *const virt_text_pos_str[] INIT(= { "eol", "overlay", "win_col", "right_align", - "inline" }); +EXTERN const char *const virt_text_pos_str[] INIT( = { "eol", "overlay", "win_col", "right_align", + "inline" }); typedef enum { kHlModeUnknown, @@ -36,7 +36,7 @@ typedef enum { kHlModeBlend, } HlMode; -EXTERN const char *const hl_mode_str[] INIT(= { "", "replace", "combine", "blend" }); +EXTERN const char *const hl_mode_str[] INIT( = { "", "replace", "combine", "blend" }); #define VIRTTEXT_EMPTY ((VirtText)KV_INITIAL_VALUE) @@ -114,7 +114,7 @@ typedef struct { bool running_on_lines; } DecorState; -EXTERN DecorState decor_state INIT(= { 0 }); +EXTERN DecorState decor_state INIT( = { 0 }); static inline bool decor_has_sign(Decoration *decor) { diff --git a/src/nvim/decoration_provider.h b/src/nvim/decoration_provider.h index ad2cdd564d..2ee476ba45 100644 --- a/src/nvim/decoration_provider.h +++ b/src/nvim/decoration_provider.h @@ -29,7 +29,7 @@ typedef struct { typedef kvec_withinit_t(DecorProvider *, 4) DecorProviders; -EXTERN bool provider_active INIT(= false); +EXTERN bool provider_active INIT( = false); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "decoration_provider.h.generated.h" diff --git a/src/nvim/diff.c b/src/nvim/diff.c index b0663416ef..c76e6aaa2f 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -2950,7 +2950,7 @@ void ex_diffgetput(exarg_T *eap) } const int idx_from = eap->cmdidx == CMD_diffget ? idx_other : idx_cur; - const int idx_to = eap->cmdidx == CMD_diffget ? idx_cur : idx_other; + const int idx_to = eap->cmdidx == CMD_diffget ? idx_cur : idx_other; // May give the warning for a changed buffer here, which can trigger the // FileChangedRO autocommand, which may do nasty things and mess @@ -3505,10 +3505,10 @@ static int xdiff_out(int start_a, int count_a, int start_b, int count_b, void *p { diffout_T *dout = (diffout_T *)priv; GA_APPEND(diffhunk_T, &(dout->dout_ga), ((diffhunk_T){ - .lnum_orig = (linenr_T)start_a + 1, + .lnum_orig = (linenr_T)start_a + 1, .count_orig = count_a, - .lnum_new = (linenr_T)start_b + 1, - .count_new = count_b, + .lnum_new = (linenr_T)start_b + 1, + .count_new = count_b, })); return 0; } diff --git a/src/nvim/diff.h b/src/nvim/diff.h index 1f64465336..eda0fac5cb 100644 --- a/src/nvim/diff.h +++ b/src/nvim/diff.h @@ -8,11 +8,11 @@ #include "nvim/pos.h" // Value set from 'diffopt'. -EXTERN int diff_context INIT(= 6); // context for folds -EXTERN int diff_foldcolumn INIT(= 2); // 'foldcolumn' for diff mode -EXTERN bool diff_need_scrollbind INIT(= false); +EXTERN int diff_context INIT( = 6); // context for folds +EXTERN int diff_foldcolumn INIT( = 2); // 'foldcolumn' for diff mode +EXTERN bool diff_need_scrollbind INIT( = false); -EXTERN bool need_diff_redraw INIT(= false); // need to call diff_redraw() +EXTERN bool need_diff_redraw INIT( = false); // need to call diff_redraw() #ifdef INCLUDE_GENERATED_DECLARATIONS # include "diff.h.generated.h" diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 81b9d97dfc..3d63d2c24c 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -1171,14 +1171,14 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl int left_curline_col = 0; int right_curline_col = 0; - int match_conc = 0; ///< cchar for match functions - bool on_last_col = false; - int syntax_flags = 0; - int syntax_seqnr = 0; - int prev_syntax_id = 0; - int conceal_attr = win_hl_attr(wp, HLF_CONCEAL); - bool is_concealing = false; - int did_wcol = false; + int match_conc = 0; ///< cchar for match functions + bool on_last_col = false; + int syntax_flags = 0; + int syntax_seqnr = 0; + int prev_syntax_id = 0; + int conceal_attr = win_hl_attr(wp, HLF_CONCEAL); + bool is_concealing = false; + int did_wcol = false; int old_boguscols = 0; #define VCOL_HLC (wlv.vcol - wlv.vcol_off) #define FIX_FOR_BOGUSCOLS \ diff --git a/src/nvim/drawline.h b/src/nvim/drawline.h index f35b15c474..8345596e6f 100644 --- a/src/nvim/drawline.h +++ b/src/nvim/drawline.h @@ -20,9 +20,9 @@ typedef struct { int win_row; int win_col; } WinExtmark; -EXTERN kvec_t(WinExtmark) win_extmark_arr INIT(= KV_INITIAL_VALUE); +EXTERN kvec_t(WinExtmark) win_extmark_arr INIT( = KV_INITIAL_VALUE); -EXTERN bool conceal_cursor_used INIT(= false); +EXTERN bool conceal_cursor_used INIT( = false); // Spell checking variables passed from win_update() to win_line(). typedef struct { diff --git a/src/nvim/drawscreen.h b/src/nvim/drawscreen.h index 7fab7ebacf..f3044e693a 100644 --- a/src/nvim/drawscreen.h +++ b/src/nvim/drawscreen.h @@ -21,9 +21,9 @@ enum { /// While redrawing the screen this flag is set. It means the screen size /// ('lines' and 'rows') must not be changed. -EXTERN bool updating_screen INIT(= 0); +EXTERN bool updating_screen INIT( = 0); -EXTERN match_T screen_search_hl INIT(= { 0 }); // used for 'hlsearch' highlight matching +EXTERN match_T screen_search_hl INIT( = { 0 }); // used for 'hlsearch' highlight matching #define W_ENDCOL(wp) ((wp)->w_wincol + (wp)->w_width) #define W_ENDROW(wp) ((wp)->w_winrow + (wp)->w_height) diff --git a/src/nvim/eval.h b/src/nvim/eval.h index aee5fb11ca..837a64fc81 100644 --- a/src/nvim/eval.h +++ b/src/nvim/eval.h @@ -277,7 +277,7 @@ enum { }; /// Passed to an eval() function to enable evaluation. -EXTERN evalarg_T EVALARG_EVALUATE INIT(= { EVAL_EVALUATE, NULL, NULL, NULL }); +EXTERN evalarg_T EVALARG_EVALUATE INIT( = { EVAL_EVALUATE, NULL, NULL, NULL }); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval.h.generated.h" diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 8e5bf68be1..4759b4ebe3 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -2502,7 +2502,7 @@ static void f_getcwd(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) [kCdScopeTabpage] = 0, // Number of tab to look at. }; - char *cwd = NULL; // Current working directory to print + char *cwd = NULL; // Current working directory to print char *from = NULL; // The original string to copy tabpage_T *tp = curtab; // The tabpage to look at. @@ -3281,7 +3281,7 @@ static void f_haslocaldir(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) [kCdScopeTabpage] = 0, // Number of tab to look at. }; - tabpage_T *tp = curtab; // The tabpage to look at. + tabpage_T *tp = curtab; // The tabpage to look at. win_T *win = curwin; // The window to look at. rettv->v_type = VAR_NUMBER; @@ -5258,7 +5258,7 @@ static void f_prompt_setinterrupt(typval_T *argvars, typval_T *rettv, EvalFuncDa } callback_free(&buf->b_prompt_interrupt); - buf->b_prompt_interrupt= interrupt_callback; + buf->b_prompt_interrupt = interrupt_callback; } /// "prompt_getprompt({buffer})" function @@ -5589,9 +5589,9 @@ static void read_file_or_blob(typval_T *argvars, typval_T *rettv, bool always_bl char buf[(IOSIZE/256) * 256]; // rounded to avoid odd + 1 int io_size = sizeof(buf); char *prev = NULL; // previously read bytes, if any - ptrdiff_t prevlen = 0; // length of data in prev + ptrdiff_t prevlen = 0; // length of data in prev ptrdiff_t prevsize = 0; // size of prev buffer - int64_t maxline = MAXLNUM; + int64_t maxline = MAXLNUM; off_T offset = 0; off_T size = -1; @@ -5651,7 +5651,7 @@ static void read_file_or_blob(typval_T *argvars, typval_T *rettv, bool always_bl p < buf + readlen || (readlen <= 0 && (prevlen > 0 || binary)); p++) { if (readlen <= 0 || *p == '\n') { - char *s = NULL; + char *s = NULL; size_t len = (size_t)(p - start); // Finished a line. Remove CRs before NL. @@ -5754,7 +5754,7 @@ static void read_file_or_blob(typval_T *argvars, typval_T *rettv, bool always_bl prevsize = p - start; } else { ptrdiff_t grow50pc = (prevsize * 3) / 2; - ptrdiff_t growmin = (p - start) * 2 + prevlen; + ptrdiff_t growmin = (p - start) * 2 + prevlen; prevsize = grow50pc > growmin ? grow50pc : growmin; } prev = xrealloc(prev, (size_t)prevsize); diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 9fca4adcf7..badb948584 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -3964,13 +3964,13 @@ bool tv_check_str_or_nr(const typval_T *const tv) #define FUNC_ERROR "E703: Using a Funcref as a Number" static const char *const num_errors[] = { - [VAR_PARTIAL]= N_(FUNC_ERROR), - [VAR_FUNC]= N_(FUNC_ERROR), - [VAR_LIST]= N_("E745: Using a List as a Number"), - [VAR_DICT]= N_("E728: Using a Dictionary as a Number"), - [VAR_FLOAT]= N_("E805: Using a Float as a Number"), - [VAR_BLOB]= N_("E974: Using a Blob as a Number"), - [VAR_UNKNOWN]= N_("E685: using an invalid value as a Number"), + [VAR_PARTIAL] = N_(FUNC_ERROR), + [VAR_FUNC] = N_(FUNC_ERROR), + [VAR_LIST] = N_("E745: Using a List as a Number"), + [VAR_DICT] = N_("E728: Using a Dictionary as a Number"), + [VAR_FLOAT] = N_("E805: Using a Float as a Number"), + [VAR_BLOB] = N_("E974: Using a Blob as a Number"), + [VAR_UNKNOWN] = N_("E685: using an invalid value as a Number"), }; #undef FUNC_ERROR @@ -4009,12 +4009,12 @@ bool tv_check_num(const typval_T *const tv) #define FUNC_ERROR "E729: Using a Funcref as a String" static const char *const str_errors[] = { - [VAR_PARTIAL]= N_(FUNC_ERROR), - [VAR_FUNC]= N_(FUNC_ERROR), - [VAR_LIST]= N_("E730: Using a List as a String"), - [VAR_DICT]= N_("E731: Using a Dictionary as a String"), - [VAR_BLOB]= N_("E976: Using a Blob as a String"), - [VAR_UNKNOWN]= e_using_invalid_value_as_string, + [VAR_PARTIAL] = N_(FUNC_ERROR), + [VAR_FUNC] = N_(FUNC_ERROR), + [VAR_LIST] = N_("E730: Using a List as a String"), + [VAR_DICT] = N_("E731: Using a Dictionary as a String"), + [VAR_BLOB] = N_("E976: Using a Blob as a String"), + [VAR_UNKNOWN] = e_using_invalid_value_as_string, }; #undef FUNC_ERROR diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h index 0b42a473cf..7a168ba183 100644 --- a/src/nvim/eval/typval.h +++ b/src/nvim/eval/typval.h @@ -485,8 +485,8 @@ static inline bool tv_is_func(const typval_T tv) #ifdef UNIT_TESTING // Do not use enum constants, see commit message. -EXTERN const size_t kTVCstring INIT(= TV_CSTRING); -EXTERN const size_t kTVTranslate INIT(= TV_TRANSLATE); +EXTERN const size_t kTVCstring INIT( = TV_CSTRING); +EXTERN const size_t kTVTranslate INIT( = TV_TRANSLATE); #endif #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c index 10756015ad..52a3c81449 100644 --- a/src/nvim/event/socket.c +++ b/src/nvim/event/socket.c @@ -224,7 +224,7 @@ bool socket_connect(Loop *loop, Stream *stream, bool is_tcp, const char *address const struct addrinfo hints = { .ai_family = AF_UNSPEC, .ai_socktype = SOCK_STREAM, - .ai_flags = AI_NUMERICSERV }; + .ai_flags = AI_NUMERICSERV }; int retval = uv_getaddrinfo(&loop->uv, &addr_req, NULL, |