diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2022-05-25 20:31:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 12:31:14 -0600 |
commit | 9fec6dc9a25b5cf9c9a444ac2bd0728e8af3229e (patch) | |
tree | 83e044109d61242150b8c98897e179416025f576 | |
parent | 8c4e62351f67dd6a44f67f3a2b6f3a3551acf475 (diff) | |
download | rneovim-9fec6dc9a25b5cf9c9a444ac2bd0728e8af3229e.tar.gz rneovim-9fec6dc9a25b5cf9c9a444ac2bd0728e8af3229e.tar.bz2 rneovim-9fec6dc9a25b5cf9c9a444ac2bd0728e8af3229e.zip |
refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)
145 files changed, 5 insertions, 586 deletions
diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c index 4ee834d75a..19b4119344 100644 --- a/src/nvim/api/autocmd.c +++ b/src/nvim/api/autocmd.c @@ -31,7 +31,6 @@ goto goto_name; \ } - // ID for associating autocmds created via nvim_create_autocmd // Used to delete autocmds from nvim_del_autocmd static int64_t next_autocmd_id = 1; @@ -429,7 +428,6 @@ Integer nvim_create_autocmd(uint64_t channel_id, Object event, Dict(create_autoc AucmdExecutable aucmd = AUCMD_EXECUTABLE_INIT; Callback cb = CALLBACK_NONE; - if (!unpack_string_or_array(&event_array, &event, "event", true, err)) { goto cleanup; } @@ -550,7 +548,6 @@ Integer nvim_create_autocmd(uint64_t channel_id, Object event, Dict(create_autoc } }); - cleanup: aucmd_exec_free(&aucmd); api_free_array(event_array); diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 9842975d62..4fa8b13c54 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -35,7 +35,6 @@ # include "api/buffer.c.generated.h" #endif - /// \defgroup api-buffer /// /// \brief For more information on buffers, see |buffers| @@ -51,7 +50,6 @@ /// You can use |nvim_buf_is_loaded()| or |nvim_buf_line_count()| to check /// whether a buffer is loaded. - /// Returns the number of lines in the given buffer. /// /// @param buffer Buffer handle, or 0 for current buffer @@ -737,7 +735,6 @@ void nvim_buf_set_text(uint64_t channel_id, Buffer buffer, Integer start_row, In (int)new_len - 1, (colnr_T)last_item.size, new_byte, kExtmarkUndo); - changed_lines((linenr_T)start_row, 0, (linenr_T)end_row + 1, (long)extra, true); @@ -1039,7 +1036,6 @@ void nvim_buf_del_var(Buffer buffer, String name, Error *err) dict_set_var(buf->b_vars, name, NIL, true, false, err); } - /// Gets a buffer option value /// /// @param buffer Buffer handle, or 0 for current buffer @@ -1336,7 +1332,6 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) return rv; } - /// call a function with buffer as temporary current buffer /// /// This temporarily switches current buffer to "buffer". diff --git a/src/nvim/api/deprecated.c b/src/nvim/api/deprecated.c index f968593e47..abaac07755 100644 --- a/src/nvim/api/deprecated.c +++ b/src/nvim/api/deprecated.c @@ -78,7 +78,6 @@ void nvim_buf_clear_highlight(Buffer buffer, Integer ns_id, Integer line_start, nvim_buf_clear_namespace(buffer, ns_id, line_start, line_end, err); } - /// Set the virtual text (annotation) for a buffer line. /// /// @deprecated use nvim_buf_set_extmark to use full virtual text @@ -137,7 +136,6 @@ Integer nvim_buf_set_virtual_text(Buffer buffer, Integer src_id, Integer line, A return 0; } - Decoration *existing = decor_find_virttext(buf, (int)line, ns_id); if (existing) { @@ -292,7 +290,6 @@ void buffer_set_line_slice(Buffer buffer, Integer start, Integer end, Boolean in nvim_buf_set_lines(0, buffer, start, end, false, replacement, err); } - /// Sets a buffer-scoped (b:) variable /// /// @deprecated diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c index 94b2af9a6f..9d80a5be5f 100644 --- a/src/nvim/api/extmark.c +++ b/src/nvim/api/extmark.c @@ -94,7 +94,6 @@ static bool ns_initialized(uint32_t ns) return ns < (uint32_t)next_namespace_id; } - static Array extmark_to_array(const ExtmarkInfo *extmark, bool id, bool add_dict) { Array rv = ARRAY_DICT_INIT; @@ -233,7 +232,6 @@ ArrayOf(Integer) nvim_buf_get_extmark_by_id(Buffer buffer, Integer ns_id, } } - ExtmarkInfo extmark = extmark_from_id(buf, (uint32_t)ns_id, (uint32_t)id); if (extmark.row < 0) { return rv; @@ -333,7 +331,6 @@ Array nvim_buf_get_extmarks(Buffer buffer, Integer ns_id, Object start, Object e limit = INT64_MAX; } - bool reverse = false; int l_row; @@ -352,7 +349,6 @@ Array nvim_buf_get_extmarks(Buffer buffer, Integer ns_id, Object start, Object e reverse = true; } - ExtmarkInfoArray marks = extmark_get(buf, (uint32_t)ns_id, l_row, l_col, u_row, u_col, (int64_t)limit, reverse); @@ -675,7 +671,6 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer goto error; } - OPTION_TO_BOOL(decor.virt_lines_above, virt_lines_above, false); if (opts->priority.type == kObjectTypeInteger) { @@ -777,7 +772,6 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer col2 = 0; } - // TODO(bfredl): synergize these two branches even more if (ephemeral && decor_state.buf == buf) { decor_add_ephemeral((int)line, (int)col, line2, col2, &decor, (uint64_t)ns_id, id); diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index c251a4a25c..3cccbc3cdf 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -407,7 +407,6 @@ void set_option_to(uint64_t channel_id, void *to, int type, String name, Object }); } - buf_T *find_buffer_by_handle(Buffer buffer, Error *err) { if (buffer == 0) { @@ -1040,8 +1039,8 @@ Object copy_object(Object obj) } } -void set_option_value_for(char *key, long numval, char *stringval, int opt_flags, - int opt_type, void *from, Error *err) +void set_option_value_for(char *key, long numval, char *stringval, int opt_flags, int opt_type, + void *from, Error *err) { switchwin_T switchwin; aco_save_T aco; @@ -1080,7 +1079,6 @@ void set_option_value_for(char *key, long numval, char *stringval, int opt_flags try_end(err); } - static void set_option_value_err(char *key, long numval, char *stringval, int opt_flags, Error *err) { char *errmsg; @@ -1562,7 +1560,6 @@ void create_user_command(String name, Object command, Dict(user_command) *opts, goto err; } - if (api_object_to_bool(opts->register_, "register", false, err)) { argt |= EX_REGSTR; } else if (ERROR_SET(err)) { diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index bbbc3de7d5..8423db4970 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -146,7 +146,6 @@ typedef struct { code; \ } - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/private/helpers.h.generated.h" # include "keysets.h.generated.h" @@ -163,5 +162,4 @@ typedef struct { current_sctx = save_current_sctx; \ } while (0); - #endif // NVIM_API_PRIVATE_HELPERS_H diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 52f76f4650..dc04eedebc 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -196,7 +196,6 @@ void nvim_ui_detach(uint64_t channel_id, Error *err) remote_ui_disconnect(channel_id); } - void nvim_ui_try_resize(uint64_t channel_id, Integer width, Integer height, Error *err) FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { @@ -571,7 +570,6 @@ static void remote_ui_highlight_set(UI *ui, int id) Array args = ARRAY_DICT_INIT; UIData *data = ui->data; - if (data->hl_id == id) { return; } @@ -794,7 +792,6 @@ static void remote_ui_event(UI *ui, char *name, Array args, bool *args_consumed) } } - Array my_args = ARRAY_DICT_INIT; // Objects are currently single-reference // make a copy, but only if necessary diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 8e216c2031..7ca0912f82 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -209,7 +209,6 @@ static void on_redraw_event(void **argv) redraw_all_later(NOT_VALID); } - /// Sends input-keys to Nvim, subject to various quirks controlled by `mode` /// flags. This is a blocking call, unlike |nvim_input()|. /// @@ -441,7 +440,6 @@ String nvim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, Bool return cstr_as_string(ptr); } - /// Execute Lua code. Parameters (if any) are available as `...` inside the /// chunk. The chunk can return a value. /// @@ -570,7 +568,6 @@ ArrayOf(String) nvim__get_runtime(Array pat, Boolean all, Dict(runtime) *opts, E return runtime_get_named(is_lua, pat, all); } - /// Changes the global working directory. /// /// @param dir Directory path @@ -1245,7 +1242,6 @@ static void term_close(void *data) channel_decref(chan); } - /// Send data to channel `id`. For a job, it writes it to the /// stdin of the process. For the stdio channel |channel-stdio|, /// it writes to Nvim's stdout. For an internal terminal instance @@ -2192,7 +2188,6 @@ void nvim__screenshot(String path) ui_call_screenshot(path); } - /// Deletes an uppercase/file named mark. See |mark-motions|. /// /// @note fails with error if a lowercase or buffer local named mark is used. diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c index 0d8bdbec61..898d95f49a 100644 --- a/src/nvim/api/win_config.c +++ b/src/nvim/api/win_config.c @@ -22,7 +22,6 @@ # include "api/win_config.c.generated.h" #endif - /// Open a new window. /// /// Currently this is used to open floating and external windows. @@ -590,7 +589,6 @@ static bool parse_float_config(Dict(float_config) *config, FloatConfig *fconfig, return false; } - if (HAS_KEY(config->focusable)) { fconfig->focusable = api_object_to_bool(config->focusable, "'focusable' key", false, err); if (ERROR_SET(err)) { diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index 3a3a65f812..9f2afc67a6 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -373,7 +373,6 @@ Boolean nvim_win_is_valid(Window window) return ret; } - /// Closes the window and hide the buffer it contains (like |:hide| with a /// |window-ID|). /// diff --git a/src/nvim/arabic.c b/src/nvim/arabic.c index e76a75d37a..130ce65b86 100644 --- a/src/nvim/arabic.c +++ b/src/nvim/arabic.c @@ -244,7 +244,6 @@ #define a_BYTE_ORDER_MARK 0xfeff - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "arabic.c.generated.h" #endif diff --git a/src/nvim/ascii.h b/src/nvim/ascii.h index 692db40c0d..b1241166bf 100644 --- a/src/nvim/ascii.h +++ b/src/nvim/ascii.h @@ -75,7 +75,6 @@ #define Ctrl_HAT 30 // ^ #define Ctrl__ 31 - // Character that separates dir names in a path. #ifdef BACKSLASH_IN_FILENAME # define PATHSEP psepc diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index bc9e548b77..31efce13f6 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -126,7 +126,6 @@ static void augroup_map_del(int id, char *name) } } - static inline const char *get_deleted_augroup(void) FUNC_ATTR_ALWAYS_INLINE { if (deleted_augroup == NULL) { @@ -388,7 +387,6 @@ static void au_cleanup(void) au_need_clean = false; } - // Get the first AutoPat for a particular event. AutoPat *au_get_autopat_for_event(event_T event) FUNC_ATTR_PURE @@ -668,7 +666,6 @@ const char *event_nr2name(event_T event) return "Unknown"; } - /// Return true if "event" is included in 'eventignore'. /// /// @param event event to check @@ -1017,7 +1014,6 @@ int autocmd_register(int64_t id, event_T event, char *pat, int patlen, int group findgroup = group; } - // detect special <buffer[=X]> buffer-local patterns int is_buflocal = aupat_is_buflocal(pat, patlen); int buflocal_nr = 0; @@ -1853,7 +1849,6 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force reset_lnums(); } - if (eap != NULL) { (void)set_cmdarg(NULL, save_cmdarg); set_vim_var_nr(VV_CMDBANG, save_cmdbang); @@ -2651,7 +2646,6 @@ static bool arg_autocmd_flag_get(bool *flag, char **cmd_ptr, char *pattern, int return false; } - // UI Enter void do_autocmd_uienter(uint64_t chanid, bool attached) { diff --git a/src/nvim/autocmd.h b/src/nvim/autocmd.h index 47f583ae13..a085a03455 100644 --- a/src/nvim/autocmd.h +++ b/src/nvim/autocmd.h @@ -61,7 +61,6 @@ typedef struct AutoPatCmd { struct AutoPatCmd *next; // chain of active apc-s for auto-invalidation } AutoPatCmd; - // Set by the apply_autocmds_group function if the given event is equal to // EVENT_FILETYPE. Used by the readfile function in order to determine if // EVENT_BUFREADPOST triggered the EVENT_FILETYPE. @@ -70,7 +69,6 @@ typedef struct AutoPatCmd { // apply_autocmds_group. EXTERN bool au_did_filetype INIT(= false); - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "autocmd.h.generated.h" #endif diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 4b1aea5720..4c3f1308b3 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -1025,11 +1025,9 @@ char *do_bufdel(int command, char_u *arg, int addr_count, int start_bnr, int end } } - return errormsg; } - /// Make the current buffer empty. /// Used when it is wiped out and it's the last buffer. static int empty_curbuf(int close_others, int forceit, int action) @@ -1180,7 +1178,6 @@ int do_buffer(int action, int start, int dir, int count, int forceit) return FAIL; } - // delete buffer "buf" from memory and/or the list if (unload) { int forward; @@ -1425,7 +1422,6 @@ int do_buffer(int action, int start, int dir, int count, int forceit) return OK; } - /// Set current buffer to "buf". Executes autocommands and closes current /// buffer. /// @@ -1585,7 +1581,6 @@ void enter_buffer(buf_T *buf) scroll_cursor_halfway(false); // redisplay at correct position } - // Change directories when the 'acd' option is set. do_autochdir(); @@ -1932,7 +1927,6 @@ void free_buf_options(buf_T *buf, int free_p_ff) clear_string_option(&buf->b_p_menc); } - /// Get alternate file "n". /// Set linenr to "lnum" or altfpos.lnum if "lnum" == 0. /// Also set cursor column to altfpos.col if 'startofline' is not set. @@ -2357,7 +2351,6 @@ int ExpandBufnames(char_u *pat, int *num_file, char_u ***file, int options) return count == 0 ? FAIL : OK; } - /// Check for a match on the file name for buffer "buf" with regprog "prog". /// /// @param ignore_case When true, ignore case. Use 'fic' otherwise. @@ -2491,7 +2484,6 @@ void buflist_setfpos(buf_T *const buf, win_T *const win, linenr_T lnum, colnr_T } } - /// Check that "wip" has 'diff' set and the diff is only for another tab page. /// That's because a diff is local to a tab page. static bool wininfo_other_tab_diff(wininfo_T *wip) @@ -3113,7 +3105,6 @@ void col_print(char_u *buf, size_t buflen, int col, int vcol) static char_u *lasttitle = NULL; static char_u *lasticon = NULL; - /// Put the title name in the title bar and icon of the window. void maketitle(void) { @@ -3331,7 +3322,6 @@ static bool value_change(char_u *str, char_u **last) return false; } - /// Set current window title void resettitle(void) { @@ -3356,7 +3346,6 @@ typedef enum { kNumBaseHexadecimal = 16, } NumberBase; - /// Build a string from the status line items in "fmt". /// Return length of string in screen cells. /// @@ -3473,7 +3462,6 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, int use_san // so any user-visible characters must occur before here. char *out_end_p = (out + outlen) - 1; - // Proceed character by character through the statusline format string // fmt_p is the current position in the input buffer for (char *fmt_p = usefmt; *fmt_p;) { @@ -3915,7 +3903,6 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, int use_san } } - // If the output of the expression needs to be evaluated // replace the %{} block with the result of evaluation if (reevaluate && str != NULL && *str != 0 @@ -4698,7 +4685,6 @@ void do_arg_all(int count, int forceit, int keep_tabs) old_curwin = curwin; old_curtab = curtab; - // Try closing all windows that are not in the argument list. // Also close windows that are not full width; // When 'hidden' or "forceit" set the buffer becomes hidden. @@ -4947,7 +4933,6 @@ void ex_buffer_all(exarg_T *eap) setpcmark(); - // Close superfluous windows (two windows for the same buffer). // Also close windows that are not full-width. if (had_tab > 0) { @@ -5098,7 +5083,6 @@ void ex_buffer_all(exarg_T *eap) } } - /// do_modelines() - process mode lines for the current file /// /// @param flags diff --git a/src/nvim/buffer_updates.c b/src/nvim/buffer_updates.c index 57f052ced0..cb08ba0cfb 100644 --- a/src/nvim/buffer_updates.c +++ b/src/nvim/buffer_updates.c @@ -186,7 +186,6 @@ void buf_updates_unload(buf_T *buf, bool can_reload) } } - void buf_updates_send_changes(buf_T *buf, linenr_T firstline, int64_t num_added, int64_t num_removed, bool send_tick) { diff --git a/src/nvim/change.c b/src/nvim/change.c index c1fe5bc405..9fd5083fd3 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -615,7 +615,6 @@ void ins_char_bytes(char_u *buf, size_t charlen) oldlen = (size_t)utfc_ptr2len((char *)oldp + col); } - // Push the replaced bytes onto the replace stack, so that they can be // put back when BS is used. The bytes of a multi-byte character are // done the other way around, so that the first byte is popped off diff --git a/src/nvim/channel.c b/src/nvim/channel.c index 6278f84190..7a71be58c1 100644 --- a/src/nvim/channel.c +++ b/src/nvim/channel.c @@ -279,13 +279,11 @@ static void channel_destroy_early(Channel *chan) multiqueue_put(main_loop.events, free_channel_event, 1, chan); } - static void close_cb(Stream *stream, void *data) { channel_decref(data); } - /// Starts a job and returns the associated channel /// /// @param[in] argv Arguments vector specifying the command to run, @@ -416,7 +414,6 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout, CallbackReader return chan; } - uint64_t channel_connect(bool tcp, const char *address, bool rpc, CallbackReader on_output, int timeout, const char **error) { @@ -555,7 +552,6 @@ size_t channel_send(uint64_t id, char *data, size_t len, bool data_owned, const goto retfree; } - Stream *in = channel_instream(chan); if (in->closed) { *error = _("Can't send data to closed stream"); @@ -756,7 +752,6 @@ static void channel_callback_call(Channel *chan, CallbackReader *reader) tv_clear(&rettv); } - /// Open terminal for channel /// /// Channel `chan` is assumed to be an open pty channel, diff --git a/src/nvim/channel.h b/src/nvim/channel.h index 5cec5731eb..0f1b481792 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -149,5 +149,4 @@ static inline Stream *channel_outstream(Channel *chan) abort(); } - #endif // NVIM_CHANNEL_H diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 082791ffd1..649407ce12 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -34,7 +34,6 @@ # include "charset.c.generated.h" #endif - static bool chartab_initialized = false; // b_chartab[] is an array with 256 bits, each bit representing one of the @@ -495,7 +494,6 @@ char_u *str_foldcase(char_u *str, int orglen, char_u *buf, int buflen) i += utfc_ptr2len((char *)STR_PTR(i)); } - if (buf == NULL) { return (char_u *)ga.ga_data; } diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c index b69505d7c9..0248c25dfa 100644 --- a/src/nvim/cursor_shape.c +++ b/src/nvim/cursor_shape.c @@ -315,7 +315,6 @@ bool cursor_mode_uses_syn_id(int syn_id) return false; } - /// Return the index into shape_table[] for the current mode. int cursor_get_mode_idx(void) FUNC_ATTR_PURE diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c index b2ac28629c..16e96431e2 100644 --- a/src/nvim/debugger.c +++ b/src/nvim/debugger.c @@ -74,7 +74,6 @@ void do_debug(char_u *cmd) #define CMD_UP 9 #define CMD_DOWN 10 - RedrawingDisabled++; // don't redisplay the window no_wait_return++; // don't wait for return did_emsg = false; // don't use error from debugged stuff diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c index 28257dd7b5..b1a22b3294 100644 --- a/src/nvim/decoration.c +++ b/src/nvim/decoration.c @@ -180,7 +180,6 @@ static bool decor_virt_pos(Decoration decor) return kv_size(decor.virt_text) || decor.ui_watched; } - bool decor_redraw_start(buf_T *buf, int top_row, DecorState *state) { state->top_row = top_row; @@ -530,7 +529,6 @@ void decor_add_ephemeral(int start_row, int start_col, int end_row, int end_col, decor_add(&decor_state, start_row, start_col, end_row, end_col, decor, true, ns_id, mark_id); } - int decor_virt_lines(win_T *wp, linenr_T lnum, VirtLines *lines) { buf_T *buf = wp->w_buffer; diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h index 9a82af8661..8f28442d41 100644 --- a/src/nvim/decoration.h +++ b/src/nvim/decoration.h @@ -31,10 +31,8 @@ EXTERN const char *const hl_mode_str[] INIT(= { "", "replace", "combine", "blend typedef kvec_t(VirtTextChunk) VirtText; #define VIRTTEXT_EMPTY ((VirtText)KV_INITIAL_VALUE) - typedef kvec_t(struct virt_line { VirtText line; bool left_col; }) VirtLines; - struct Decoration { VirtText virt_text; VirtLines virt_lines; diff --git a/src/nvim/decoration_provider.c b/src/nvim/decoration_provider.c index ef27b2af1c..0f6a260247 100644 --- a/src/nvim/decoration_provider.c +++ b/src/nvim/decoration_provider.c @@ -140,7 +140,6 @@ void providers_invoke_line(win_T *wp, DecorProviders *providers, int row, bool * } } - /// For each provider invoke the 'buf' callback for a given buffer. /// /// @param buf Buffer @@ -158,7 +157,6 @@ void decor_providers_invoke_buf(buf_T *buf, DecorProviders *providers, char **er } } - /// For each provider invoke the 'end' callback /// /// @param providers Decoration providers diff --git a/src/nvim/diff.c b/src/nvim/diff.c index e8d54d7030..8c98c1ef23 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -1371,7 +1371,6 @@ static void set_diff_option(win_T *wp, int value) curbuf = curwin->w_buffer; } - /// Set options in window "wp" for diff mode. /// /// @param addbuf Add buffer to diff. @@ -2036,7 +2035,6 @@ void diff_set_topline(win_T *fromwin, win_T *towin) } towin->w_topfill = 0; - // search for a change that includes "lnum" in the list of diffblocks. for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next) { if (lnum <= dp->df_lnum[fromidx] + dp->df_count[fromidx]) { diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index 1b536bdde6..b461082be0 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -1832,7 +1832,6 @@ static void printdigraph(const digr_T *dp, result_T *previous) msg_putchar('\n'); } - // Make msg_col a multiple of list_width by using spaces. if (msg_col % list_width != 0) { int spaces = (msg_col / list_width + 1) * list_width - msg_col; @@ -2016,7 +2015,6 @@ typedef struct { #define KMAP_MAXLEN 20 // maximum length of "from" or "to" - /// Set up key mapping tables for the 'keymap' option. /// /// @return NULL if OK, an error message for failure. This only needs to be diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 568a8573db..eebdf3f0d6 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -245,7 +245,6 @@ typedef struct insert_state { char_u *ptr; } InsertState; - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "edit.c.generated.h" #endif @@ -575,7 +574,6 @@ static int insert_check(VimState *state) // When emsg() was called msg_scroll will have been set. msg_scroll = false; - // Open fold at the cursor line, according to 'foldopen'. if (fdo_flags & FDO_INSERT) { foldOpenCursor(); @@ -838,7 +836,6 @@ static int insert_execute(VimState *state, int key) return insert_handle_key(s); } - static int insert_handle_key(InsertState *s) { // The big switch to handle a character in insert mode. @@ -904,14 +901,12 @@ static int insert_handle_key(InsertState *s) case K_SELECT: // end of Select mode mapping - ignore break; - case K_HELP: // Help key works like <ESC> <Help> case K_F1: case K_XF1: stuffcharReadbuff(K_HELP); return 0; // exit insert mode - case ' ': if (mod_mask != MOD_MASK_CTRL) { goto normalchar; @@ -1157,7 +1152,6 @@ check_pum: } break; - case K_S_TAB: // When not mapped, use like a normal TAB s->c = TAB; FALLTHROUGH; @@ -2071,7 +2065,6 @@ bool ctrl_x_mode_not_defined_yet(void) return ctrl_x_mode == CTRL_X_NOT_DEFINED_YET; } - /// Check that the "dict" or "tsr" option can be used. /// /// @param dict_opt check "dict" when true, "tsr" when false. @@ -2608,7 +2601,6 @@ void completeopt_was_set(void) } } - /* * Start completion for the complete() function. * "startcol" is where the matched text starts (1 is first column). @@ -2672,13 +2664,11 @@ void set_completion(colnr_T startcol, list_T *list) ui_flush(); } - /* "compl_match_array" points the currently displayed list of entries in the * popup menu. It is NULL when there is no popup menu. */ static pumitem_T *compl_match_array = NULL; static int compl_match_arraysize; - /* * Remove any popup menu. */ @@ -3343,7 +3333,6 @@ static char_u *ins_compl_mode(void) return (char_u *)""; } - /* * Delete one character before the cursor and show the subset of the matches * that match the word that is now before the cursor. @@ -3929,7 +3918,6 @@ static buf_T *ins_compl_next_buf(buf_T *buf, int flag) return buf; } - /// Get the user-defined completion function name for completion 'type' static char_u *get_complete_funcname(int type) { @@ -5393,7 +5381,6 @@ static int ins_complete(int c, bool enable_pum) save_w_leftcol = curwin->w_leftcol; n = ins_compl_next(true, ins_compl_key2count(c), insert_match, false); - if (n > 1) { // all matches have been found compl_matches = n; } @@ -7754,7 +7741,6 @@ static void ins_reg(void) add_to_showcmd_c(Ctrl_R); } - // Don't map the register name. This also prevents the mode message to be // deleted when ESC is hit. no_mapping++; @@ -7999,7 +7985,6 @@ static bool ins_esc(long *count, int cmdchar, bool nomove) } } - State = MODE_NORMAL; may_trigger_modechanged(); // need to position cursor again when on a TAB @@ -8202,7 +8187,6 @@ static void ins_del(void) AppendCharToRedobuff(K_DEL); } - /* * Delete one character for ins_bs(). */ @@ -8628,7 +8612,6 @@ static void ins_mousescroll(int dir) } } - static void ins_left(void) { pos_T tpos; @@ -9154,7 +9137,6 @@ static int ins_digraph(void) add_to_showcmd_c(Ctrl_K); } - // don't map the digraph chars. This also prevents the // mode message to be deleted when ESC is hit no_mapping++; diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 33080c145d..792c8d3aec 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -53,12 +53,10 @@ #include "nvim/version.h" #include "nvim/window.h" - // TODO(ZyX-I): Remove DICT_MAXNEST, make users be non-recursive instead #define DICT_MAXNEST 100 // maximum nesting of lists and dicts - static char *e_letunexp = N_("E18: Unexpected characters in :let"); static char *e_missbrac = N_("E111: Missing ']'"); static char *e_dictrange = N_("E719: Cannot use [:] with a Dictionary"); @@ -1067,7 +1065,6 @@ int get_spellword(list_T *const list, const char **ret_word) return tv_list_find_nr(list, -1, NULL); } - // Call some vim script function and return the result in "*rettv". // Uses argv[0] to argv[argc-1] for the function arguments. argv[argc] // should have type VAR_UNKNOWN. @@ -1209,7 +1206,6 @@ void prof_child_exit(proftime_T *tm) script_prof_restore(tm); } - /// Evaluate 'foldexpr'. Returns the foldlevel, and any character preceding /// it in "*cp". Doesn't give error messages. int eval_foldexpr(char *arg, int *cp) @@ -2701,7 +2697,6 @@ void free_for_info(void *fi_void) xfree(fi); } - void set_context_for_expression(expand_T *xp, char *arg, cmdidx_T cmdidx) FUNC_ATTR_NONNULL_ALL { @@ -3146,7 +3141,6 @@ void del_menutrans_vars(void) * get_user_var_name(). */ - static char *varnamebuf = NULL; static size_t varnamebuflen = 0; @@ -5636,7 +5630,6 @@ bool set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack return abort; } - /// Mark all lists and dicts referenced in given mark /// /// @return true if setting references failed somehow. @@ -5683,7 +5676,6 @@ static inline bool set_ref_dict(dict_T *dict, int copyID) return false; } - /// Get the key for *{key: val} into "tv" and advance "arg". /// /// @return FAIL when there is no valid key. @@ -7287,7 +7279,6 @@ static bool set_ref_in_callback(Callback *callback, int copyID, ht_stack_T **ht_ return set_ref_in_item(&tv, copyID, ht_stack, list_stack); break; - default: abort(); } @@ -10248,7 +10239,6 @@ repeat: *usedlen += 2; } - // ":t" - tail, just the basename if (src[*usedlen] == ':' && src[*usedlen + 1] == 't') { *usedlen += 2; @@ -10489,7 +10479,6 @@ bool common_job_callbacks(dict_T *vopts, CallbackReader *on_stdout, CallbackRead return false; } - Channel *find_job(uint64_t id, bool show_error) { Channel *data = find_channel(id); @@ -10507,7 +10496,6 @@ Channel *find_job(uint64_t id, bool show_error) return data; } - void script_host_eval(char *name, typval_T *argvars, typval_T *rettv) { if (check_secure()) { diff --git a/src/nvim/eval.h b/src/nvim/eval.h index 101f6d9176..fa02b1ea0f 100644 --- a/src/nvim/eval.h +++ b/src/nvim/eval.h @@ -199,7 +199,6 @@ typedef struct { hashtab_T sve_hashtab; } save_v_event_T; - /// trans_function_name() flags typedef enum { TFN_INT = 1, ///< May use internal function name diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 59c290a5b1..fc8c9ef445 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -99,7 +99,6 @@ PRAGMA_DIAG_POP // uncrustify:on #endif - static char *e_listblobarg = N_("E899: Argument of %s must be a List or Blob"); static char *e_invalwindow = N_("E957: Invalid window number"); static char *e_reduceempty = N_("E998: Reduce of an empty %s with no initial value"); @@ -112,7 +111,6 @@ static char *e_reduceempty = N_("E998: Reduce of an empty %s with no initial val /// - using va_start() to initialize it gives "function with fixed args" error static va_list dummy_ap; - /// Function given to ExpandGeneric() to obtain the list of internal /// or user defined function names. char *get_function_name(expand_T *xp, int idx) @@ -345,7 +343,6 @@ static void f_and(typval_T *argvars, typval_T *rettv, FunPtr fptr) & tv_get_number_chk(&argvars[1], NULL); } - /// "api_info()" function static void f_api_info(typval_T *argvars, typval_T *rettv, FunPtr fptr) { @@ -472,7 +469,6 @@ static void f_browsedir(typval_T *argvars, typval_T *rettv, FunPtr fptr) f_browse(argvars, rettv, NULL); } - /// Find a buffer by number or exact name. static buf_T *find_buffer(typval_T *avar) { @@ -2169,7 +2165,6 @@ static void f_expand(typval_T *argvars, typval_T *rettv, FunPtr fptr) #endif } - /// "menu_get(path [, modes])" function static void f_menu_get(typval_T *argvars, typval_T *rettv, FunPtr fptr) { @@ -2207,7 +2202,6 @@ static void f_expandcmd(typval_T *argvars, typval_T *rettv, FunPtr fptr) rettv->vval.v_string = (char *)cmdstr; } - /// "flatten(list[, {maxdepth}])" function static void f_flatten(typval_T *argvars, typval_T *rettv, FunPtr fptr) { @@ -2359,7 +2353,6 @@ static void f_filewritable(typval_T *argvars, typval_T *rettv, FunPtr fptr) rettv->vval.v_number = os_file_is_writable(filename); } - static void findfilendir(typval_T *argvars, typval_T *rettv, int find_what) { char_u *fresult = NULL; @@ -2418,7 +2411,6 @@ static void findfilendir(typval_T *argvars, typval_T *rettv, int find_what) } } - /// "filter()" function static void f_filter(typval_T *argvars, typval_T *rettv, FunPtr fptr) { @@ -2502,7 +2494,6 @@ static void f_fnamemodify(typval_T *argvars, typval_T *rettv, FunPtr fptr) xfree(fbuf); } - /// "foldclosed()" function static void foldclosed_both(typval_T *argvars, typval_T *rettv, int end) { @@ -3570,7 +3561,6 @@ static void f_getloclist(typval_T *argvars, typval_T *rettv, FunPtr fptr) get_qf_loc_list(false, wp, &argvars[1], rettv); } - /// "getmarklist()" function static void f_getmarklist(typval_T *argvars, typval_T *rettv, FunPtr fptr) { @@ -4763,7 +4753,6 @@ static void f_inputlist(typval_T *argvars, typval_T *rettv, FunPtr fptr) rettv->vval.v_number = selected; } - static garray_T ga_userinput = { 0, 0, sizeof(tasave_T), 4, NULL }; /// "inputrestore()" function @@ -5005,7 +4994,6 @@ static void f_jobresize(typval_T *argvars, typval_T *rettv, FunPtr fptr) return; } - Channel *data = find_job(argvars[0].vval.v_number, true); if (!data) { return; @@ -5170,7 +5158,6 @@ static void f_jobstart(typval_T *argvars, typval_T *rettv, FunPtr fptr) return; } - dict_T *job_opts = NULL; bool detach = false; bool rpc = false; @@ -5660,7 +5647,6 @@ static void f_localtime(typval_T *argvars, typval_T *rettv, FunPtr fptr) rettv->vval.v_number = (varnumber_T)time(NULL); } - static void get_maparg(typval_T *argvars, typval_T *rettv, int exact) { char *keys_buf = NULL; @@ -5774,7 +5760,6 @@ static void f_mapcheck(typval_T *argvars, typval_T *rettv, FunPtr fptr) get_maparg(argvars, rettv, FALSE); } - static void find_some_match(typval_T *const argvars, typval_T *const rettv, const SomeMatchType type) { @@ -7903,7 +7888,6 @@ static void f_rpcrequest(typval_T *argvars, typval_T *rettv, FunPtr fptr) set_current_funccal((funccall_T *)(provider_caller_scope.funccalp)); } - Error err = ERROR_INIT; uint64_t chan_id = (uint64_t)argvars[0].vval.v_number; @@ -9578,7 +9562,6 @@ static void f_stdioopen(typval_T *argvars, typval_T *rettv, FunPtr fptr) return; } - bool rpc = false; CallbackReader on_stdin = CALLBACK_READER_INIT; dict_T *opts = argvars[0].vval.v_dict; @@ -9602,7 +9585,6 @@ static void f_stdioopen(typval_T *argvars, typval_T *rettv, FunPtr fptr) semsg(e_stdiochan2, error); } - rettv->vval.v_number = (varnumber_T)id; rettv->v_type = VAR_NUMBER; } @@ -10390,7 +10372,6 @@ static void f_synIDattr(typval_T *argvars, typval_T *rettv, FunPtr fptr) modec = 'c'; } - const char *p = NULL; switch (TOLOWER_ASC(what[0])) { case 'b': @@ -10538,7 +10519,6 @@ static void f_systemlist(typval_T *argvars, typval_T *rettv, FunPtr fptr) get_system_output_as_rettv(argvars, rettv, true); } - /// "tabpagebuflist()" function static void f_tabpagebuflist(typval_T *argvars, typval_T *rettv, FunPtr fptr) { @@ -10584,7 +10564,6 @@ static void f_tabpagenr(typval_T *argvars, typval_T *rettv, FunPtr fptr) rettv->vval.v_number = nr; } - /// Common code for tabpagewinnr() and winnr(). static int get_winnr(tabpage_T *tp, typval_T *argvar) { @@ -10898,7 +10877,6 @@ static void f_timer_start(typval_T *argvars, typval_T *rettv, FunPtr fptr) timer_start(tv_get_number(&argvars[0]), repeat, &callback); } - /// "timer_stop(timerid)" function static void f_timer_stop(typval_T *argvars, typval_T *rettv, FunPtr fptr) { diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 035bf6318a..de3d9bdf7f 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1515,7 +1515,6 @@ void tv_dict_free(dict_T *const d) } } - /// Unreference a dictionary /// /// Decrements the reference count and frees dictionary when it becomes zero. diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index 2059d423d5..9938dc5012 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -200,7 +200,6 @@ static void register_closure(ufunc_T *fp) [current_funccal->fc_funcs.ga_len++] = fp; } - /// @return a name for a lambda. Returned in static memory. char_u *get_lambda_name(void) { diff --git a/src/nvim/event/loop.c b/src/nvim/event/loop.c index d4e20e2f66..f40573a0bc 100644 --- a/src/nvim/event/loop.c +++ b/src/nvim/event/loop.c @@ -13,7 +13,6 @@ # include "event/loop.c.generated.h" #endif - void loop_init(Loop *loop, void *data) { uv_loop_init(&loop->uv); diff --git a/src/nvim/event/loop.h b/src/nvim/event/loop.h index b3cd60f53d..c0c5bc527f 100644 --- a/src/nvim/event/loop.h +++ b/src/nvim/event/loop.h @@ -82,7 +82,6 @@ typedef struct loop { } \ } while (0) - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/loop.h.generated.h" #endif diff --git a/src/nvim/event/multiqueue.c b/src/nvim/event/multiqueue.c index a90cbc4e80..40d20033e0 100644 --- a/src/nvim/event/multiqueue.c +++ b/src/nvim/event/multiqueue.c @@ -82,7 +82,6 @@ typedef struct { int refcount; } MulticastEvent; ///< Event present on multiple queues. - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/multiqueue.c.generated.h" #endif diff --git a/src/nvim/event/multiqueue.h b/src/nvim/event/multiqueue.h index dc60fbb4c7..2c5ba9d436 100644 --- a/src/nvim/event/multiqueue.h +++ b/src/nvim/event/multiqueue.h @@ -12,7 +12,6 @@ typedef void (*PutCallback)(MultiQueue *multiq, void *data); #define multiqueue_put(q, h, ...) \ multiqueue_put_event(q, event_create(h, __VA_ARGS__)); - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/multiqueue.h.generated.h" #endif diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h index c20feb2c7a..30254bfe07 100644 --- a/src/nvim/event/process.h +++ b/src/nvim/event/process.h @@ -33,7 +33,6 @@ struct process { MultiQueue *events; }; - static inline Process process_init(Loop *loop, ProcessType type, void *data) { return (Process) { diff --git a/src/nvim/event/rstream.c b/src/nvim/event/rstream.c index 26b5ce3b75..2847788ef8 100644 --- a/src/nvim/event/rstream.c +++ b/src/nvim/event/rstream.c @@ -42,7 +42,6 @@ void rstream_init(Stream *stream, size_t bufsize) stream->buffer->nonfull_cb = on_rbuffer_nonfull; } - /// Starts watching for events from a `Stream` instance. /// /// @param stream The `Stream` instance diff --git a/src/nvim/event/rstream.h b/src/nvim/event/rstream.h index 77418c59a2..23ed00bfea 100644 --- a/src/nvim/event/rstream.h +++ b/src/nvim/event/rstream.h @@ -8,7 +8,6 @@ #include "nvim/event/loop.h" #include "nvim/event/stream.h" - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/rstream.h.generated.h" #endif diff --git a/src/nvim/event/signal.c b/src/nvim/event/signal.c index fec46da4ff..4a45a2ec2f 100644 --- a/src/nvim/event/signal.c +++ b/src/nvim/event/signal.c @@ -10,7 +10,6 @@ # include "event/signal.c.generated.h" #endif - void signal_watcher_init(Loop *loop, SignalWatcher *watcher, void *data) FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_NONNULL_ARG(2) { diff --git a/src/nvim/event/time.c b/src/nvim/event/time.c index aa7b9cf2a1..c997e3c558 100644 --- a/src/nvim/event/time.c +++ b/src/nvim/event/time.c @@ -11,7 +11,6 @@ # include "event/time.c.generated.h" #endif - void time_watcher_init(Loop *loop, TimeWatcher *watcher, void *data) FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_NONNULL_ARG(2) { diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index f5fa424514..f6bdfc6175 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -73,7 +73,6 @@ #include "nvim/vim.h" #include "nvim/window.h" - /// Case matching style to use for :substitute typedef enum { kSubHonorOptions = 0, ///< Honor the user's 'ignorecase'/'smartcase' options @@ -1507,7 +1506,6 @@ void do_shell(char *cmd, int flags) return; } - /* * For autocommands we want to get the output on the current screen, to * avoid having to type return below. @@ -2883,7 +2881,6 @@ int do_ecmd(int fnum, char *ffname, char *sfname, exarg_T *eap, linenr_T newlnum // Change directories when the 'acd' option is set. do_autochdir(); - theend: if (bufref_valid(&old_curbuf) && old_curbuf.br_buf->terminal != NULL) { terminal_check_size(old_curbuf.br_buf->terminal); @@ -4065,7 +4062,6 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, bool do_buf_event, handle goto skip; } - // 3. Substitute the string. During 'inccommand' preview only do this if // there is a replace pattern. if (!preview || has_second_delim) { @@ -4143,7 +4139,6 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, bool do_buf_event, handle } replaced_bytes += end.col - start.col; - // Now the trick is to replace CTRL-M chars with a real line // break. This would make it impossible to insert a CTRL-M in // the text. The line break can be avoided by preceding the @@ -4199,7 +4194,6 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, bool do_buf_event, handle lnum - lnum_start, subcols, sublen - 1, kExtmarkUndo); } - // 4. If subflags.do_all is set, find next match. // Prevent endless loop with patterns that match empty // strings, e.g. :s/$/pat/g or :s/[a-z]* /(&)/g. @@ -4751,7 +4745,6 @@ bool prepare_tagpreview(bool undo_sync) return false; } - /// ":help": open a read-only window on a help file void ex_help(exarg_T *eap) { @@ -4932,7 +4925,6 @@ erret: xfree(tag); } - /// In an argument search for a language specifiers in the form "@xx". /// Changes the "@" to NUL if found, and returns a pointer to "xx". /// @@ -5520,7 +5512,6 @@ void ex_viusage(exarg_T *eap) do_cmdline_cmd("help normal-index"); } - /// Generate tags in one help directory /// /// @param dir Path to the doc directory diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index a6cafb2628..0a91072036 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -537,7 +537,6 @@ bool check_changed(buf_T *buf, int flags) return false; } - /// Ask the user what to do when abandoning a changed buffer. /// Must check 'write' option first! /// @@ -625,7 +624,6 @@ bool can_abandon(buf_T *buf, int forceit) || forceit; } - /// Add a buffer number to "bufnrs", unless it's already there. static void add_bufnum(int *bufnrs, int *bufnump, int nr) { @@ -878,7 +876,6 @@ int get_arglist_exp(char_u *str, int *fcountp, char_u ***fnamesp, bool wig) return i; } - /// @param str /// @param what /// AL_SET: Redefine the argument list to 'str'. @@ -1637,7 +1634,6 @@ void ex_compiler(exarg_T *eap) } } - /// ":options" void ex_options(exarg_T *eap) { @@ -2146,7 +2142,6 @@ theend: return retval; } - /// Check if fname was sourced before to finds its SID. /// If it's new, generate a new SID. /// @@ -2192,7 +2187,6 @@ scriptitem_T *get_current_script_id(char_u *fname, sctx_T *ret_sctx) return si; } - /// ":scriptnames" void ex_scriptnames(exarg_T *eap) { @@ -2291,7 +2285,6 @@ linenr_T get_sourced_lnum(LineGetter fgetline, void *cookie) : sourcing_lnum; } - /// Get one full line from a sourced file. /// Called by do_cmdline() when it's called from do_source(). /// @@ -2619,7 +2612,6 @@ void do_finish(exarg_T *eap, int reanimate) } } - /// @return true when a sourced file had the ":finish" command: Don't give error /// message for missing ":endif". /// false when not sourcing a file. @@ -2721,7 +2713,6 @@ static char *get_mess_env(void) #endif - /// Set the "v:lang" variable according to the current locale setting. /// Also do "v:lc_time"and "v:ctype". void set_lang_var(void) @@ -2869,7 +2860,6 @@ void ex_language(exarg_T *eap) } } - static char **locales = NULL; // Array of all available locales # ifndef WIN32 @@ -2971,7 +2961,6 @@ char *get_locales(expand_T *xp, int idx) #endif - static void script_host_execute(char *name, exarg_T *eap) { size_t len; diff --git a/src/nvim/ex_cmds2.h b/src/nvim/ex_cmds2.h index d426ff28f8..74e52dfb4b 100644 --- a/src/nvim/ex_cmds2.h +++ b/src/nvim/ex_cmds2.h @@ -6,7 +6,6 @@ #include "nvim/ex_docmd.h" #include "nvim/runtime.h" - // // flags for check_changed() // diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index ae6d26227b..12fd72ba70 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -115,7 +115,6 @@ struct loop_cookie { void *cookie; }; - // Struct to save a few things while debugging. Used in do_cmdline() only. struct dbg_stuff { int trylevel; @@ -624,7 +623,6 @@ int do_cmdline(char *cmdline, LineGetter fgetline, void *cookie, int flags) next_cmdline = cmdline_copy; } - // reset did_emsg for a function that is not aborted by an error if (did_emsg && !force_abort && getline_equal(fgetline, cookie, get_func_line) @@ -1109,7 +1107,6 @@ static int current_tab_nr(tabpage_T *tab) #define CURRENT_TAB_NR current_tab_nr(curtab) #define LAST_TAB_NR current_tab_nr(NULL) - /// Figure out the address type for ":wincmd". static void get_wincmd_addr_type(char *arg, exarg_T *eap) { @@ -4675,7 +4672,6 @@ static void correct_range(exarg_T *eap) } } - /// For a ":vimgrep" or ":vimgrepadd" command return a pointer past the /// pattern. Otherwise return eap->arg. static char *skip_grep_pat(exarg_T *eap) @@ -5635,7 +5631,6 @@ fail: return FAIL; } - static struct { cmd_addr_T expand; char *name; @@ -6958,7 +6953,6 @@ static void ex_highlight(exarg_T *eap) do_highlight((const char *)eap->arg, eap->forceit, false); } - /// Call this function if we thought we were going to exit, but we won't /// (because of an error). May need to restore the terminal mode. void not_exiting(void) @@ -7165,7 +7159,6 @@ void ex_win_close(int forceit, win_T *win, tabpage_T *tp) } } - // free buffer when not hiding it or when it's a scratch buffer if (tp == NULL) { win_close(win, !need_hide && !buf_hide(buf), forceit); @@ -7442,7 +7435,6 @@ void alist_init(alist_T *al) ga_init(&al->al_ga, (int)sizeof(aentry_T), 5); } - /// Remove a reference from an argument list. /// Ignored when the argument list is the global one. /// If the argument list is no longer used by any window, free it. @@ -7683,7 +7675,6 @@ void ex_splitview(exarg_T *eap) do_exedit(eap, old_curwin); } - theend: xfree(fname); } @@ -7801,7 +7792,6 @@ static void ex_tabs(exarg_T *eap) } } - /// ":mode": /// If no argument given, get the screen size and redraw. static void ex_mode(exarg_T *eap) @@ -8011,7 +8001,6 @@ static void ex_nogui(exarg_T *eap) eap->errmsg = N_("E25: Nvim does not have a built-in GUI"); } - static void ex_swapname(exarg_T *eap) { if (curbuf->b_ml.ml_mfp == NULL || curbuf->b_ml.ml_mfp->mf_fname == NULL) { @@ -8054,7 +8043,6 @@ static void ex_syncbind(exarg_T *eap) topline = 1; } - /* * Set all scrollbind windows to the same topline. */ @@ -8089,7 +8077,6 @@ static void ex_syncbind(exarg_T *eap) } } - static void ex_read(exarg_T *eap) { int i; @@ -9244,7 +9231,6 @@ static void ex_findpat(exarg_T *eap) } } - /// ":ptag", ":ptselect", ":ptjump", ":ptnext", etc. static void ex_ptag(exarg_T *eap) { diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index fa70f762a2..46b9528546 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -439,7 +439,6 @@ char *get_exception_string(void *value, except_type_T type, char *cmdname, int * return ret; } - /// Throw a new exception. "value" is the exception string for a /// user or interrupt exception, or points to a message list in case of an /// error exception. @@ -1140,7 +1139,6 @@ void ex_endwhile(exarg_T *eap) } } - /// Handle ":throw expr" void ex_throw(exarg_T *eap) { @@ -1868,7 +1866,6 @@ void leave_cleanup(cleanup_T *csp) } } - /// Make conditionals inactive and discard what's pending in finally clauses /// until the conditional type searched for or a try conditional not in its /// finally clause is reached. If this is in an active catch clause, finish @@ -2009,7 +2006,6 @@ static char *get_end_emsg(cstack_T *cstack) return e_endif; } - /// Rewind conditionals until index "idx" is reached. "cond_type" and /// "cond_level" specify a conditional type and the address of a level variable /// which is to be decremented with each skipped conditional of the specified diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 3b1ff9ffed..13cfd76adf 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -916,7 +916,6 @@ static uint8_t *command_line_enter(int firstc, long count, int indent, bool init apply_autocmds(EVENT_CMDLINEENTER, firstcbuf, firstcbuf, false, curbuf); restore_v_event(dict, &save_v_event); - tl_ret = try_leave(&tstate, &err); if (!tl_ret && ERROR_SET(&err)) { msg_putchar('\n'); @@ -1606,7 +1605,6 @@ static int may_do_command_line_next_incsearch(int firstc, long count, incsearch_ int search_flags = SEARCH_NOOF; char_u save; - if (search_delim == ccline.cmdbuff[skiplen]) { pat = last_search_pattern(); if (pat == NULL) { @@ -2000,7 +1998,6 @@ static int command_line_handle_key(CommandLineState *s) // Ignore mouse event or open_cmdwin() result. return command_line_not_changed(s); - case K_MIDDLEDRAG: case K_MIDDLERELEASE: return command_line_not_changed(s); // Ignore mouse @@ -2010,7 +2007,6 @@ static int command_line_handle_key(CommandLineState *s) redrawcmd(); return command_line_changed(s); - case K_LEFTDRAG: case K_LEFTRELEASE: case K_RIGHTDRAG: @@ -2060,7 +2056,6 @@ static int command_line_handle_key(CommandLineState *s) case K_MOUSEMOVE: return command_line_not_changed(s); - case K_SELECT: // end of Select mode mapping - ignore return command_line_not_changed(s); @@ -2284,7 +2279,6 @@ static int command_line_handle_key(CommandLineState *s) return command_line_changed(s); } - static int command_line_not_changed(CommandLineState *s) { // Incremental searches for "/" and "?": @@ -2554,7 +2548,6 @@ static int cmd_startcol(void) return ccline.cmdindent + ((ccline.cmdfirstc != NUL) ? 1 : 0); } - /// Compute the column position for a byte position on the command line. static int cmd_screencol(int bytepos) { @@ -2617,7 +2610,6 @@ bool cmdline_overstrike(void) return ccline.overstrike; } - /// Return true if the cursor is at the end of the cmdline. bool cmdline_at_end(void) FUNC_ATTR_PURE @@ -3441,7 +3433,6 @@ static bool cmdline_paste(int regname, bool literally, bool remcr) return FAIL; } - // Need to set "textlock" to avoid nasty things like going to another // buffer when evaluating an expression. textlock++; @@ -5587,7 +5578,6 @@ static int ExpandPackAddDir(char_u *pat, int *num_file, char_u ***file) return OK; } - /// Expand `file` for all comma-separated directories in `path`. /// Adds matches to `ga`. void globpath(char_u *path, char_u *file, garray_T *ga, int expand_options) @@ -5628,7 +5618,6 @@ void globpath(char_u *path, char_u *file, garray_T *ga, int expand_options) xfree(buf); } - /********************************* * Command line history stuff * *********************************/ @@ -5918,7 +5907,6 @@ void add_to_history(int histype, char_u *new_entry, int in_map, int sep) } } - /* * Get identifier of newest history entry. * "histype" may be one of the HIST_ values. @@ -5933,7 +5921,6 @@ int get_history_idx(int histype) return history[histype][hisidx[histype]].hisnum; } - /// Get pointer to the command line info to use. save_cmdline() may clear /// ccline and put the previous value in ccline.prev_ccline. static struct cmdline_info *get_ccline_ptr(void) diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c index f367bc66e0..72c7640d3d 100644 --- a/src/nvim/extmark.c +++ b/src/nvim/extmark.c @@ -53,7 +53,6 @@ static uint32_t *buf_ns_ref(buf_T *buf, uint32_t ns_id, bool put) return map_ref(uint32_t, uint32_t)(buf->b_extmark_ns, ns_id, put); } - /// Create or update an extmark /// /// must not be used during iteration! @@ -361,7 +360,6 @@ ExtmarkInfo extmark_from_id(buf_T *buf, uint32_t ns_id, uint32_t id) return ret; } - /// free extmarks from the buffer void extmark_free_all(buf_T *buf) { @@ -391,7 +389,6 @@ void extmark_free_all(buf_T *buf) map_init(uint32_t, uint32_t, buf->b_extmark_ns); } - /// Save info for undo/redo of set marks static void u_extmark_set(buf_T *buf, uint64_t mark, int row, colnr_T col) { @@ -501,7 +498,6 @@ void extmark_apply_undo(ExtmarkUndoObject undo_info, bool undo) } } - /// Adjust extmark row for inserted/deleted rows (columns stay fixed). void extmark_adjust(buf_T *buf, linenr_T line1, linenr_T line2, long amount, long amount_after, ExtmarkOp undo) @@ -593,7 +589,6 @@ void extmark_splice_impl(buf_T *buf, int start_row, colnr_T start_col, bcount_t u_extmark_copy(buf, start_row, start_col, end_row, end_col); } - marktree_splice(buf->b_marktree, (int32_t)start_row, start_col, old_row, old_col, new_row, new_col); @@ -684,7 +679,6 @@ void extmark_move_region(buf_T *buf, int start_row, colnr_T start_col, bcount_t 0, 0, 0, extent_row, extent_col, extent_byte); - if (undo == kExtmarkUndo) { u_header_T *uhp = u_force_get_undo_header(buf); if (!uhp) { diff --git a/src/nvim/extmark.h b/src/nvim/extmark.h index b856a1148f..c144504076 100644 --- a/src/nvim/extmark.h +++ b/src/nvim/extmark.h @@ -26,7 +26,6 @@ typedef kvec_t(ExtmarkInfo) ExtmarkInfoArray; // TODO(bfredl): good enough name for now. typedef ptrdiff_t bcount_t; - // delete the columns between mincol and endcol typedef struct { int start_row; @@ -80,7 +79,6 @@ struct undo_object { } data; }; - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "extmark.h.generated.h" #endif diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 47e20d58a3..e327b97fbe 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -146,7 +146,6 @@ typedef struct ff_visited_list_hdr { ff_visited_T *ffvl_visited_list; } ff_visited_list_hdr_T; - /* * '**' can be expanded to several directory levels. * Set the default maximum depth. diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 06d72f3395..e869a9a6de 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -147,7 +147,6 @@ void filemess(buf_T *buf, char_u *name, char_u *s, int attr) msg_scrolled_ign = false; } - /// Read lines from file "fname" into the buffer after line "from". /// /// 1. We allocate blocks with try_malloc, as big as possible. @@ -839,7 +838,6 @@ retry: fio_flags = get_fio_flags((char_u *)fenc); } - #ifdef HAVE_ICONV // Try using iconv() if we can't convert internally. if (fio_flags == 0 @@ -1293,7 +1291,6 @@ retry: size -= conv_restlen; } - while (p > (uint8_t *)ptr) { if (fio_flags & FIO_LATIN1) { u8c = *--p; @@ -1995,7 +1992,6 @@ bool is_dev_fd_file(char_u *fname) } #endif - /// From the current line count and characters read after that, estimate the /// line number where we are now. /// Used for error messages that include a line number. @@ -2146,7 +2142,6 @@ static char_u *readfile_charconvert(char_u *fname, char_u *fenc, int *fdp) return tmpname; } - /// Read marks for the current buffer from the ShaDa file, when we support /// buffer marks and the buffer has a name. static void check_marks_read(void) @@ -3053,7 +3048,6 @@ nobackup: } } - // Default: write the file directly. May write to a temp file for // multi-byte conversion. wfname = fname; @@ -3089,7 +3083,6 @@ nobackup: } } - if (converted && wb_flags == 0) { #ifdef HAVE_ICONV // Use iconv() conversion when conversion is needed and it's not done @@ -4109,7 +4102,6 @@ static bool ucs2bytes(unsigned c, char_u **pp, int flags) FUNC_ATTR_NONNULL_ALL bool error = false; int cc; - if (flags & FIO_UCS4) { if (flags & FIO_ENDIAN_L) { *p++ = c; @@ -4238,7 +4230,6 @@ static int get_fio_flags(const char_u *name) return 0; } - /// Check for a Unicode BOM (Byte Order Mark) at the start of p[size]. /// "size" must be at least 2. /// @@ -5493,7 +5484,6 @@ char_u *vim_tempname(void) return vim_strsave(template); } - /// 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/fold.c b/src/nvim/fold.c index 1bd6cfb0a4..234c11227d 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -660,7 +660,6 @@ void foldCreate(win_T *wp, pos_T start, pos_T end) } } - // deleteFold() {{{2 /// @param start delete all folds from start to end when not 0 /// @param end delete all folds from start to end when not 0 diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 005415514c..7c8ac211ec 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -54,7 +54,6 @@ #include "nvim/undo.h" #include "nvim/vim.h" - /// Index in scriptin static int curscript = 0; FileDescriptor *scriptin[NSCRIPT] = { NULL }; @@ -3433,7 +3432,6 @@ theend: return retval; } - /// Set or remove a mapping or an abbreviation in the current buffer, OR /// display (matching) mappings/abbreviations. /// @@ -4716,7 +4714,6 @@ char_u *check_map(char_u *keys, int mode, int exact, int ign_mod, int abbr, mapb return NULL; } - /// Add a mapping. Unlike @ref do_map this copies the {map} argument, so /// static or read-only strings can be used. /// @@ -4858,7 +4855,6 @@ char *getcmdkeycmd(int promptc, void *cookie, int indent, bool do_concat) c1 = TO_SPECIAL(c1, c2); } - if (got_int) { aborted = true; } else if (c1 == '\r' || c1 == '\n') { diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 1819af7ee4..b0006ebaca 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -96,7 +96,6 @@ EXTERN int Columns INIT(= DFLT_COLS); // nr of columns in the screen EXTERN NS ns_hl_active INIT(= 0); // current ns that defines highlights EXTERN bool ns_hl_changed INIT(= false); // highlight need update - // We use 64-bit file functions here, if available. E.g. ftello() returns // off_t instead of long, which helps if long is 32 bit and off_t is 64 bit. // We assume that when fseeko() is available then ftello() is too. @@ -202,7 +201,6 @@ EXTERN bool msg_scrolled_ign INIT(= false); // is reset before the screen is redrawn, so we need to keep track of this. EXTERN bool msg_did_scroll INIT(= false); - EXTERN char_u *keep_msg INIT(= NULL); // msg to be shown after redraw EXTERN int keep_msg_attr INIT(= 0); // highlight attr for keep_msg EXTERN bool need_fileinfo INIT(= false); // do fileinfo() after redraw @@ -315,7 +313,6 @@ EXTERN bool suppress_errthrow INIT(= false); /// cstacks; the pending exceptions, however, are not on the caught stack. EXTERN except_T *caught_stack INIT(= NULL); - /// /// Garbage collection can only take place when we are sure there are no Lists /// or Dictionaries being used internally. This is flagged with @@ -361,7 +358,6 @@ EXTERN struct caller_scope { } provider_caller_scope; EXTERN int provider_call_nesting INIT(= 0); - EXTERN int t_colors INIT(= 256); // int value of T_CCO // Flags to indicate an additional string for highlight name completion. @@ -478,7 +474,6 @@ EXTERN buf_T *curbuf INIT(= NULL); // currently active buffer #define FOR_ALL_SIGNS_IN_BUF(buf, sign) \ for ((sign) = (buf)->b_signlist; (sign) != NULL; (sign) = (sign)->se_next) // NOLINT - // List of files being edited (global argument list). curwin->w_alist points // to this when the window is using the global argument list. EXTERN alist_T global_alist; // global argument list @@ -793,7 +788,6 @@ enum { WM_LIST = 3, ///< cmdline CTRL-D }; - // Some file names are stored in pathdef.c, which is generated from the // Makefile to make their value depend on the Makefile. #ifdef HAVE_PATHDEF @@ -842,7 +836,6 @@ EXTERN bool no_hlsearch INIT(= false); // Page number used for %N in 'pageheader' and 'guitablabel'. EXTERN linenr_T printer_page_num; - EXTERN bool typebuf_was_filled INIT(= false); // received text from client // or from feedkeys() diff --git a/src/nvim/grid.c b/src/nvim/grid.c index d241f86d1c..7d407bd3d1 100644 --- a/src/nvim/grid.c +++ b/src/nvim/grid.c @@ -17,7 +17,6 @@ // Per-cell attributes static size_t linebuf_size = 0; - /// Determine if dedicated window grid should be used or the default_grid /// /// If UI did not request multigrid support, draw all windows on the @@ -136,7 +135,6 @@ void grid_getbytes(ScreenGrid *grid, int row, int col, char_u *bytes, int *attrp } } - /// put string '*text' on the window grid at position 'row' and 'col', with /// attributes 'attr', and update chars[] and attrs[]. /// Note: only outputs within one row, message is truncated at grid boundary! @@ -272,7 +270,6 @@ void grid_puts_len(ScreenGrid *grid, char_u *text, int textlen, int row, int col schar_T buf; schar_from_cc(buf, u8c, u8cc); - need_redraw = schar_cmp(grid->chars[off], buf) || (mbyte_cells == 2 && grid->chars[off + 1][0] != 0) || grid->attrs[off] != attr diff --git a/src/nvim/grid_defs.h b/src/nvim/grid_defs.h index f2427f8aef..1571340849 100644 --- a/src/nvim/grid_defs.h +++ b/src/nvim/grid_defs.h @@ -21,7 +21,6 @@ enum { kZIndexCmdlinePopupMenu = 250, }; - /// ScreenGrid represents a resizable rectuangular grid displayed by UI clients. /// /// chars[] contains the UTF-8 text that is currently displayed on the grid. diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index fb174baef8..00a3c3cdab 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -116,7 +116,6 @@ static option_table_T printer_opts[OPT_PRINT_NUM_OPTIONS] } ; - static const uint32_t cterm_color_8[8] = { 0x000000, 0xff0000, 0x00ff00, 0xffff00, 0x0000ff, 0xff00ff, 0x00ffff, 0xffffff @@ -366,7 +365,6 @@ static char *parse_list_options(char_u *option_str, option_table_T *table, size_ return ret; } - /* * If using a dark background, the colors will probably be too bright to show * up well on white paper, so reduce their brightness. @@ -970,7 +968,6 @@ static colnr_T hardcopy_line(prt_settings_T *psettings, int page_line, prt_pos_T return col; } - /* * PS printer stuff. * @@ -1242,7 +1239,6 @@ static struct prt_ps_mbfont_S prt_ps_mbfonts[] = #define PRT_RESOURCE_ENCODING "Encoding" #define PRT_RESOURCE_CMAP "CMap" - /* Data for table based DSC comment recognition, easy to extend if VIM needs to * read more comments. */ #define PRT_DSC_MISC_TYPE (-1) @@ -1254,7 +1250,6 @@ static struct prt_ps_mbfont_S prt_ps_mbfonts[] = #define PRT_DSC_VERSION "%%Version:" #define PRT_DSC_ENDCOMMENTS "%%EndComments:" - #define SIZEOF_CSTR(s) (sizeof(s) - 1) static struct prt_dsc_comment_S prt_dsc_table[] = { @@ -1265,7 +1260,6 @@ static struct prt_dsc_comment_S prt_dsc_table[] = PRT_DSC_ENDCOMMENTS_TYPE } }; - /* * Variables for the output PostScript file. */ @@ -2053,7 +2047,6 @@ static void prt_font_metrics(int font_scale) prt_char_width = PRT_PS_FONT_TO_USER(font_scale, prt_ps_font->wx); } - static int prt_get_cpl(void) { if (prt_use_number()) { @@ -2168,7 +2161,6 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit) struct prt_ps_encoding_S *p_mbenc_first; struct prt_ps_charset_S *p_mbchar = NULL; - /* * Set up font and encoding. */ diff --git a/src/nvim/hardcopy.h b/src/nvim/hardcopy.h index 16119c5d2d..7b28169a5b 100644 --- a/src/nvim/hardcopy.h +++ b/src/nvim/hardcopy.h @@ -80,7 +80,6 @@ typedef struct { #define PRINT_NUMBER_WIDTH 8 - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "hardcopy.h.generated.h" #endif diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c index 90ca0047bd..3bcd72fc39 100644 --- a/src/nvim/highlight.c +++ b/src/nvim/highlight.c @@ -229,7 +229,6 @@ int ns_get_hl(NS ns_id, int hl_id, bool link, bool nodefault) } } - bool win_check_ns_hl(win_T *wp) { if (ns_hl_changed) { @@ -760,7 +759,6 @@ Dictionary hlattrs2dict(HlAttrs ae, bool use_rgb) PUT(hl, "underdash", BOOLEAN_OBJ(true)); } - if (mask & HL_ITALIC) { PUT(hl, "italic", BOOLEAN_OBJ(true)); } diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h index d293865efd..caf345386d 100644 --- a/src/nvim/highlight_defs.h +++ b/src/nvim/highlight_defs.h @@ -178,7 +178,6 @@ EXTERN const char *hlf_names[] INIT(= { [HLF_WBRNC] = "WinBarNC", }); - EXTERN int highlight_attr[HLF_COUNT]; // Highl. attr for each context. EXTERN int highlight_attr_last[HLF_COUNT]; // copy for detecting changed groups EXTERN int highlight_user[9]; // User[1-9] attributes @@ -222,5 +221,4 @@ typedef struct { #define COLOR_ITEM_INITIALIZER { .attr_id = -1, .link_id = -1, \ .version = -1, .is_default = false } - #endif // NVIM_HIGHLIGHT_DEFS_H diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c index 0047cb02d6..05781dd7e2 100644 --- a/src/nvim/highlight_group.c +++ b/src/nvim/highlight_group.c @@ -1835,7 +1835,6 @@ int syn_get_final_id(int hl_id) continue; } - if (sgp->sg_link == 0 || sgp->sg_link > highlight_ga.ga_len) { break; } diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c index 7174e58986..af0d32ad9c 100644 --- a/src/nvim/if_cscope.c +++ b/src/nvim/if_cscope.c @@ -68,7 +68,6 @@ static void cs_usage_msg(csid_e x) (void)semsg(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage); } - static enum { EXP_CSCOPE_SUBCMD, // expand ":cscope" sub-commands EXP_SCSCOPE_SUBCMD, // expand ":scscope" sub-commands @@ -169,7 +168,6 @@ void set_context_in_cscope_cmd(expand_T *xp, const char *arg, cmdidx_T cmdidx) } } - /// Find the command, print help if invalid, and then call the corresponding /// command function. /// @@ -274,7 +272,6 @@ void ex_cstag(exarg_T *eap) } } - /// This simulates a vim_fgets(), but for cscope, returns the next line /// from the cscope output. should only be called from find_tags() /// @@ -292,7 +289,6 @@ bool cs_fgets(char_u *buf, int size) return false; } - /// Called only from do_tag(), when popping the tag stack. void cs_free_tags(void) { @@ -380,7 +376,6 @@ bool cs_connection(int num, char_u *dbpath, char_u *ppath) return false; } // cs_connection - /* * PRIVATE functions ****************************************************************************/ @@ -408,7 +403,6 @@ static void cs_stat_emsg(char *fname) (void)semsg(_("E563: stat(%s) error: %d"), fname, err); } - /// The common routine to add a new cscope connection. Called by /// cs_add() and cs_reset(). I really don't like to do this, but this /// routine uses a number of goto statements. @@ -520,7 +514,6 @@ add_err: return CSCOPE_FAILURE; } - static bool cs_check_for_connections(void) { return cs_cnt_connections() > 0; @@ -613,7 +606,6 @@ static int cs_cnt_matches(size_t idx) return nlines; } - /// Creates the actual cscope command query from what the user entered. static char *cs_create_cmd(char *csoption, char *pattern) { @@ -680,7 +672,6 @@ static char *cs_create_cmd(char *csoption, char *pattern) return cmd; } - /// This piece of code was taken/adapted from nvi. do we need to add /// the BSD license notice? static int cs_create_connection(size_t i) @@ -879,7 +870,6 @@ err_closing: return CSCOPE_SUCCESS; } - /// Query cscope using command line interface. Parse the output and use tselect /// to allow choices. Like Nvi, creates a pipe to send to/from query/cscope. /// @@ -918,7 +908,6 @@ static int cs_find(exarg_T *eap) eap->cmdidx == CMD_lcscope, (char_u *)(*eap->cmdlinep)); } - /// Common code for cscope find, shared by cs_find() and ex_cstag(). static bool cs_find_common(char *opt, char *pat, int forceit, int verbose, bool use_ll, char_u *cmdline) @@ -1119,7 +1108,6 @@ static int cs_help(exarg_T *eap) return CSCOPE_SUCCESS; } - static void clear_csinfo(size_t i) { csinfo[i].fname = NULL; @@ -1193,7 +1181,6 @@ static int cs_insert_filelist(char *fname, char *ppath, char *flags, FileInfo *f return (int)i; } - /// Find cscope command in command table. static cscmd_T *cs_lookup_cmd(exarg_T *eap) { @@ -1221,7 +1208,6 @@ static cscmd_T *cs_lookup_cmd(exarg_T *eap) return NULL; } - /// Nuke em. static int cs_kill(exarg_T *eap) { @@ -1281,7 +1267,6 @@ static int cs_kill(exarg_T *eap) return CSCOPE_SUCCESS; } - /// Actually kills a specific cscope connection. /// /// @param i cscope table index @@ -1296,7 +1281,6 @@ static void cs_kill_execute(size_t i, char *cname) cs_release_csp(i, TRUE); } - /// Convert the cscope output into a ctags style entry (as might be found /// in a ctags tags file). there's one catch though: cscope doesn't tell you /// the type of the tag you are looking for. for example, in Darren Hiebert's @@ -1343,7 +1327,6 @@ static char *cs_make_vim_style_matches(char *fname, char *slno, char *search, ch return buf; } - /// This is kind of hokey, but i don't see an easy way round this. /// /// Store: keep a ptr to the (malloc'd) memory of matches originally @@ -1415,7 +1398,6 @@ static char *cs_manage_matches(char **matches, char **contexts, size_t totmatche return p; } - /// Parse cscope output. static char *cs_parse_results(size_t cnumber, char *buf, int bufsize, char **context, char **linenumber, char **search) @@ -1581,7 +1563,6 @@ static void cs_fill_results(char *tagstr, size_t totmatches, int *nummatches_a, xfree(buf); } - // get the requested path components static char *cs_pathcomponents(char *path) { @@ -1929,7 +1910,6 @@ static void cs_release_csp(size_t i, bool freefnpp) clear_csinfo(i); } - /// Calls cs_kill on all cscope connections then reinits. static int cs_reset(exarg_T *eap) { @@ -1980,7 +1960,6 @@ static int cs_reset(exarg_T *eap) return CSCOPE_SUCCESS; } - /// Construct the full pathname to a file found in the cscope database. /// (Prepends ppath, if there is one and if it's not already prepended, /// otherwise just uses the name found.) @@ -2031,7 +2010,6 @@ static char *cs_resolve_file(size_t i, char *name) return fullname; } - /// Show all cscope connections. static int cs_show(exarg_T *eap) { @@ -2059,7 +2037,6 @@ static int cs_show(exarg_T *eap) return CSCOPE_SUCCESS; } - /// Only called when VIM exits to quit any cscope sessions. void cs_end(void) { diff --git a/src/nvim/indent.c b/src/nvim/indent.c index 882a10e1e8..010d2fe869 100644 --- a/src/nvim/indent.c +++ b/src/nvim/indent.c @@ -26,7 +26,6 @@ #include "nvim/strings.h" #include "nvim/undo.h" - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "indent.c.generated.h" #endif @@ -40,7 +39,6 @@ int get_indent(void) false); } - // Count the size (in window cells) of the indent in line "lnum". int get_indent_lnum(linenr_T lnum) { @@ -50,7 +48,6 @@ int get_indent_lnum(linenr_T lnum) false); } - // Count the size (in window cells) of the indent in line "lnum" of buffer // "buf". int get_indent_buf(buf_T *buf, linenr_T lnum) @@ -61,7 +58,6 @@ int get_indent_buf(buf_T *buf, linenr_T lnum) false); } - /// Count the size (in window cells) of the indent in line "ptr", with /// 'tabstop' at "ts". /// If @param list is true, count only screen size for tabs. @@ -387,7 +383,6 @@ int set_indent(int size, int flags) return retval; } - // Return the indent of the current line after a number. Return -1 if no // number was found. Used for 'n' in 'formatoptions': numbered list. // Since a pattern is used it can actually handle more than numbers. @@ -580,7 +575,6 @@ int get_expr_indent(void) return indent; } - // When 'p' is present in 'cpoptions, a Vi compatible method is used. // The incompatible newer method is quite a bit better at indenting // code in lisp-like languages than the traditional one; it's still @@ -766,7 +760,6 @@ int get_lisp_indent(void) return amount; } - static int lisp_match(char_u *p) { char_u buf[LSIZE]; diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index e6dc985726..29d3c5f95b 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -212,7 +212,6 @@ int is_pos_in_string(const char_u *line, colnr_T col) * Below "XXX" means that this function may unlock the current line. */ - /* * Return true if the string "line" starts with a word from 'cinwords'. */ @@ -238,7 +237,6 @@ bool cin_is_cinword(const char_u *line) return retval; } - /* * Skip over white space and C comments within the line. * Also skip over Perl/shell comments if desired. @@ -1422,7 +1420,6 @@ static int cin_is_cpp_extern_c(const char_u *s) return false; } - /* * Skip strings, chars and comments until at or past "trypos". * Return the column found. @@ -1553,7 +1550,6 @@ static pos_T *find_match_paren_after_brace(int ind_maxparen) return trypos; } - /* * Return ind_maxparen corrected for the difference in line number between the * cursor position and "startpos". This makes sure that searching for a @@ -3746,7 +3742,6 @@ term_again: amount += curbuf->b_ind_comment; } - // add extra indent if the previous line ended in a backslash: // "asdfasdf{backslash} // here"; diff --git a/src/nvim/lib/kbtree.h b/src/nvim/lib/kbtree.h index 2edec527ff..99f79952d7 100644 --- a/src/nvim/lib/kbtree.h +++ b/src/nvim/lib/kbtree.h @@ -224,7 +224,6 @@ kb_putp_##name(b, &k); \ } - #define __KB_DEL(name, key_t, kbnode_t, T) \ static inline key_t __kb_delp_aux_##name(kbtree_##name##_t *b, kbnode_t *x, key_t * __restrict k, \ int s) \ diff --git a/src/nvim/lib/khash.h b/src/nvim/lib/khash.h index e81db43038..57a41f9c13 100644 --- a/src/nvim/lib/khash.h +++ b/src/nvim/lib/khash.h @@ -113,7 +113,6 @@ * Added destructor */ - #ifndef NVIM_LIB_KHASH_H #define NVIM_LIB_KHASH_H diff --git a/src/nvim/lib/klist.h b/src/nvim/lib/klist.h index c8489e298b..a9abbc6dc2 100644 --- a/src/nvim/lib/klist.h +++ b/src/nvim/lib/klist.h @@ -32,7 +32,6 @@ #include "nvim/func_attr.h" #include "nvim/memory.h" - #define KMEMPOOL_INIT(name, kmptype_t, kmpfree_f) \ typedef struct { \ size_t cnt, n, max; \ diff --git a/src/nvim/lib/kvec.h b/src/nvim/lib/kvec.h index 68841e0af8..4238088b1c 100644 --- a/src/nvim/lib/kvec.h +++ b/src/nvim/lib/kvec.h @@ -121,7 +121,6 @@ #define kv_push(v, x) \ (*kv_pushp(v) = (x)) - #define kv_a(v, i) \ (*(((v).capacity <= (size_t)(i) \ ? ((v).capacity = (v).size = (i) + 1, \ diff --git a/src/nvim/lib/queue.h b/src/nvim/lib/queue.h index e5574094bc..c6d3f74ec1 100644 --- a/src/nvim/lib/queue.h +++ b/src/nvim/lib/queue.h @@ -44,7 +44,6 @@ typedef struct _queue { (q) = next; \ } - // ffi.cdef is unable to swallow `bool` in place of `int` here. static inline int QUEUE_EMPTY(const QUEUE *const q) FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT diff --git a/src/nvim/log.h b/src/nvim/log.h index 81e39d1cdd..724d073d02 100644 --- a/src/nvim/log.h +++ b/src/nvim/log.h @@ -16,7 +16,6 @@ # define NVIM_PROBE(name, n, ...) #endif - #define TRACE_LOG_LEVEL 0 #define DEBUG_LOG_LEVEL 1 #define INFO_LOG_LEVEL 2 diff --git a/src/nvim/lua/converter.c b/src/nvim/lua/converter.c index 782fc425fc..4d6e6090b8 100644 --- a/src/nvim/lua/converter.c +++ b/src/nvim/lua/converter.c @@ -49,7 +49,6 @@ typedef struct { #define LUA_PUSH_STATIC_STRING(lstate, s) \ lua_pushlstring(lstate, s, sizeof(s) - 1) - static LuaTableProps nlua_traverse_table(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT { @@ -674,7 +673,6 @@ static inline void nlua_create_typed_table(lua_State *lstate, const size_t narr, lua_rawset(lstate, -3); } - /// Convert given String to lua string /// /// Leaves converted string on top of the stack. @@ -808,7 +806,6 @@ void nlua_push_Object(lua_State *lstate, const Object obj, bool special) } } - /// Convert lua value to string /// /// Always pops one value from the stack. @@ -1297,7 +1294,6 @@ void nlua_init_types(lua_State *const lstate) lua_rawset(lstate, -3); } - void nlua_pop_keydict(lua_State *L, void *retval, field_hash hashy, Error *err) { if (!lua_istable(L, -1)) { diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 9758cee0a5..f63f1ee52f 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -135,7 +135,6 @@ static int nlua_pcall(lua_State *lstate, int nargs, int nresults) return status; } - /// Gets the version of the current Nvim build. /// /// @param lstate Lua interpreter state. @@ -147,7 +146,6 @@ static int nlua_nvim_version(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL return 1; } - static void nlua_luv_error_event(void **argv) { char *error = (char *)argv[0]; @@ -1041,7 +1039,6 @@ static int nlua_empty_dict_tostring(lua_State *lstate) return 1; } - #ifdef WIN32 /// os.getenv: override os.getenv to maintain coherency. #9681 /// @@ -1055,7 +1052,6 @@ static int nlua_getenv(lua_State *lstate) } #endif - /// add the value to the registry /// The current implementation does not support calls from threads. LuaRef nlua_ref(lua_State *lstate, nlua_ref_state_t *ref_state, int index) @@ -1074,7 +1070,6 @@ LuaRef nlua_ref(lua_State *lstate, nlua_ref_state_t *ref_state, int index) return ref; } - LuaRef nlua_ref_global(lua_State *lstate, int index) { return nlua_ref(lstate, nlua_global_refs, index); @@ -1100,7 +1095,6 @@ void nlua_unref_global(lua_State *lstate, LuaRef ref) nlua_unref(lstate, nlua_global_refs, ref); } - void api_free_luaref(LuaRef ref) { nlua_unref_global(global_lstate, ref); @@ -1112,7 +1106,6 @@ void nlua_pushref(lua_State *lstate, LuaRef ref) lua_rawgeti(lstate, LUA_REGISTRYINDEX, ref); } - /// Gets a new reference to an object stored at original_ref /// /// NOTE: It does not copy the value, it creates a new ref to the lua object. @@ -1130,7 +1123,6 @@ LuaRef api_new_luaref(LuaRef original_ref) return new_ref; } - /// Evaluate lua string /// /// Used for luaeval(). @@ -1744,7 +1736,6 @@ char_u *nlua_register_table_as_callable(typval_T *const arg) char_u *name = register_cfunc(&nlua_CFunction_func_call, &nlua_CFunction_func_free, state); - lua_pop(lstate, 1); // [] assert(top == lua_gettop(lstate)); diff --git a/src/nvim/lua/stdlib.c b/src/nvim/lua/stdlib.c index 79e21e518c..432cb25adc 100644 --- a/src/nvim/lua/stdlib.c +++ b/src/nvim/lua/stdlib.c @@ -349,7 +349,6 @@ static dict_T *nlua_get_var_scope(lua_State *lstate) return dict; } - int nlua_setvar(lua_State *lstate) { // non-local return if not found @@ -470,7 +469,6 @@ static int nlua_stricmp(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL return 1; } - void nlua_state_add_stdlib(lua_State *const lstate, bool is_thread) { if (!is_thread) { diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c index d3693207ec..6ec9cfd21d 100644 --- a/src/nvim/lua/treesitter.c +++ b/src/nvim/lua/treesitter.c @@ -529,7 +529,6 @@ static int parser_set_ranges(lua_State *L) size_t tbl_len = lua_objlen(L, 2); TSRange *ranges = xmalloc(sizeof(TSRange) * tbl_len); - // [ parser, ranges ] for (size_t index = 0; index < tbl_len; index++) { lua_rawgeti(L, 2, index + 1); // [ parser, ranges, range ] @@ -558,7 +557,6 @@ static int parser_get_ranges(lua_State *L) return 1; } - // Tree methods /// push tree interface on lua stack. @@ -656,7 +654,6 @@ static bool node_check(lua_State *L, int index, TSNode *res) return false; } - static int node_tostring(lua_State *L) { TSNode node; @@ -1059,7 +1056,6 @@ static int query_next_match(lua_State *L) return 0; } - static int query_next_capture(lua_State *L) { // Upvalues are: @@ -1205,7 +1201,6 @@ int tslua_parse_query(lua_State *L) return 1; } - static const char *query_err_string(TSQueryError err) { switch (err) { diff --git a/src/nvim/macros.h b/src/nvim/macros.h index c9c424568d..a896a406d1 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -94,7 +94,6 @@ #define REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG)) - // MB_PTR_ADV(): advance a pointer to the next character, taking care of // multi-byte characters if needed. Skip over composing chars. #define MB_PTR_ADV(p) (p += utfc_ptr2len((char *)p)) diff --git a/src/nvim/main.c b/src/nvim/main.c index 0ffd6cddff..936b42be23 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -810,7 +810,6 @@ static void init_locale(void) } #endif - static uint64_t server_connect(char *server_addr, const char **errmsg) { if (server_addr == NULL) { @@ -917,7 +916,6 @@ static void remote_request(mparm_T *params, int remote_args, char *server_addr, } } - /// Decides whether text (as opposed to commands) will be read from stdin. /// @see EDIT_STDIN static bool edit_stdin(bool explicit, mparm_T *parmp) @@ -1493,7 +1491,6 @@ static void set_window_layout(mparm_T *paramp) } } - /* * "-q errorfile": Load the error file now. * If the error file can't be read, exit before doing anything else. @@ -2175,7 +2172,6 @@ static void usage(void) mch_msg(_("\nSee \":help startup-options\" for all options.\n")); } - /* * Check the result of the ATTENTION dialog: * When "Quit" selected, exit Vim. diff --git a/src/nvim/map.c b/src/nvim/map.c index b3f48ad5d6..ece5135559 100644 --- a/src/nvim/map.c +++ b/src/nvim/map.c @@ -32,7 +32,6 @@ #define handle_T_hash kh_int_hash_func #define handle_T_eq kh_int_hash_equal - #if defined(ARCH_64) # define ptr_t_hash(key) uint64_t_hash((uint64_t)key) # define ptr_t_eq(a, b) uint64_t_eq((uint64_t)a, (uint64_t)b) @@ -163,7 +162,6 @@ static inline bool ColorKey_eq(ColorKey ae1, ColorKey ae2) return memcmp(&ae1, &ae2, sizeof(ae1)) == 0; } - MAP_IMPL(int, int, DEFAULT_INITIALIZER) MAP_IMPL(cstr_t, ptr_t, DEFAULT_INITIALIZER) MAP_IMPL(cstr_t, int, DEFAULT_INITIALIZER) diff --git a/src/nvim/mark.c b/src/nvim/mark.c index 6de8d5dfd5..35000ce39a 100644 --- a/src/nvim/mark.c +++ b/src/nvim/mark.c @@ -1016,7 +1016,6 @@ static void mark_adjust_internal(linenr_T line1, linenr_T line2, long amount, lo ONE_ADJUST(&(curbuf->b_last_cursor.mark.lnum)); } - // list of change positions for (i = 0; i < curbuf->b_changelistlen; i++) { ONE_ADJUST_NODEL(&(curbuf->b_changelist[i].mark.lnum)); @@ -1586,7 +1585,6 @@ void mark_mb_adjustpos(buf_T *buf, pos_T *lp) } } - // Add information about mark 'mname' to list 'l' static int add_mark(list_T *l, const char *mname, const pos_T *pos, int bufnr, const char *fname) FUNC_ATTR_NONNULL_ARG(1, 2, 3) @@ -1614,7 +1612,6 @@ static int add_mark(list_T *l, const char *mname, const pos_T *pos, int bufnr, c return OK; } - /// Get information about marks local to a buffer. /// /// @param[in] buf Buffer to get the marks from diff --git a/src/nvim/marktree.c b/src/nvim/marktree.c index fb2fa6bc7d..c29e540214 100644 --- a/src/nvim/marktree.c +++ b/src/nvim/marktree.c @@ -575,7 +575,6 @@ void marktree_move(MarkTree *b, MarkTreeIter *itr, int row, int col) marktree_del_itr(b, itr, false); key.pos = (mtpos_t){ row, col }; - marktree_put_key(b, key); itr->node = NULL; // itr might become invalid by put } @@ -799,7 +798,6 @@ bool marktree_itr_node_done(MarkTreeIter *itr) return !itr->node || itr->i == itr->node->n - 1; } - mtpos_t marktree_itr_pos(MarkTreeIter *itr) { mtpos_t pos = rawkey(itr).pos; @@ -961,7 +959,6 @@ past_continue_same_node: } } - while (itr->node) { unrelative(oldbase[itr->lvl], &rawkey(itr).pos); int realrow = rawkey(itr).pos.row; diff --git a/src/nvim/marktree.h b/src/nvim/marktree.h index 5b3171d9aa..e2e05eebd5 100644 --- a/src/nvim/marktree.h +++ b/src/nvim/marktree.h @@ -32,7 +32,6 @@ typedef struct { iterstate_t s[MT_MAX_DEPTH]; } MarkTreeIter; - // Internal storage // // NB: actual marks have flags > 0, so we can use (row,col,0) pseudo-key for @@ -109,7 +108,6 @@ static inline uint16_t mt_flags(bool right_gravity, uint8_t decor_level) | (decor_level << MT_FLAG_DECOR_OFFSET)); } - struct mtnode_s { int32_t n; int32_t level; @@ -130,7 +128,6 @@ typedef struct { PMap(uint64_t) id2node[1]; } MarkTree; - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "marktree.h.generated.h" #endif diff --git a/src/nvim/math.c b/src/nvim/math.c index 04ded0fd39..b427688083 100644 --- a/src/nvim/math.c +++ b/src/nvim/math.c @@ -31,10 +31,12 @@ int xfpclassify(double d) return m ? FP_NAN : FP_INFINITE; } } + int xisinf(double d) { return FP_INFINITE == xfpclassify(d); } + int xisnan(double d) { return FP_NAN == xfpclassify(d); diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index adf071fa77..24d079ea2c 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -344,7 +344,6 @@ static int enc_canon_search(const char_u *name) return -1; } - /* * Find canonical encoding "name" in the list and return its properties. * Returns 0 if not found. @@ -1525,7 +1524,6 @@ ssize_t mb_utf_index_to_bytes(const char_u *s, size_t len, size_t index, bool us return -1; } - /* * Version of strnicmp() that handles multi-byte characters. * Needed for Big5, Shift-JIS and UTF-8 encoding. Other DBCS encodings can @@ -1867,7 +1865,6 @@ int mb_tail_off(const char_u *base, const char_u *p) return i; } - /// Return the offset from "p" to the first byte of the character it points /// into. Can start anywhere in a stream of bytes. /// Unlike utf_head_off() this doesn't include composing characters and returns a negative value. @@ -2129,7 +2126,6 @@ const char *mb_unescape(const char **const pp) return NULL; } - /* * Skip the Vim specific head of a 'encoding' name. */ @@ -2225,7 +2221,6 @@ static int enc_alias_search(const char_u *name) return -1; } - #ifdef HAVE_LANGINFO_H # include <langinfo.h> #endif @@ -2299,7 +2294,6 @@ enc_locale_copy_enc: #if defined(HAVE_ICONV) - /* * Call iconv_open() with a check if iconv() works properly (there are broken * versions). @@ -2429,7 +2423,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/memfile.c b/src/nvim/memfile.c index 28337803ac..c828334eaf 100644 --- a/src/nvim/memfile.c +++ b/src/nvim/memfile.c @@ -60,7 +60,6 @@ #define MEMFILE_PAGE_SIZE 4096 /// default page size - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "memfile.c.generated.h" #endif diff --git a/src/nvim/memline.c b/src/nvim/memline.c index ac6bdfa1a4..81d89ef3df 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -288,7 +288,6 @@ int ml_open(buf_T *buf) buf->b_ml.ml_line_count = 1; curwin->w_nrwidth_line_count = 0; - /* * fill block0 struct and write page 0 */ @@ -732,7 +731,6 @@ static void add_b0_fenc(ZERO_BL *b0p, buf_T *buf) } } - /// Try to recover curbuf from the .swp file. /// /// @param checkext if true, check the extension and detect whether it is a @@ -2445,7 +2443,6 @@ void ml_add_deleted_len_buf(buf_T *buf, char_u *ptr, ssize_t len) } } - int ml_replace(linenr_T lnum, char *line, bool copy) { return ml_replace_buf(curbuf, lnum, (char_u *)line, copy); @@ -3304,7 +3301,6 @@ char_u *get_file_in_dir(char_u *fname, char_u *dname) return retval; } - /// Print the ATTENTION message: info about an existing swap file. /// /// @param buf buffer being edited @@ -3351,7 +3347,6 @@ static void attention_message(buf_T *buf, char_u *fname) --no_wait_return; } - /// Trigger the SwapExists autocommands. /// /// @return a value for equivalent to do_dialog() (see below): diff --git a/src/nvim/memory.c b/src/nvim/memory.c index 8a65188f22..19a520636e 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -661,7 +661,6 @@ void free_all_mem(void) ResetRedobuff(); ResetRedobuff(); - // highlight info free_highlight(); diff --git a/src/nvim/menu.c b/src/nvim/menu.c index c1ce2eefe3..01a44224e8 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -31,12 +31,10 @@ #define MENUDEPTH 10 // maximum depth of menus - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "menu.c.generated.h" #endif - /// The character for each menu mode static char menu_mode_chars[] = { 'n', 'v', 's', 'o', 'i', 'c', 't' }; @@ -98,7 +96,6 @@ void ex_menu(exarg_T *eap) break; } - // Locate an optional "icon=filename" argument // TODO(nvim): Currently this is only parsed. Should expose it to UIs. if (STRNCMP(arg, "icon=", 5) == 0) { @@ -162,7 +159,6 @@ void ex_menu(exarg_T *eap) return; } - menu_path = arg; if (*menu_path == '.') { semsg(_(e_invarg2), menu_path); @@ -268,7 +264,6 @@ theend: ; } - /// Add the menu with the given name to the menu hierarchy /// /// @param[out] menuarg menu entry @@ -398,7 +393,6 @@ static int add_menu_path(const char *const menu_path, vimmenu_T *menuarg, const } } - menup = &menu->children; parent = menu; name = next_name; @@ -543,7 +537,6 @@ static int menu_enable_recurse(vimmenu_T *menu, char *name, int modes, int enabl return FAIL; } - return OK; } @@ -615,7 +608,6 @@ static int remove_menu(vimmenu_T **menup, char *name, int modes, bool silent) return FAIL; } - // Recalculate modes for menu based on the new updated children menu->modes &= ~modes; child = menu->children; @@ -645,7 +637,6 @@ static void free_menu(vimmenu_T **menup) menu = *menup; - // Don't change *menup until after calling gui_mch_destroy_menu(). The // MacOS code needs the original structure to properly delete the menu. *menup = menu->next; @@ -749,7 +740,6 @@ static dict_T *menu_get_recursive(const vimmenu_T *menu, int modes) return dict; } - /// Export menus matching path \p path_name /// /// @param path_name @@ -776,7 +766,6 @@ bool menu_get(char *const path_name, int modes, list_T *list) return true; } - /// Find menu matching `name` and `modes`. /// /// @param menu top menu to start looking from @@ -913,7 +902,6 @@ static void show_menus_recursive(vimmenu_T *menu, int modes, int depth) } } - /* * Used when expanding menu names. */ @@ -937,7 +925,6 @@ char *set_context_in_menu_cmd(expand_T *xp, const char *cmd, char *arg, bool for xp->xp_context = EXPAND_UNSUCCESSFUL; - // Check for priority numbers, enable and disable for (p = arg; *p; ++p) { if (!ascii_isdigit(*p) && *p != '.') { @@ -1146,7 +1133,6 @@ char *get_menu_names(expand_T *xp, int idx) return str; } - /// Skip over this element of the menu path and return the start of the next /// element. Any \ and ^Vs are removed from the current element. /// @@ -1197,7 +1183,6 @@ static bool menu_namecmp(const char *const name, const char *const mname) && (mname[i] == NUL || mname[i] == TAB); } - /// Returns the \ref MENU_MODES specified by menu command `cmd`. /// (eg :menu! returns MENU_CMDLINE_MODE | MENU_INSERT_MODE) /// @@ -1281,7 +1266,6 @@ static char *popup_mode_name(char *name, int idx) return p; } - /// Duplicate the menu item text and then process to see if a mnemonic key /// and/or accelerator text has been identified. /// @@ -1346,7 +1330,6 @@ bool menu_is_popup(const char *const name) return STRNCMP(name, "PopUp", 5) == 0; } - // Return true if "name" is a toolbar menu name. bool menu_is_toolbar(const char *const name) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL @@ -1363,7 +1346,6 @@ int menu_is_separator(char *name) return name[0] == '-' && name[STRLEN(name) - 1] == '-'; } - /// True if a popup menu or starts with \ref MNU_HIDDEN_CHAR /// /// @return true if the menu is hidden diff --git a/src/nvim/message.c b/src/nvim/message.c index 35a57b708d..2e57d11fb6 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -114,7 +114,6 @@ bool keep_msg_more = false; // keep_msg was set by msgmore() * This is an allocated string or NULL when not used. */ - // Extended msg state, currently used for external UIs with ext_messages static const char *msg_ext_kind = NULL; static Array msg_ext_chunks = ARRAY_DICT_INIT; @@ -265,7 +264,6 @@ void msg_multiline_attr(const char *s, int attr, bool check_int, bool *need_clea } } - /// @param keep set keep_msg if it doesn't scroll bool msg_attr_keep(const char *s, int attr, bool keep, bool multiline) FUNC_ATTR_NONNULL_ALL @@ -760,7 +758,6 @@ bool semsg_multiline(const char *const fmt, ...) bool ret; va_list ap; - static char errbuf[MULTILINE_BUFSIZE]; if (emsg_not_now()) { return true; @@ -1010,7 +1007,6 @@ void ex_messages(void *const eap_p) return; } - p = first_msg_hist; if (eap->addr_count != 0) { @@ -1168,7 +1164,6 @@ void wait_return(int redraw) reg_recording = save_reg_recording; scriptout = save_scriptout; - /* * Allow scrolling back in the messages. * Also accept scroll-down commands when messages fill the screen, @@ -1343,7 +1338,6 @@ void msgmore(long n) } } - void msg_ext_set_kind(const char *msg_kind) { // Don't change the label of an existing batch: @@ -2742,7 +2736,6 @@ static int do_more_prompt(int typed_char) c = get_keystroke(resize_events); } - toscroll = 0; switch (c) { case BS: // scroll one line back @@ -3440,7 +3433,6 @@ int do_dialog(int type, char_u *title, char_u *message, char_u *buttons, int dfl return dfltbutton; // return default option } - int save_msg_silent = msg_silent; int oldState = State; @@ -3507,7 +3499,6 @@ int do_dialog(int type, char_u *title, char_u *message, char_u *buttons, int dfl return retval; } - /// Copy one character from "*from" to "*to", taking care of multi-byte /// characters. Return the length of the character in bytes. /// @@ -3578,7 +3569,6 @@ static char_u *console_dialog_alloc(const char_u *message, char_u *buttons, bool len += 2; // "x" -> "[x]" } - // Now allocate space for the strings xfree(confirm_msg); confirm_msg = xmalloc(len); diff --git a/src/nvim/message.h b/src/nvim/message.h index 316b2df7a4..b402ee8b60 100644 --- a/src/nvim/message.h +++ b/src/nvim/message.h @@ -69,7 +69,6 @@ EXTERN ScreenGrid msg_grid_adj INIT(= SCREEN_GRID_INIT); // value of msg_scrolled at latest msg_scroll_flush. EXTERN int msg_scrolled_at_flush INIT(= 0); - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "message.h.generated.h" #endif diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index 347adc589f..fc5ecbc6a0 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -480,7 +480,6 @@ win_T *mouse_find_win(int *gridp, int *rowp, int *colp) return NULL; } - frame_T *fp; fp = topframe; @@ -573,7 +572,6 @@ void setmouse(void) ui_check_mouse(); } - // Set orig_topline. Used when jumping to another window, so that a double // click still works. void set_mouse_topline(win_T *wp) diff --git a/src/nvim/mouse.h b/src/nvim/mouse.h index 04acb88bb3..08261e4a30 100644 --- a/src/nvim/mouse.h +++ b/src/nvim/mouse.h @@ -41,7 +41,6 @@ #define MSCR_LEFT (-1) #define MSCR_RIGHT (-2) - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "mouse.h.generated.h" #endif diff --git a/src/nvim/move.c b/src/nvim/move.c index 97ce92f6a9..9f72b36638 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -45,7 +45,6 @@ typedef struct { # include "move.c.generated.h" #endif - /* * Compute wp->w_botline for the current wp->w_topline. Can be called after * wp->w_topline changed. @@ -1863,7 +1862,6 @@ void cursor_correct(void) curwin->w_viewport_invalid = true; } - /* * move screen 'count' pages up or down and update screen * diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 48ecd5d0ea..79ecd9f827 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -49,7 +49,6 @@ void rpc_init(void) msgpack_sbuffer_init(&out_buffer); } - void rpc_start(Channel *channel) { channel_incref(channel); @@ -73,7 +72,6 @@ void rpc_start(Channel *channel) } } - static Channel *find_rpc_channel(uint64_t id) { Channel *chan = find_channel(id); @@ -359,7 +357,6 @@ static void handle_request(Channel *channel, msgpack_object *request) } } - /// Handles a message, depending on the type: /// - Request: invokes method and writes the response (or error). /// - Notification: invokes method (emits `nvim_error_event` on error). @@ -413,7 +410,6 @@ static bool channel_write(Channel *channel, WBuffer *buffer) success = wstream_write(in, buffer); } - if (!success) { // If the write failed for any reason, close the channel char buf[256]; @@ -535,7 +531,6 @@ static void unsubscribe(Channel *channel, char *event) xfree(event_string); } - /// Mark rpc state as closed, and release its reference to the channel. /// Don't call this directly, call channel_close(id, kChannelPartRpc, &error) void rpc_close(Channel *channel) diff --git a/src/nvim/msgpack_rpc/channel.h b/src/nvim/msgpack_rpc/channel.h index eb0de47437..ac7911bb2c 100644 --- a/src/nvim/msgpack_rpc/channel.h +++ b/src/nvim/msgpack_rpc/channel.h @@ -17,7 +17,6 @@ /// of os_inchar(), so they are processed "just-in-time". EXTERN MultiQueue *ch_before_blocking_events INIT(= NULL); - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "msgpack_rpc/channel.h.generated.h" #endif diff --git a/src/nvim/msgpack_rpc/helpers.c b/src/nvim/msgpack_rpc/helpers.c index 32014fcf2b..488321be42 100644 --- a/src/nvim/msgpack_rpc/helpers.c +++ b/src/nvim/msgpack_rpc/helpers.c @@ -22,7 +22,6 @@ static msgpack_zone zone; static msgpack_sbuffer sbuffer; - void msgpack_rpc_helpers_init(void) { msgpack_zone_init(&zone, 0xfff); @@ -252,7 +251,6 @@ bool msgpack_rpc_to_dictionary(const msgpack_object *const obj, Dictionary *cons arg->size = obj->via.array.size; arg->items = xcalloc(obj->via.map.size, sizeof(KeyValuePair)); - for (uint32_t i = 0; i < obj->via.map.size; i++) { if (!msgpack_rpc_to_string(&obj->via.map.ptr[i].key, &arg->items[i].key)) { diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 1ba49ea8f3..5e6db88002 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -86,7 +86,6 @@ typedef struct normal_state { static int VIsual_mode_orig = NUL; // saved Visual mode - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "normal.c.generated.h" #endif @@ -1605,7 +1604,6 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent) } } - // CTRL right mouse button does CTRL-T if (is_click && (mod_mask & MOD_MASK_CTRL) && which_button == MOUSE_RIGHT) { if (State & MODE_INSERT) { @@ -1781,7 +1779,6 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent) return false; } - // When 'mousemodel' is "popup" or "popup_setpos", translate mouse events: // right button up -> pop-up menu // shift-left button -> right button @@ -1902,7 +1899,6 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent) } } - // Set global flag that we are extending the Visual area with mouse dragging; // temporarily minimize 'scrolloff'. if (VIsual_active && is_drag && get_scrolloff_value(curwin)) { @@ -2556,7 +2552,6 @@ static char_u old_showcmd_buf[SHOWCMD_BUFLEN]; // For push_showcmd() static bool showcmd_is_clear = true; static bool showcmd_visual = false; - void clear_showcmd(void) { if (!p_sc) { @@ -3816,7 +3811,6 @@ dozet: } break; - case 'u': // "zug" and "zuw": undo "zg" and "zw" no_mapping++; allow_keys++; // no mapping for nchar, but allow key codes @@ -3903,7 +3897,6 @@ dozet: } } - /// "Q" command. static void nv_regreplay(cmdarg_T *cap) { @@ -5448,7 +5441,6 @@ static void n_swapchar(cmdarg_T *cap) } } - check_cursor(); curwin->w_set_curswant = true; if (did_change) { @@ -5805,7 +5797,6 @@ static void n_start_visual_mode(int c) } } - /// CTRL-W: Window commands static void nv_window(cmdarg_T *cap) { @@ -6695,7 +6686,6 @@ static void nv_select(cmdarg_T *cap) } } - /// "G", "gg", CTRL-END, CTRL-HOME. /// cap->arg is true for "G". static void nv_goto(cmdarg_T *cap) diff --git a/src/nvim/normal.h b/src/nvim/normal.h index 0c2b8b4d8a..9bda70eacd 100644 --- a/src/nvim/normal.h +++ b/src/nvim/normal.h @@ -76,7 +76,6 @@ typedef struct cmdarg_S { #define CA_COMMAND_BUSY 1 // skip restarting edit() once #define CA_NO_ADJ_OP_END 2 // don't adjust operator end - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "normal.h.generated.h" #endif diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 8ea55579bb..83e2a85112 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -453,7 +453,6 @@ static void shift_block(oparg_T *oap, int amount) non_white_col += incr; } - const colnr_T block_space_width = non_white_col - oap->start_vcol; // We will shift by "total" or "block_space_width", whichever is less. const colnr_T shift_amount = block_space_width < total @@ -2105,7 +2104,6 @@ static int op_replace(oparg_T *oap, int c) return OK; } - /* * Handle the (non-standard vi) tilde operator. Also for "gu", "gU" and "g?". */ @@ -2629,7 +2627,6 @@ void clear_registers(void) #endif - /// Free contents of yankreg `reg`. /// Called for normal freeing and in case of error. /// `reg` must not be NULL (but `reg->y_array` might be) @@ -3853,7 +3850,6 @@ void ex_display(exarg_T *eap) continue; // did not ask for this register } - if (i == -1) { if (y_previous != NULL) { yb = y_previous; @@ -5436,7 +5432,6 @@ void format_reg_type(MotionType reg_type, colnr_T reg_width, char *buf, size_t b } } - /// When `flags` has `kGRegList` return a list with text `s`. /// Otherwise just return `s`. /// @@ -5817,7 +5812,6 @@ void clear_oparg(oparg_T *oap) memset(oap, 0, sizeof(oparg_T)); } - /* * Count the number of bytes, characters and "words" in a line. * @@ -6286,7 +6280,6 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) int restart_edit_save; int lbr_saved = curwin->w_p_lbr; - // The visual area is remembered for redo static int redo_VIsual_mode = NUL; // 'v', 'V', or Ctrl-V static linenr_T redo_VIsual_line_count; // number of lines @@ -7276,7 +7269,6 @@ void restore_batch_count(int save_count) } } - /// Check whether register is empty static inline bool reg_empty(const yankreg_T *const reg) FUNC_ATTR_PURE diff --git a/src/nvim/option.c b/src/nvim/option.c index 0d02bae5f7..5565e6f167 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -101,7 +101,6 @@ #define OPT_BUF(x) (idopt_T)(PV_BUF + (int)(x)) #define OPT_BOTH(x) (idopt_T)(PV_BOTH + (int)(x)) - // WV_ and BV_ values get typecasted to this for the "indir" field typedef enum { PV_NONE = 0, @@ -211,7 +210,6 @@ typedef struct vimoption { LastSet last_set; // script in which the option was last set } vimoption_T; - /* * Flags */ @@ -519,7 +517,6 @@ void set_init_1(bool clean_arg) */ set_options_default(0); - curbuf->b_p_initialized = true; curbuf->b_p_ar = -1; // no local 'autoread' value curbuf->b_p_ul = NO_LOCAL_UNDOLEVEL; @@ -778,7 +775,6 @@ void free_all_options(void) } #endif - /// Initialize the options, part two: After getting Rows and Columns. void set_init_2(bool headless) { @@ -909,7 +905,6 @@ void set_helplang_default(const char *lang) } } - /// 'title' and 'icon' only default to true if they have not been set or reset /// in .vimrc and we can read the old value. /// When 'title' and 'icon' have been reset in .vimrc, we won't even check if @@ -2168,7 +2163,6 @@ static uint32_t *insecure_flag(win_T *const wp, int opt_idx, int opt_flags) return &options[opt_idx].flags; } - /// Redraw the window title and/or tab page text later. static void redraw_titles(void) { @@ -3967,7 +3961,6 @@ static char *set_bool_option(const int opt_idx, char_u *const varp, const int va // Remember where the option was set. set_option_sctx_idx(opt_idx, opt_flags, current_sctx); - // May set global value for local option. if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0) { *(int *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) = value; @@ -4195,7 +4188,6 @@ static char *set_bool_option(const int opt_idx, char_u *const varp, const int va } } - /* * End of handling side effects for bool options. */ @@ -4565,7 +4557,6 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, char *errbuf, check_blending(curwin); } - // Check the (new) bounds for Rows and Columns here. if (p_lines < min_rows() && full_screen) { if (errbuf != NULL) { diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index 0dc4bd1b90..9268b1eff6 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -49,7 +49,6 @@ # define DFLT_FFS_VI "" #endif - // Possible values for 'encoding' #define ENC_UCSBOM "ucs-bom" // check for BOM at start of file diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index c03fd60f03..4bc003bc7f 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -878,7 +878,6 @@ const void *vim_env_iter_rev(const char delim, const char *const val, const void } } - /// @param[out] exe_name should be at least MAXPATHL in size void vim_get_prefix_from_exepath(char *exe_name) { @@ -1155,7 +1154,6 @@ char_u *home_replace_save(buf_T *buf, char_u *src) FUNC_ATTR_NONNULL_RET return dst; } - /// Function given to ExpandGeneric() to obtain an environment variable name. char *get_env_name(expand_T *xp, int idx) { diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 5fcae79a67..68da53c476 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -56,7 +56,6 @@ static const int kLibuvSuccess = 0; static uv_loop_t fs_loop; static uv_mutex_t fs_loop_mutex; - // Initialize the fs module void fs_init(void) { @@ -77,7 +76,6 @@ void fs_loop_unlock(void) uv_mutex_unlock(&fs_loop_mutex); } - /// Changes the current directory to `path`. /// /// @return 0 on success, or negative error code. diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index ac21b32a3e..c47a891c18 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -216,7 +216,6 @@ void veryfast_breakcheck(void) } } - /// Test whether a file descriptor refers to a terminal. /// /// @param fd File descriptor. @@ -330,7 +329,6 @@ static uint8_t check_multiclick(int code, int grid, int row, int col) return modifiers; } - // Mouse event handling code(Extract row/col if available and detect multiple // clicks) static unsigned int handle_mouse_event(char **ptr, uint8_t *buf, unsigned int bufsize) diff --git a/src/nvim/os/os_win_console.c b/src/nvim/os/os_win_console.c index 18e2e02b81..20b7f869f1 100644 --- a/src/nvim/os/os_win_console.c +++ b/src/nvim/os/os_win_console.c @@ -9,7 +9,6 @@ # include "os/os_win_console.c.generated.h" #endif - int os_get_conin_fd(void) { const HANDLE conin_handle = CreateFile("CONIN$", diff --git a/src/nvim/os/time.c b/src/nvim/os/time.c index d9f4fe9e37..396bf6986a 100644 --- a/src/nvim/os/time.c +++ b/src/nvim/os/time.c @@ -15,7 +15,6 @@ static uv_mutex_t delay_mutex; static uv_cond_t delay_cond; - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "os/time.c.generated.h" #endif diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c index 3d67ae4ce0..9fe97dd5e4 100644 --- a/src/nvim/os/users.c +++ b/src/nvim/os/users.c @@ -160,7 +160,6 @@ char *os_get_user_directory(const char *name) return NULL; } - #if defined(EXITFREE) void free_users(void) diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index 1398dba0e4..473bf5072c 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -48,7 +48,6 @@ # include <sys/access.h> # endif - // Return a pointer to the ACL of file "fname" in allocated memory. // Return NULL if the ACL is not available for whatever reason. vim_acl_T mch_get_acl(const char_u *fname) diff --git a/src/nvim/path.c b/src/nvim/path.c index fcb91a2783..7f47ce083d 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -1107,7 +1107,6 @@ const char *gettail_dir(const char *const fname) return dir_end; } - /// Calls globpath() with 'path' values for the given pattern and stores the /// result in "gap". /// Returns the total number of matches. @@ -1143,7 +1142,6 @@ static int expand_in_path(garray_T *const gap, char_u *const pattern, const int return gap->ga_len; } - /* * Return TRUE if "p" contains what looks like an environment variable. * Allowing for escaping. diff --git a/src/nvim/plines.c b/src/nvim/plines.c index f940598bf8..35f2512ee3 100644 --- a/src/nvim/plines.c +++ b/src/nvim/plines.c @@ -45,7 +45,6 @@ int plines_win(win_T *wp, linenr_T lnum, bool winheight) return plines_win_nofill(wp, lnum, winheight) + win_get_fill(wp, lnum); } - /// Return the number of filler lines above "lnum". /// /// @param wp diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index 9525a84e62..a77463c9ca 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -443,7 +443,6 @@ void pum_redraw(void) false, pum_grid.zindex); } - // Never display more than we have if (pum_first > pum_size - pum_height) { pum_first = pum_size - pum_height; diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 9c7b36396b..f8d0d117e2 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -44,7 +44,6 @@ #include "nvim/vim.h" #include "nvim/window.h" - struct dir_stack_T { struct dir_stack_T *next; char *dirname; @@ -251,7 +250,6 @@ static char *e_no_more_items = N_("E553: No more items"); !got_int && (i) <= (qfl)->qf_count && (qfp) != NULL; \ (i)++, (qfp) = (qfp)->qf_next) - // Looking up a buffer can be slow if there are many. Remember the last one // to make this a lot faster if there are multiple matches in the same file. static char *qf_last_bufname = NULL; @@ -466,7 +464,6 @@ static const char *efm_analyze_prefix(const char *efmp, efm_T *efminfo) return efmp; } - // Converts a 'errorformat' string to regular expression pattern static int efm_to_regpat(const char *efm, int len, efm_T *fmt_ptr, char *regpat) FUNC_ATTR_NONNULL_ALL @@ -1107,7 +1104,6 @@ static int qf_init_ext(qf_info_T *qi, int qf_idx, const char *restrict efile, bu } } - // Use the local value of 'errorformat' if it's set. if (errorformat == p_efm && tv == NULL && buf && *buf->b_p_efm != NUL) { efm = (char *)buf->b_p_efm; @@ -2213,7 +2209,6 @@ static char *qf_push_dir(char *dirbuf, struct dir_stack_T **stackptr, bool is_fi } } - // pop dirbuf from the directory stack and return previous directory or NULL if // stack is empty static char *qf_pop_dir(struct dir_stack_T **stackptr) @@ -3079,7 +3074,6 @@ theend: decr_quickfix_busy(); } - // Highlight attributes used for displaying entries from the quickfix list. static int qfFileAttr; static int qfSepAttr; @@ -3284,7 +3278,6 @@ static void qf_range_text(const qfline_T *qfp, char *buf, int bufsize) buf[len] = NUL; } - /// Display information (list number, list size and the title) about a /// quickfix/location list. static void qf_msg(qf_info_T *qi, int which, char *lead) @@ -5069,7 +5062,6 @@ void ex_cbelow(exarg_T *eap) } } - /// Return the autocmd name for the :cfile Ex commands static char *cfile_get_auname(cmdidx_T cmdidx) { @@ -5091,7 +5083,6 @@ static char *cfile_get_auname(cmdidx_T cmdidx) } } - // ":cfile"/":cgetfile"/":caddfile" commands. // ":lfile"/":lgetfile"/":laddfile" commands. void ex_cfile(exarg_T *eap) @@ -5201,7 +5192,6 @@ static void vgr_init_regmatch(regmmatch_T *regmatch, char *s) regmatch->rmm_maxcol = 0; } - /// Display a file name when vimgrep is running. static void vgr_display_fname(char *fname) { @@ -5264,7 +5254,6 @@ static bool vgr_qflist_valid(win_T *wp, qf_info_T *qi, unsigned qfid, char *titl return true; } - /// Search for a pattern in all the lines in a buffer and add the matching lines /// to a quickfix list. static bool vgr_match_buflines(qf_list_T *qfl, char *fname, buf_T *buf, char *spat, diff --git a/src/nvim/rbuffer.h b/src/nvim/rbuffer.h index 09d6ba3d34..3ebbc9d82c 100644 --- a/src/nvim/rbuffer.h +++ b/src/nvim/rbuffer.h @@ -50,7 +50,6 @@ rbuffer_space(buf); \ wptr = rbuffer_write_ptr(buf, &wcnt)) - // Iteration #define RBUFFER_EACH(buf, c, i) \ for (size_t i = 0; /* NOLINT(readability/braces) */ \ diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index f0ccd19478..6b8c75e430 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -157,7 +157,6 @@ static char_u *reg_prev_sub = NULL; static char REGEXP_INRANGE[] = "]^-n\\"; static char REGEXP_ABBR[] = "nrtebdoxuU"; - /* * Translate '\x' to its control character, except "\n", which is Magic. */ @@ -376,7 +375,6 @@ typedef struct { int regnpar; } parse_state_T; - static regengine_T bt_regengine; static regengine_T nfa_regengine; @@ -384,7 +382,6 @@ static regengine_T nfa_regengine; # include "regexp.c.generated.h" #endif - // Return true if compiled regular expression "prog" can match a line break. int re_multiline(const regprog_T *prog) FUNC_ATTR_NONNULL_ALL @@ -414,7 +411,6 @@ static int get_equi_class(char_u **pp) return 0; } - /* * Check for a collating element "[.a.]". "pp" points to the '['. * Returns a character. Zero means that no item was recognized. Otherwise @@ -540,7 +536,6 @@ char_u *skip_regexp(char_u *startp, int dirc, int magic, char_u **newp) return p; } - // variables used for parsing static int prevchr_len; // byte length of previous char static int at_start; // True when on the first character @@ -591,7 +586,6 @@ static void restore_parse_state(parse_state_T *ps) regnpar = ps->regnpar; } - /* * Get the next character without advancing. */ @@ -898,7 +892,6 @@ static int64_t getoctchrs(void) return nr; } - /* * read_limits - Read two integers to be taken as a minimum and maximum. * If the first character is '-', then the range is reversed. @@ -1000,7 +993,6 @@ typedef struct { int need_clear_zsubexpr; ///< extmatch subexpressions still need to be ///< cleared - // Internal copy of 'ignorecase'. It is set at each call to vim_regexec(). // Normally it gets the value of "rm_ic" or "rmm_ic", but when the pattern // contains '\c' or '\C' the value is overruled. @@ -1112,7 +1104,6 @@ static int reg_prev_class(void) return -1; } - // Return true if the current rex.input position matches the Visual area. static bool reg_match_visual(void) { @@ -1245,7 +1236,6 @@ static void cleanup_zsubexpr(void) } } - // Advance rex.lnum, rex.line and rex.input to the next line. static void reg_nextline(void) { @@ -1254,7 +1244,6 @@ static void reg_nextline(void) fast_breakcheck(); } - /* * Check whether a backreference matches. * Returns RA_FAIL, RA_NOMATCH or RA_MATCH. @@ -1511,7 +1500,6 @@ static inline char_u *cstrchr(const char_u *const s, const int c) // This stuff below really confuses cc on an SGI -- webb - static fptr_T do_upper(int *d, int c) { *d = mb_toupper(c); @@ -2081,7 +2069,6 @@ exit: return (int)((dst - dest) + 1 - num_escaped); } - /* * Call reg_getline() with the line numbers from the submatch. If a * substitute() was used the reg_maxline and other values have been @@ -2378,7 +2365,6 @@ void vim_regfree(regprog_T *prog) } } - #if defined(EXITFREE) void free_regexp_stuff(void) { diff --git a/src/nvim/regexp_bt.c b/src/nvim/regexp_bt.c index c13c2c6832..03e4d74f14 100644 --- a/src/nvim/regexp_bt.c +++ b/src/nvim/regexp_bt.c @@ -43,7 +43,6 @@ * Named character class support added by Walter Briscoe (1998 Jul 01) */ - /* * The "internal use only" fields in regexp_defs.h are present to pass info from * compile to execute that permits the execute phase to run lots faster on @@ -173,7 +172,6 @@ #define NEWL 18 // Match line-break #define BHPOS 19 // End position for BEHIND or NOBEHIND - // character classes: 20-48 normal, 50-78 include a line-break #define ADD_NL 30 #define FIRST_NL ANY + ADD_NL @@ -252,7 +250,6 @@ #define HASLOOKBH 0x10 // Contains "\@<=" or "\@<!". #define WORST 0 // Worst case. - static int prevchr_len; ///< byte length of previous char static int num_complex_braces; ///< Complex \{...} count static char_u *regcode; ///< Code-emit pointer, or JUST_CALC_SIZE @@ -346,7 +343,6 @@ typedef struct regitem_S { } rs_un; // room for saving rex.input } regitem_T; - // used for STAR, PLUS and BRACE_SIMPLE matching typedef struct regstar_S { int nextb; // next byte @@ -443,7 +439,6 @@ static char_u *reg(int paren, int *flagp); static void regdump(char_u *, bt_regprog_T *); #endif - #ifdef REGEXP_DEBUG static char_u *regprop(char_u *); @@ -454,7 +449,6 @@ static int regnarrate = 0; # include "regexp_bt.c.generated.h" #endif - /* * Setup to parse the regexp. Used once to get the length and once to do it. */ @@ -490,7 +484,6 @@ static bool use_multibytecode(int c) || utf_iscomposing(c)); } - /* * Emit (if appropriate) a byte of code */ @@ -515,7 +508,6 @@ static void regmbc(int c) } } - /* * Produce the bytes for equivalence class "c". * Currently only handles latin1, latin9 and utf-8. @@ -1489,7 +1481,6 @@ static void reg_equi_class(int c) regmbc(c); } - /* * Emit a node. * Return pointer to generated code. @@ -1596,7 +1587,6 @@ static void regoptail(char_u *p, char_u *val) regtail(OPERAND(p), val); } - /* * Insert an operator in front of already-emitted operand * @@ -2877,7 +2867,6 @@ static char_u *reg(int paren, int *flagp) return ret; } - /* * bt_regcomp() - compile a regular expression into internal code for the * traditional back track matcher. @@ -5223,7 +5212,6 @@ static int bt_regexec_nl(regmatch_T *rmp, char_u *line, colnr_T col, bool line_l return (int)r; } - /// Matches a regexp against multiple lines. /// "rmp->regprog" is a compiled regexp as returned by vim_regcomp(). /// Uses curbuf for line count and 'iskeyword'. diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index cad5e9df29..6f1b392ed9 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -2747,7 +2747,6 @@ static int nfa_regpiece(void) break; - default: break; } // end switch @@ -3485,7 +3484,6 @@ static nfa_state_T *alloc_state(int c, nfa_state_T *out, nfa_state_T *out1) * next state for this fragment. */ - /* * Initialize a Frag_T struct and return it. */ @@ -3523,7 +3521,6 @@ static void patch(Ptrlist *l, nfa_state_T *s) } } - /* * Join the two lists l1 and l2, returning the combination. */ @@ -4403,7 +4400,6 @@ static void nfa_postprocess(nfa_regprog_T *prog) #define NFA_PIM_MATCH 2 // pim executed, matches #define NFA_PIM_NOMATCH 3 // pim executed, no match - #ifdef REGEXP_DEBUG static void log_subsexpr(regsubs_T *subs) { @@ -4790,7 +4786,6 @@ static bool match_follows(const nfa_state_T *startstate, int depth) return false; } - /// @param l runtime state list /// @param state state to update /// @param subs pointers to subexpressions @@ -5460,7 +5455,6 @@ retempty: return false; } - /// Check for a match with \z subexpression "subidx". /// /// @param bytelen out: length of match in bytes @@ -5530,7 +5524,6 @@ static bool nfa_re_num_cmp(uintmax_t val, int op, uintmax_t pos) return val == pos; } - /* * Recursively call nfa_regmatch() * "pim" is NULL or contains info about a Postponed Invisible Match (start @@ -5684,7 +5677,6 @@ static int recursive_regmatch(nfa_state_T *state, nfa_pim_T *pim, nfa_regprog_T return result; } - /* * Estimate the chance of a match with "state" failing. * empty match: 0 diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c index 8f81b79aff..9f6d129392 100644 --- a/src/nvim/runtime.c +++ b/src/nvim/runtime.c @@ -57,7 +57,6 @@ void ex_runtime(exarg_T *eap) source_runtime(arg, flags); } - static void source_callback(char *fname, void *cookie) { (void)do_source(fname, false, DOSO_NONE); @@ -160,7 +159,6 @@ int do_in_path(char_u *path, char *name, int flags, DoInRuntimepathCB callback, } } - return did_one ? OK : FAIL; } @@ -202,7 +200,6 @@ void runtime_search_path_unref(RuntimeSearchPath path, int *ref) } } - /// Find the file "name" in all directories in "path" and invoke /// "callback(fname, cookie)". /// "name" can contain wildcards. @@ -524,7 +521,6 @@ RuntimeSearchPath runtime_search_path_build(void) map_put(String, handle_T)(&pack_used, the_entry, 0); } - char *rtp_entry; for (rtp_entry = (char *)p_rtp; *rtp_entry != NUL;) { char *cur_entry = rtp_entry; @@ -612,7 +608,6 @@ void runtime_search_path_validate(void) } } - /// Just like do_in_path_and_pp(), using 'runtimepath' for "path". int do_in_runtimepath(char *name, int flags, DoInRuntimepathCB callback, void *cookie) { @@ -884,7 +879,6 @@ static void add_opt_pack_plugin(char *fname, void *cookie) add_pack_plugin(true, (char_u *)fname, cookie); } - /// Add all packages in the "start" directory to 'runtimepath'. void add_pack_start_dirs(void) { @@ -918,7 +912,6 @@ static void add_pack_start_dir(char *fname, void *cookie) } } - /// Load plugins from all packages in the "start" directory. void load_start_packages(void) { @@ -1049,7 +1042,6 @@ static inline size_t compute_double_env_sep_len(const char *const val, const siz return ret; } - #define NVIM_SIZE (sizeof("nvim") - 1) /// Add directories to a ENV_SEPCHAR-separated array from a colon-separated one /// diff --git a/src/nvim/runtime.h b/src/nvim/runtime.h index 0550a082e9..d83ec00185 100644 --- a/src/nvim/runtime.h +++ b/src/nvim/runtime.h @@ -32,7 +32,6 @@ typedef kvec_t(char *) CharVec; #define DIP_LUA 0x100 // also use ".lua" files #define DIP_DIRFILE 0x200 // find both files and directories - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "runtime.h.generated.h" #endif diff --git a/src/nvim/screen.c b/src/nvim/screen.c index d88975fa78..b0edad7740 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -160,7 +160,6 @@ typedef struct { } WinExtmark; static kvec_t(WinExtmark) win_extmark_arr INIT(= KV_INITIAL_VALUE); - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "screen.c.generated.h" #endif @@ -551,7 +550,6 @@ int update_screen(int type) bool did_one = false; search_hl.rm.regprog = NULL; - FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { if (wp->w_redr_type == CLEAR && wp->w_floating && wp->w_grid_alloc.chars) { grid_invalidate(&wp->w_grid_alloc); @@ -610,7 +608,6 @@ int update_screen(int type) decor_providers_invoke_end(&providers, &provider_err); kvi_destroy(providers); - // either cmdline is cleared, not drawn or mode is last drawn cmdline_was_last_drawn = false; return OK; @@ -1721,7 +1718,6 @@ static void win_update(win_T *wp, DecorProviders *providers) } } - // restore got_int, unless CTRL-C was hit while redrawing if (!got_int) { got_int = save_got_int; @@ -1806,7 +1802,6 @@ static void win_draw_end(win_T *wp, int c1, int c2, bool draw_margin, int row, i set_empty_rows(wp, row); } - /// Advance **color_cols /// /// @return true when there are columns to draw. @@ -1889,7 +1884,6 @@ done: return cells; } - /// Fills the foldcolumn at "p" for window "wp". /// Only to be called when 'foldcolumn' > 0. /// @@ -4113,7 +4107,6 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc n_attr = 0; } - if (utf_char2cells(mb_c) > 1) { // Need to fill two screen columns. if (wp->w_p_rl) { @@ -4498,7 +4491,6 @@ static void get_sign_display_info(bool nrcol, win_T *wp, linenr_T lnum, sign_att } } - /* * Mirror text "str" for right-left displaying. * Only works for single-byte characters (e.g., numbers). @@ -5468,7 +5460,6 @@ static void win_redr_border(win_T *wp) schar_T *chars = wp->w_float_config.border_chars; int *attrs = wp->w_float_config.border_attr; - int *adj = wp->w_border_adj; int irow = wp->w_height_inner, icol = wp->w_width_inner; @@ -5516,7 +5507,6 @@ static void win_redr_border(win_T *wp) } } - /* * Prepare for 'hlsearch' highlighting. */ @@ -5541,7 +5531,6 @@ static void end_search_hl(void) } } - /// Check if there should be a delay. Used before clearing or redrawing the /// screen or the command line. void check_for_delay(bool check_msg_scroll) @@ -5794,7 +5783,6 @@ void win_scroll_lines(win_T *wp, int row, int line_count) * screen changes, and in the meantime, everything still works. */ - /// insert lines on the screen and move the existing lines down /// 'line_count' is the number of lines to be inserted. /// 'end' is the line after the scrolled part. Normally it is Rows. @@ -5896,7 +5884,6 @@ void grid_del_lines(ScreenGrid *grid, int row, int line_count, int end, int col, } } - // Show the current mode and ruler. // // If clear_cmdline is true, clear the rest of the cmdline. @@ -6182,7 +6169,6 @@ void draw_tabline(void) return; } - // Init TabPageIdxs[] to zero: Clicking outside of tabs has no effect. assert(Columns == tab_page_click_defs_size); stl_clear_click_defs(tab_page_click_defs, tab_page_click_defs_size); @@ -6231,7 +6217,6 @@ void draw_tabline(void) wp = tp->tp_firstwin; } - if (tp->tp_topframe == topframe) { attr = win_hl_attr(cwp, HLF_TPS); } @@ -6253,7 +6238,6 @@ void draw_tabline(void) } } - if (modified || wincount > 1) { if (wincount > 1) { vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount); diff --git a/src/nvim/screen.h b/src/nvim/screen.h index 0afbc24538..9eda5223f1 100644 --- a/src/nvim/screen.h +++ b/src/nvim/screen.h @@ -46,7 +46,6 @@ EXTERN bool updating_screen INIT(= 0); // While resizing the screen this flag is set. EXTERN bool resizing_screen INIT(= 0); - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "screen.h.generated.h" #endif diff --git a/src/nvim/search.c b/src/nvim/search.c index d9d4c74ae9..3eb8d20ffc 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -3507,7 +3507,6 @@ int current_block(oparg_T *oap, long count, int include, int what, int other) return OK; } - /// @param end_tag when true, return true if the cursor is on "</aaa>". /// /// @return true if the cursor is on a "<aaa>" tag. Ignore "<aaa/>". @@ -3925,7 +3924,6 @@ extend: return OK; } - /// Search quote char from string line[col]. /// Quote character escaped by one of the characters in "escape" is not counted /// as a quote. @@ -4244,7 +4242,6 @@ abort_search: return false; } - /// Find next search match under cursor, cursor at end. /// Used while an operator is pending, and in Visual mode. /// diff --git a/src/nvim/shada.c b/src/nvim/shada.c index abb6c68474..84ab5190bf 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -550,7 +550,6 @@ static inline void hmll_remove(HMLList *const hmll, HMLListEntry *const hmll_ent } } - /// Insert entry to the linked list /// /// @param[out] hmll List to insert to. diff --git a/src/nvim/sign.c b/src/nvim/sign.c index dd6fdf3cd5..f61dd53c2a 100644 --- a/src/nvim/sign.c +++ b/src/nvim/sign.c @@ -59,7 +59,6 @@ static char *cmds[] = { #define SIGNCMD_LAST 6 }; - static hashtab_T sg_table; // sign group (signgroup_T) hashtable static int next_sign_id = 1; // next sign id in the global group @@ -361,7 +360,6 @@ static void sign_sort_by_prio_on_line(buf_T *buf, sign_entry_T *sign) } } - /// Add the sign into the signlist. Find the right spot to do it though. /// /// @param buf buffer to store sign in @@ -586,7 +584,6 @@ static linenr_T buf_delsign(buf_T *buf, linenr_T atlnum, int id, char_u *group) return lnum; } - /// Find the line number of the sign with the requested id in group 'group'. If /// the sign does not exist, return 0 as the line number. This will still let /// the correct file get loaded. diff --git a/src/nvim/sign.h b/src/nvim/sign.h index 6e75a4e62b..c61e5d20ef 100644 --- a/src/nvim/sign.h +++ b/src/nvim/sign.h @@ -8,7 +8,6 @@ #include "nvim/ex_cmds_defs.h" #include "nvim/sign_defs.h" - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "sign.h.generated.h" #endif diff --git a/src/nvim/sign_defs.h b/src/nvim/sign_defs.h index 6d28c1849a..e4ece71846 100644 --- a/src/nvim/sign_defs.h +++ b/src/nvim/sign_defs.h @@ -55,5 +55,4 @@ typedef enum { SIGN_TEXT, } SignType; - #endif // NVIM_SIGN_DEFS_H diff --git a/src/nvim/spell.c b/src/nvim/spell.c index df3ee73a28..da04a82d38 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -301,7 +301,6 @@ typedef struct { int score; } limitscore_T; - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "spell.c.generated.h" #endif @@ -1303,7 +1302,6 @@ static void find_prefix(matchinf_T *mip, int mode) mip->mi_word); find_word(mip, FIND_PREFIX); - if (len == 0) { break; // no children, word must end here } @@ -2550,7 +2548,6 @@ void spell_reload(void) } } - // Opposite of offset2bytes(). // "pp" points to the bytes and is advanced over it. // Returns the offset. @@ -3138,7 +3135,6 @@ static bool check_need_cap(linenr_T lnum, colnr_T col) return need_cap; } - // ":spellrepall" void ex_spellrepall(exarg_T *eap) { @@ -4937,7 +4933,6 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so } } - // Go one level deeper in the tree. static void go_deeper(trystate_T *stack, int depth, int score_add) { @@ -5834,7 +5829,6 @@ static void check_suggestions(suginfo_T *su, garray_T *gap) } } - // Add a word to be banned. static void add_banned(suginfo_T *su, char_u *word) { @@ -5888,7 +5882,6 @@ static void rescore_one(suginfo_T *su, suggest_T *stp) } } - // Function given to qsort() to sort the suggestions on st_score. // First on "st_score", then "st_altscore" then alphabetically. static int sug_compare(const void *s1, const void *s2) @@ -6069,7 +6062,6 @@ static void spell_soundfold_wsal(slang_T *slang, char_u *inword, char_u *res) bool did_white = false; int wordlen; - // Convert the multi-byte string to a wide-character string. // Remove accents, if wanted. We actually remove all non-word characters. // But keep white space. diff --git a/src/nvim/spell_defs.h b/src/nvim/spell_defs.h index 12e44cb7ff..7e85b5bf03 100644 --- a/src/nvim/spell_defs.h +++ b/src/nvim/spell_defs.h @@ -60,7 +60,6 @@ typedef int idx_T; #define WF_PFX_COMPFORBID (WFP_COMPFORBID << 24) // postponed prefix with // COMPOUNDFORBIDFLAG - // flags for <compoptions> #define COMP_CHECKDUP 1 // CHECKCOMPOUNDDUP #define COMP_CHECKREP 2 // CHECKCOMPOUNDREP diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index f8c01bc27f..2b6bb098d1 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -638,7 +638,6 @@ slang_T *spell_load_file(char_u *fname, char_u *lang, slang_T *old_lp, bool sile goto endFAIL; } - // <SECTIONS>: <section> ... <sectionend> // <section>: <sectionID> <sectionflags> <sectionlen> (section contents) for (;;) { @@ -992,7 +991,6 @@ nextone: } } - // Read a length field from "fd" in "cnt_bytes" bytes. // Allocate memory, read the string into it and add a NUL at the end. // Returns NULL when the count is zero. @@ -3886,7 +3884,6 @@ static char_u *getroom_save(spellinfo_T *spin, char_u *s) return memcpy(getroom(spin, s_size, false), s, s_size); } - // Free the list of allocated sblock_T. static void free_blocks(sblock_T *bl) { @@ -4338,7 +4335,6 @@ static bool node_equal(wordnode_T *n1, wordnode_T *n2) return p1 == NULL && p2 == NULL; } - // Function given to qsort() to sort the REP items on "from" string. static int rep_compare(const void *s1, const void *s2) { @@ -4685,7 +4681,6 @@ static int write_vim_spell(spellinfo_T *spin, char_u *fname) // end of <SECTIONS> putc(SN_END, fd); // <sectionend> - // <LWORDTREE> <KWORDTREE> <PREFIXTREE> spin->si_memtot = 0; for (unsigned int round = 1; round <= 3; ++round) { @@ -4753,7 +4748,6 @@ static void clear_node(wordnode_T *node) } } - /// Dump a word tree at node "node". /// /// This first writes the list of possible bytes (siblings). Then for each @@ -4872,7 +4866,6 @@ static int put_node(FILE *fd, wordnode_T *node, int idx, int regionmask, bool pr return newindex; } - // ":mkspell [-ascii] outfile infile ..." // ":mkspell [-ascii] addfile" void ex_mkspell(exarg_T *eap) @@ -5260,7 +5253,6 @@ theend: fclose(fd); } - /// Create a Vim spell file from one or more word lists. /// "fnames[0]" is the output file name. /// "fnames[fcount - 1]" is the last input file name. diff --git a/src/nvim/state.c b/src/nvim/state.c index 36789016a9..f6d9b535fc 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -24,7 +24,6 @@ # include "state.c.generated.h" #endif - void state_enter(VimState *s) { for (;;) { @@ -122,7 +121,6 @@ void state_handle_k_event(void) } } - /// Return true if in the current mode we need to use virtual. bool virtual_active(void) { diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 999e6801fb..319cdeba35 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -553,7 +553,6 @@ char_u *concat_str(const char_u *restrict str1, const char_u *restrict str2) return dest; } - static const char *const e_printf = N_("E766: Insufficient arguments for printf()"); diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 6744e4445c..47305b6709 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -95,7 +95,6 @@ typedef struct syn_pattern { syn_time_T sp_time; } synpat_T; - typedef struct syn_cluster_S { char_u *scl_name; // syntax cluster name char_u *scl_name_u; // uppercase of scl_name @@ -178,7 +177,6 @@ static char *(spo_name_tab[SPO_COUNT]) = #define SPTYPE_END 3 // match a regexp, end of item #define SPTYPE_SKIP 4 // match a regexp, skip within item - #define SYN_ITEMS(buf) ((synpat_T *)((buf)->b_syn_patterns.ga_data)) #define NONE_IDX (-2) // value of sp_sync_idx for "NONE" @@ -2094,7 +2092,6 @@ static int syn_current_attr(const bool syncing, const bool displaying, bool *con } } - /* * Check for end of current state (and the states before it) at the * next column. Don't do this for syncing, because we would miss a @@ -2140,7 +2137,6 @@ static int syn_current_attr(const bool syncing, const bool displaying, bool *con return current_attr; } - /// @return true if we already matched pattern "idx" at the current column. static bool did_match_already(int idx, garray_T *gap) { @@ -3607,7 +3603,6 @@ static void syn_match_msg(void) static int last_matchgroup; - /// List one syntax item, for ":syntax" or "syntax list syntax_name". /// /// @param syncing when true: list syncing items @@ -5694,7 +5689,6 @@ bool syntax_present(win_T *win) || win->w_s->b_keywtab_ic.ht_used > 0; } - static enum { EXP_SUBCMD, // expand ":syn" sub-commands EXP_CASE, // expand ":syn case" arguments @@ -5788,7 +5782,6 @@ char *get_syntax_name(expand_T *xp, int idx) return NULL; } - /// Function called for expression evaluation: get syntax ID at file position. /// /// @param trans remove transparency @@ -5823,7 +5816,6 @@ int get_syntax_info(int *seqnrp) return current_flags; } - /// Get the sequence number of the concealed file position. /// /// @return seqnr if the file position is concealed, 0 otherwise. diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 8a21ec3e5d..73b5bb4058 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -99,7 +99,6 @@ static char *mt_names[MT_COUNT/2] = #define NOTAGFILE 99 // return value for jumpto_tag static char_u *nofile_fname = NULL; // fname for NOTAGFILE error - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "tag.c.generated.h" #endif @@ -603,7 +602,6 @@ bool do_tag(char_u *tag, int type, int count, int forceit, int verbose) smsg(_("File \"%s\" does not exist"), nofile_fname); } - ic = (matches[cur_match][0] & MT_IC_OFF); if (type != DT_TAG && type != DT_SELECT && type != DT_JUMP && type != DT_CSCOPE @@ -1064,7 +1062,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 @@ -1089,7 +1086,6 @@ static int tag_strnicmp(char_u *s1, char_u *s2, size_t len) return 0; // strings match } - /* * Extract info from the tag search pattern "pats->pat". */ @@ -1410,7 +1406,6 @@ int find_tags(char_u *pat, int *num_matches, char_u ***matchesp, int flags, int int matchoff = 0; int save_emsg_off; - char_u *mfp; garray_T ga_match[MT_COUNT]; // stores matches in sequence hashtab_T ht_match[MT_COUNT]; // stores matches by key @@ -1752,7 +1747,6 @@ line_read_in: } } - /* * When still at the start of the file, check for Emacs tags file * format, and for "not sorted" flag. @@ -2723,7 +2717,6 @@ static int jumpto_tag(const char_u *lbuf_arg, int forceit, int keep_help) ++RedrawingDisabled; - if (l_g_do_tagpreview != 0) { postponed_split = 0; // don't split again below curwin_save = curwin; // Save current window @@ -3148,7 +3141,6 @@ int expand_tags(int tagnames, char_u *pat, int *num_file, char_u ***file) return ret; } - /// Add a tag field to the dictionary "dict". /// Return OK or FAIL. /// diff --git a/src/nvim/tag.h b/src/nvim/tag.h index 902fe0c7ba..c8051e1dcc 100644 --- a/src/nvim/tag.h +++ b/src/nvim/tag.h @@ -41,7 +41,6 @@ typedef struct { void *tn_search_ctx; } tagname_T; - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "tag.h.generated.h" #endif diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index c8f70d4afd..e4262c2ca9 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -359,7 +359,6 @@ void terminal_check_size(Terminal *term) vterm_get_size(term->vt, &curheight, &curwidth); uint16_t width = 0, height = 0; - FOR_ALL_TAB_WINDOWS(tp, wp) { if (wp->w_buffer && wp->w_buffer->terminal == term) { const uint16_t win_width = @@ -722,7 +721,6 @@ static int get_rgb(VTermState *state, VTermColor color) return RGB_(color.rgb.red, color.rgb.green, color.rgb.blue); } - void terminal_get_line_attributes(Terminal *term, win_T *wp, int linenr, int *term_attrs) { int height, width; @@ -1364,7 +1362,6 @@ end: // }}} // terminal buffer refresh & misc {{{ - static void fetch_row(Terminal *term, int row, int end_col) { int col = 0; diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index fbbd6f1bc2..c8083cddb1 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -1,7 +1,6 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - #include "nvim/api/private/helpers.h" #include "nvim/api/vim.h" #include "nvim/ascii.h" @@ -331,7 +330,6 @@ static TermKeyResult tk_getkey(TermKey *tk, TermKeyKey *key, bool force) return force ? termkey_getkey_force(tk, key) : termkey_getkey(tk, key); } - static void tk_getkeys(TermInput *input, bool force) { TermKeyKey key; diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 720abb1cec..6c1c1ade00 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -145,7 +145,6 @@ static bool cursor_style_enabled = false; # include "tui/tui.c.generated.h" #endif - UI *tui_start(void) { UI *ui = xcalloc(1, sizeof(UI)); // Freed by ui_bridge_stop(). @@ -713,7 +712,6 @@ static void update_attrs(UI *ui, int attr_id) } } - data->default_attr = fg == -1 && bg == -1 && !bold && !italic && !has_any_underline && !reverse && !standout && !strikethrough; diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 01583c032f..b40033296e 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -182,7 +182,6 @@ void ui_event(char *name, Array args) } } - void ui_refresh(void) { if (!ui_active()) { @@ -533,7 +532,6 @@ void ui_flush(void) ui_call_flush(); } - /// Check if 'mouse' is active for the current mode /// /// TODO(bfredl): precompute the State -> active mapping when 'mouse' changes, diff --git a/src/nvim/ui.h b/src/nvim/ui.h index 7cc0bd9eff..1d278010e8 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -74,6 +74,5 @@ struct ui_t { # include "ui_events_call.h.generated.h" #endif - EXTERN MultiQueue *resize_events; #endif // NVIM_UI_H diff --git a/src/nvim/ui_bridge.h b/src/nvim/ui_bridge.h index a62ed15621..c18600a857 100644 --- a/src/nvim/ui_bridge.h +++ b/src/nvim/ui_bridge.h @@ -38,7 +38,6 @@ struct ui_bridge_data { uv_mutex_unlock(&d->mutex); \ } while (0) - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui_bridge.h.generated.h" #endif diff --git a/src/nvim/ui_compositor.c b/src/nvim/ui_compositor.c index 1dce84a1de..3ce2b80ea9 100644 --- a/src/nvim/ui_compositor.c +++ b/src/nvim/ui_compositor.c @@ -462,7 +462,6 @@ static void compose_debug(Integer startrow, Integer endrow, Integer startcol, In (const sattr_T *)attrbuf); } - if (delay) { debug_delay(endrow - startrow); } @@ -476,7 +475,6 @@ static void debug_delay(Integer lines) os_microdelay(factor * wd * 1000u, true); } - static void compose_area(Integer startrow, Integer endrow, Integer startcol, Integer endcol) { compose_debug(startrow, endrow, startcol, endcol, dbghl_recompose, true); diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 529eef19a3..f496c4199a 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -611,7 +611,6 @@ int u_savecommon(buf_T *buf, linenr_T top, linenr_T bot, linenr_T newbot, int re return OK; } - // magic at start of undofile #define UF_START_MAGIC "Vim\237UnDo\345" #define UF_START_MAGIC_LEN 9 @@ -2472,7 +2471,6 @@ static void u_undoredo(int undo, bool do_buf_event) } // finish Adjusting extmarks - curhead->uh_entry = newlist; curhead->uh_flags = new_flags; if ((old_flags & UH_EMPTYBUF) && buf_is_empty(curbuf)) { diff --git a/src/nvim/version.c b/src/nvim/version.c index 1b520780d1..1c8fdce1eb 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -35,7 +35,6 @@ #endif #define NVIM_VERSION_LONG "NVIM " NVIM_VERSION_MEDIUM - char *Version = VIM_VERSION_SHORT; char *longVersion = NVIM_VERSION_LONG; char *version_buildtype = "Build type: " NVIM_VERSION_BUILD_TYPE; @@ -2194,7 +2193,6 @@ void list_version(void) version_msg("\nRun :checkhealth for more info"); } - /// Show the intro message when not editing a file. void maybe_intro_message(void) { diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 1c05387da3..7e82af2d93 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -10,7 +10,6 @@ #define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim" #define RUNTIME_DIRNAME "runtime" - #include "auto/config.h" #define HAVE_PATHDEF @@ -37,7 +36,6 @@ enum { NUMBUFLEN = 65, }; // special attribute addition: Put message in history #define MSG_HIST 0x1000 - // Values for State // // The lower bits up to 0x80 are used to distinguish normal/visual/op_pending @@ -74,7 +72,6 @@ enum { NUMBUFLEN = 65, }; #define MODE_CONFIRM 0x7000 // ":confirm" prompt #define MODE_CMDPREVIEW 0x8000 // Showing 'inccommand' command "live" preview. - /// Directions. typedef enum { kDirectionNotSet = 0, @@ -103,7 +100,6 @@ typedef enum { #define VAR_TYPE_SPECIAL 7 #define VAR_TYPE_BLOB 10 - // values for xp_context when doing command line completion enum { @@ -164,7 +160,6 @@ enum { EXPAND_LUA, }; - // 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). @@ -173,7 +168,6 @@ enum { #define MIN_SWAP_PAGE_SIZE 1048 #define MAX_SWAP_PAGE_SIZE 50000 - // Boolean constants #ifndef TRUE @@ -186,7 +180,6 @@ enum { #define STATUS_HEIGHT 1 // height of a status line under a window #define QF_WINHEIGHT 10 // default height for quickfix window - // Buffer sizes #ifndef CMDBUFFSIZE @@ -199,7 +192,6 @@ enum { enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() - // Maximum length of key sequence to be mapped. // Must be able to hold an Amiga resize report. @@ -283,7 +275,6 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() (const char *)(y), \ (size_t)(n)) - // Enums need a typecast to be used as array index (for Ultrix). #define HL_ATTR(n) highlight_attr[(int)(n)] diff --git a/src/nvim/viml/parser/parser.c b/src/nvim/viml/parser/parser.c index 8d26d08ea7..a41b750e76 100644 --- a/src/nvim/viml/parser/parser.c +++ b/src/nvim/viml/parser/parser.c @@ -7,7 +7,6 @@ # include "viml/parser/parser.c.generated.h" #endif - void parser_simple_get_line(void *cookie, ParserLine *ret_pline) { ParserLine **plines_p = (ParserLine **)cookie; diff --git a/src/nvim/window.c b/src/nvim/window.c index 0ba5bb1889..f42ef874ef 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -53,12 +53,10 @@ #include "nvim/vim.h" #include "nvim/window.h" - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "window.c.generated.h" #endif - #define NOWIN ((win_T *)-1) // non-existing window #define ROWS_AVAIL (Rows - p_ch - tabline_height() - global_stl_height()) @@ -533,7 +531,6 @@ wingotofile: } break; - // CTRL-W g extended commands case 'g': case Ctrl_G: @@ -773,7 +770,6 @@ void win_config_float(win_T *wp, FloatConfig fconfig) wp->w_float_config.border_hl_ids, sizeof fconfig.border_hl_ids)); - wp->w_float_config = fconfig; bool has_border = wp->w_floating && wp->w_float_config.border; @@ -1055,7 +1051,6 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir) need_status = STATUS_HEIGHT; } - if (flags & WSP_VERT) { int wmw1; int minwidth; @@ -1520,7 +1515,6 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir) return OK; } - /* * Initialize window "newp" from window "oldp". * Used when splitting a window and when creating a new tab page. @@ -1756,7 +1750,6 @@ static void win_exchange(long Prenum) return; } - /* * find window to exchange with */ @@ -3843,7 +3836,6 @@ static int frame_minwidth(frame_T *topfrp, win_T *next_curwin) return m; } - /// Try to close all windows except current one. /// Buffers in the other windows become hidden if 'hidden' is set, or '!' is /// used and the buffer was modified. @@ -4560,7 +4552,6 @@ void tabpage_move(int nr) redraw_tabline = true; } - /* * Go to another window. * When jumping to another buffer, stop Visual mode. Do this before @@ -4598,7 +4589,6 @@ void win_goto(win_T *wp) } } - /* * Find the tabpage for window "win". */ @@ -5061,7 +5051,6 @@ static win_T *win_alloc(win_T *after, bool hidden) return new_wp; } - // Free one wininfo_T. void free_wininfo(wininfo_T *wip, buf_T *bp) { @@ -5072,7 +5061,6 @@ void free_wininfo(wininfo_T *wip, buf_T *bp) xfree(wip); } - /// Remove window 'wp' from the window list and free the structure. /// /// @param tp tab page "win" is in, NULL for current @@ -5283,7 +5271,6 @@ static void frame_remove(frame_T *frp) } } - /* * Called from win_new_shellsize() after Rows changed. * This only does the current tab page, others must be done when made active. @@ -5473,7 +5460,6 @@ static void frame_comp_pos(frame_T *topfrp, int *row, int *col) } } - /* * Set current window height and take care of repositioning other windows to * fit around it. @@ -5521,7 +5507,6 @@ void win_setheight_win(int height, win_T *win) } } - /* * Set the height of a frame to "height" and take care that all frames and * windows inside it are resized. Also resize frames on the left and right if @@ -6132,7 +6117,6 @@ void win_drag_vsep_line(win_T *dragwin, int offset) redraw_all_later(NOT_VALID); } - #define FRACTION_MULT 16384L // Set wp->w_fraction for the current w_wrow and w_height. diff --git a/src/uncrustify.cfg b/src/uncrustify.cfg index 5f1165024a..731224fd8d 100644 --- a/src/uncrustify.cfg +++ b/src/uncrustify.cfg @@ -2219,7 +2219,7 @@ donot_add_nl_before_cpp_comment = false # true/false # # The maximum number of consecutive newlines (3 = 2 blank lines). -nl_max = 3 # unsigned number +nl_max = 2 # unsigned number # The maximum number of consecutive newlines in a function. nl_max_blank_in_func = 0 # unsigned number |