diff --git a/src/cmdexpand.c b/src/cmdexpand.c index f7d3ac8c98..a6d8c8539b 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -4386,10 +4386,10 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) } if (cmdline_fuzzy_completion_supported(&xpc)) - // when fuzzy matching, don't modify the search string - pat = vim_strsave(xpc.xp_pattern); + // when fuzzy matching, don't modify the search string + pat = vim_strsave(xpc.xp_pattern); else - pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context); + pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context); if (rettv_list_alloc(rettv) == OK && pat != NULL) { diff --git a/src/debugger.c b/src/debugger.c index 5508ea33fc..cb0b86f76d 100644 --- a/src/debugger.c +++ b/src/debugger.c @@ -395,9 +395,9 @@ do_showbacktrace(char_u *cmd) } if (SOURCING_LNUM != 0) - smsg(_("line %ld: %s"), (long)SOURCING_LNUM, cmd); + smsg(_("line %ld: %s"), (long)SOURCING_LNUM, cmd); else - smsg(_("cmd: %s"), cmd); + smsg(_("cmd: %s"), cmd); } /* diff --git a/src/diff.c b/src/diff.c index ec108e985e..171bffba35 100644 --- a/src/diff.c +++ b/src/diff.c @@ -781,7 +781,7 @@ diff_write_buffer(buf_T *buf, diffin_T *din, linenr_T start, linenr_T end) char_u *ptr; if (end < 0) - end = buf->b_ml.ml_line_count; + end = buf->b_ml.ml_line_count; if (buf->b_ml.ml_flags & ML_EMPTY) { @@ -2395,10 +2395,10 @@ diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus) if (lnum >= wp->w_topline && lnum < wp->w_botline && !dp->is_linematched && diff_linematch(dp) && diff_check_sanity(curtab, dp)) - run_linematch_algorithm(dp); + run_linematch_algorithm(dp); if (dp->is_linematched) - return linematched_filler_lines(dp, idx, lnum, linestatus); + return linematched_filler_lines(dp, idx, lnum, linestatus); if (lnum < dp->df_lnum[idx] + dp->df_count[idx]) { diff --git a/src/dosinst.c b/src/dosinst.c index 116cc8fa40..3c2dc15720 100644 --- a/src/dosinst.c +++ b/src/dosinst.c @@ -2695,8 +2695,8 @@ request_choice(void) printf("\n\nInstall will do for you:\n"); for (i = 0; i < choice_count; ++i) - if (choices[i].active) - printf("%2d %s\n", i + 1, choices[i].text); + if (choices[i].active) + printf("%2d %s\n", i + 1, choices[i].text); printf("To change an item, enter its number\n\n"); printf("Enter item number, h (help), d (do it) or q (quit): "); } diff --git a/src/evalwindow.c b/src/evalwindow.c index f8b903d505..613df0f251 100644 --- a/src/evalwindow.c +++ b/src/evalwindow.c @@ -106,8 +106,8 @@ win_id2wp_tp(int id, tabpage_T **tpp) } #ifdef FEAT_PROP_POPUP // popup windows are in separate lists - FOR_ALL_TABPAGES(tp) - FOR_ALL_POPUPWINS_IN_TAB(tp, wp) + FOR_ALL_TABPAGES(tp) + FOR_ALL_POPUPWINS_IN_TAB(tp, wp) if (wp->w_id == id) { if (tpp != NULL) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 0dad7b1399..b87e3c76ea 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -467,36 +467,38 @@ restore_dbg_stuff(struct dbg_stuff *dsp) /* * Check if ffname differs from fnum. - * fnum is a buffer number. 0 == current buffer, 1-or-more must be a valid buffer ID. + * fnum is a buffer number. 0 == current buffer, 1-or-more must be a valid + * buffer ID. * ffname is a full path to where a buffer lives on-disk or would live on-disk. * */ static int is_other_file(int fnum, char_u *ffname) { - if (fnum != 0) - { - if (fnum == curbuf->b_fnum) - return FALSE; + if (fnum != 0) + { + if (fnum == curbuf->b_fnum) + return FALSE; - return TRUE; - } + return TRUE; + } - if (ffname == NULL) - return TRUE; + if (ffname == NULL) + return TRUE; - if (*ffname == NUL) - return FALSE; + if (*ffname == NUL) + return FALSE; - // TODO: Need a reliable way to know whether a buffer is meant to live on-disk - // !curbuf->b_dev_valid is not always available (example: missing on Windows) - if (curbuf->b_sfname != NULL - && *curbuf->b_sfname != NUL) - // This occurs with unsaved buffers. In which case `ffname` - // actually corresponds to curbuf->b_sfname - return fnamecmp(ffname, curbuf->b_sfname) != 0; + // TODO: Need a reliable way to know whether a buffer is meant to live + // on-disk !curbuf->b_dev_valid is not always available (example: missing + // on Windows) + if (curbuf->b_sfname != NULL + && *curbuf->b_sfname != NUL) + // This occurs with unsaved buffers. In which case `ffname` actually + // corresponds to curbuf->b_sfname + return fnamecmp(ffname, curbuf->b_sfname) != 0; - return otherfile(ffname); + return otherfile(ffname); } /* @@ -2715,7 +2717,7 @@ static char ex_error_buf[MSG_BUF_LEN]; * Uses a static buffer, only the last error will be kept. * "msg" will be translated, caller should use N_(). */ - char * + char * ex_errmsg(char *msg, char_u *arg) { vim_snprintf(ex_error_buf, MSG_BUF_LEN, _(msg), arg); @@ -9330,7 +9332,7 @@ ex_stopinsert(exarg_T *eap UNUSED) // when called from remote_expr in insert mode, make sure insert mode is // ended by adding K_NOP to the typeahead buffer if (vgetc_busy) - ins_char_typebuf(K_NOP, 0); + ins_char_typebuf(K_NOP, 0); #endif clearmode(); } @@ -10375,5 +10377,5 @@ get_pressedreturn(void) void set_pressedreturn(int val) { - ex_pressedreturn = val; + ex_pressedreturn = val; } diff --git a/src/ex_getln.c b/src/ex_getln.c index bbfe1e593e..a956023503 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -103,7 +103,7 @@ empty_pattern_magic(char_u *p, size_t len, magic_T magic_val) // remove trailing \v and the like while (len >= 2 && p[len - 2] == '\\' && vim_strchr((char_u *)"mMvVcCZ", p[len - 1]) != NULL) - len -= 2; + len -= 2; // true, if the pattern is empty, or the pattern ends with \| and magic is // set (or it ends with '|' and very magic is set) diff --git a/src/findfile.c b/src/findfile.c index fd2d69f298..49def2fe01 100644 --- a/src/findfile.c +++ b/src/findfile.c @@ -162,19 +162,19 @@ typedef struct ff_visited_list_hdr */ typedef struct ff_search_ctx_T { - ff_stack_T *ffsc_stack_ptr; - ff_visited_list_hdr_T *ffsc_visited_list; - ff_visited_list_hdr_T *ffsc_dir_visited_list; - ff_visited_list_hdr_T *ffsc_visited_lists_list; - ff_visited_list_hdr_T *ffsc_dir_visited_lists_list; - string_T ffsc_file_to_search; - string_T ffsc_start_dir; - string_T ffsc_fix_path; - string_T ffsc_wc_path; - int ffsc_level; - string_T *ffsc_stopdirs_v; - int ffsc_find_what; - int ffsc_tagfile; + ff_stack_T *ffsc_stack_ptr; + ff_visited_list_hdr_T *ffsc_visited_list; + ff_visited_list_hdr_T *ffsc_dir_visited_list; + ff_visited_list_hdr_T *ffsc_visited_lists_list; + ff_visited_list_hdr_T *ffsc_dir_visited_lists_list; + string_T ffsc_file_to_search; + string_T ffsc_start_dir; + string_T ffsc_fix_path; + string_T ffsc_wc_path; + int ffsc_level; + string_T *ffsc_stopdirs_v; + int ffsc_find_what; + int ffsc_tagfile; } ff_search_ctx_T; // locally needed functions diff --git a/src/getchar.c b/src/getchar.c index c26b4427a9..0d1bd8a281 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -2604,7 +2604,7 @@ parse_queued_messages(void) // If memory allocation fails during startup we'll exit but curbuf or // curwin could be NULL. if (curbuf == NULL || curwin == NULL) - return; + return; old_curbuf_fnum = curbuf->b_fnum; old_curwin_id = curwin->w_id; diff --git a/src/gui_motif.c b/src/gui_motif.c index ed721b52d0..94633b1878 100644 --- a/src/gui_motif.c +++ b/src/gui_motif.c @@ -1377,7 +1377,7 @@ gui_motif_update_mousemodel(vimmenu_T *menu) // When GUI hasn't started the menus have not been created. if (!gui.in_use) - return; + return; while (menu) { diff --git a/src/gui_xim.c b/src/gui_xim.c index 345b3a493f..7703bb789f 100644 --- a/src/gui_xim.c +++ b/src/gui_xim.c @@ -272,7 +272,7 @@ im_add_to_input(char_u *str, int len) gui_mch_mousehide(TRUE); } - static void + static void im_preedit_window_set_position(void) { int x, y, width, height; diff --git a/src/gui_xmebw.c b/src/gui_xmebw.c index 3d9519eeb0..440c1b96ad 100644 --- a/src/gui_xmebw.c +++ b/src/gui_xmebw.c @@ -505,7 +505,7 @@ draw_shadows(XmEnhancedButtonWidget eb) Boolean etched_in; if (!eb->primitive.shadow_thickness) - return; + return; if ((eb->core.width <= 2 * eb->primitive.highlight_thickness) || (eb->core.height <= 2 * eb->primitive.highlight_thickness)) @@ -748,9 +748,9 @@ draw_label(XmEnhancedButtonWidget eb, XEvent *event, Region region) static void Enter(Widget wid, - XEvent *event, - String *params UNUSED, - Cardinal *num_params UNUSED) + XEvent *event, + String *params UNUSED, + Cardinal *num_params UNUSED) { XmEnhancedButtonWidget eb = (XmEnhancedButtonWidget) wid; XmPushButtonCallbackStruct call_value; @@ -837,9 +837,9 @@ Enter(Widget wid, static void Leave(Widget wid, - XEvent *event, - String *params UNUSED, - Cardinal *num_params UNUSED) + XEvent *event, + String *params UNUSED, + Cardinal *num_params UNUSED) { XmEnhancedButtonWidget eb = (XmEnhancedButtonWidget)wid; XmPushButtonCallbackStruct call_value; diff --git a/src/message.c b/src/message.c index 376119e102..0f799b8f1b 100644 --- a/src/message.c +++ b/src/message.c @@ -4172,11 +4172,11 @@ msg_warn_missing_clipboard(void) if (!global_busy && !did_warn_clipboard) { #ifdef FEAT_CLIPBOARD - msg(_("W23: Clipboard register not available, using register 0")); + msg(_("W23: Clipboard register not available, using register 0")); #else - msg(_("W24: Clipboard register not available. See :h W24")); + msg(_("W24: Clipboard register not available. See :h W24")); #endif - did_warn_clipboard = TRUE; + did_warn_clipboard = TRUE; } } diff --git a/src/move.c b/src/move.c index e3771a5e26..d27114f13c 100644 --- a/src/move.c +++ b/src/move.c @@ -201,7 +201,7 @@ redraw_for_cursorcolumn(win_T *wp) * Returns the number of columns of overlap with buffer text, excluding the * extra padding on the ledge. */ - int + int sms_marker_overlap(win_T *wp, int extra2) { if (extra2 == -1) diff --git a/src/normal.c b/src/normal.c index 9231a4c239..c631651a03 100644 --- a/src/normal.c +++ b/src/normal.c @@ -4059,7 +4059,7 @@ nv_gotofile(cmdarg_T *cap) #endif if (!check_can_set_curbuf_disabled()) - return; + return; ptr = grab_file_name(cap->count1, &lnum); diff --git a/src/optionstr.c b/src/optionstr.c index f60957eb23..ce57cb4cec 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -1864,7 +1864,7 @@ did_set_cryptkey(optset_T *args) } # ifdef FEAT_SODIUM if (crypt_method_is_sodium(crypt_get_method_nr(curbuf))) - crypt_sodium_lock_key(args->os_newval.string); + crypt_sodium_lock_key(args->os_newval.string); # endif return NULL; diff --git a/src/os_unix.c b/src/os_unix.c index 714f203dfb..f5dea37f99 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -4396,9 +4396,9 @@ mch_calc_cell_size(struct cellsize *cs_out) if (retval == -1 || ws.ws_col == 0 || ws.ws_row == 0) { - cs_out->cs_xpixel = -1; - cs_out->cs_ypixel = -1; - return; + cs_out->cs_xpixel = -1; + cs_out->cs_ypixel = -1; + return; } // calculate parent tty's pixel per cell. @@ -6969,9 +6969,9 @@ mch_expand_wildcards( } if (shell_style == STYLE_ECHO) { - if (strstr((char *)gettail(p_sh), "bash") != NULL) + if (strstr((char *)gettail(p_sh), "bash") != NULL) shell_style = STYLE_GLOBSTAR; - else if (strstr((char *)gettail(p_sh), "sh") != NULL) + else if (strstr((char *)gettail(p_sh), "sh") != NULL) shell_style = STYLE_VIMGLOB; } diff --git a/src/os_vms.c b/src/os_vms.c index 23854dd3f0..0a67a6b75d 100644 --- a/src/os_vms.c +++ b/src/os_vms.c @@ -686,9 +686,9 @@ vms_fixfilename(void *instring) } #ifdef DEBUG - char *tmpbuf = NULL; - tmpbuf = ALLOC_MULT(char, buflen); - strcpy(tmpbuf, instring); + char *tmpbuf = NULL; + tmpbuf = ALLOC_MULT(char, buflen); + strcpy(tmpbuf, instring); #endif Fspec_Rms = buf; // for decc$to_vms diff --git a/src/os_win32.c b/src/os_win32.c index 0b6fecd7e8..740c35a0ab 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -5089,8 +5089,8 @@ mch_system_piped(char *cmd, int options) // About "Inherit handles" being TRUE: this command can be litigious, // handle inheritance was deactivated for pending temp file, but, if we // deactivate it, the pipes don't work for some reason. - vim_create_process(p, TRUE, CREATE_DEFAULT_ERROR_MODE, - &si, &pi, NULL, NULL); + vim_create_process(p, TRUE, CREATE_DEFAULT_ERROR_MODE, + &si, &pi, NULL, NULL); if (p != cmd) vim_free(p); diff --git a/src/quickfix.c b/src/quickfix.c index 9c5ad9381a..d012ea0d72 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -4759,7 +4759,7 @@ ex_cbottom(exarg_T *eap) * Return the number of the current entry (line number in the quickfix * window). */ - linenr_T + linenr_T qf_current_entry(win_T *wp) { qf_info_T *qi = ql_info; diff --git a/src/regexp.c b/src/regexp.c index 32a721f9f3..e37dd3c5bd 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -410,15 +410,15 @@ static int nextchr; // used for ungetchr() typedef struct { - char_u *regparse; - int prevchr_len; - int curchr; - int prevchr; - int prevprevchr; - int nextchr; - int at_start; - int prev_at_start; - int regnpar; + char_u *regparse; + int prevchr_len; + int curchr; + int prevchr; + int prevprevchr; + int nextchr; + int at_start; + int prev_at_start; + int regnpar; } parse_state_T; static void initchr(char_u *); @@ -1641,9 +1641,9 @@ re_mult_next(char *what) { if (re_multi_type(peekchr()) == MULTI_MULT) { - semsg(_(e_nfa_regexp_cannot_repeat_str), what); - rc_did_emsg = TRUE; - return FAIL; + semsg(_(e_nfa_regexp_cannot_repeat_str), what); + rc_did_emsg = TRUE; + return FAIL; } return OK; } diff --git a/src/screen.c b/src/screen.c index ab37e1d61f..4fcd9d3daa 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1580,7 +1580,7 @@ end_search_hl(void) } #endif - static void + static void screen_start_highlight(int attr) { attrentry_T *aep = NULL; @@ -1738,7 +1738,7 @@ screen_start_highlight(int attr) } } - void + void screen_stop_highlight(void) { int do_ME = FALSE; // output T_ME code @@ -3544,7 +3544,7 @@ screen_ins_lines( * - redrawing for a callback and there is a modeless selection * - there is a popup window */ - if (!screen_valid(TRUE) + if (!screen_valid(TRUE) || line_count <= 0 || line_count > p_ttyscroll || end > Rows #ifdef FEAT_CLIPBOARD diff --git a/src/sha256.c b/src/sha256.c index 9c79e0df1e..6a73a1ce43 100644 --- a/src/sha256.c +++ b/src/sha256.c @@ -40,7 +40,7 @@ (b)[(i) + 3] = (char_u)((n) ); \ } - void + void sha256_start(context_sha256_T *ctx) { ctx->total[0] = 0; diff --git a/src/strings.c b/src/strings.c index 16a09f8307..c356c36665 100644 --- a/src/strings.c +++ b/src/strings.c @@ -601,14 +601,14 @@ vim_strnicmp_asc(char *s1, char *s2, size_t len) while (len > 0) { - i = TOLOWER_ASC(*s1) - TOLOWER_ASC(*s2); - if (i != 0) - break; // this character is different - if (*s1 == NUL) - break; // strings match until NUL - ++s1; - ++s2; - --len; + i = TOLOWER_ASC(*s1) - TOLOWER_ASC(*s2); + if (i != 0) + break; // this character is different + if (*s1 == NUL) + break; // strings match until NUL + ++s1; + ++s2; + --len; } return i; } diff --git a/src/structs.h b/src/structs.h index caf61eda8b..1cb70b80f7 100644 --- a/src/structs.h +++ b/src/structs.h @@ -4579,9 +4579,9 @@ typedef struct } tagname_T; typedef struct { - UINT32_T total[2]; - UINT32_T state[8]; - char_u buffer[64]; + UINT32_T total[2]; + UINT32_T state[8]; + char_u buffer[64]; } context_sha256_T; /* diff --git a/src/term.c b/src/term.c index 5c030ed20a..03bad0d6a9 100644 --- a/src/term.c +++ b/src/term.c @@ -7302,13 +7302,13 @@ update_tcap(int attr) return; while (p->bt_string != NULL) { - if (p->bt_entry == (int)KS_ME) - p->bt_string = &ksme_str[0]; - else if (p->bt_entry == (int)KS_MR) - p->bt_string = &ksmr_str[0]; - else if (p->bt_entry == (int)KS_MD) - p->bt_string = &ksmd_str[0]; - ++p; + if (p->bt_entry == (int)KS_ME) + p->bt_string = &ksme_str[0]; + else if (p->bt_entry == (int)KS_MR) + p->bt_string = &ksmr_str[0]; + else if (p->bt_entry == (int)KS_MD) + p->bt_string = &ksmd_str[0]; + ++p; } } diff --git a/src/userfunc.c b/src/userfunc.c index 76cfd4413f..b9093a0d29 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -7247,7 +7247,7 @@ find_hi_in_scoped_ht(char_u *name, hashtab_T **pht) char_u *varname; if (current_funccal == NULL || current_funccal->fc_func->uf_scoped == NULL) - return NULL; + return NULL; // Search in parent scope, which can be referenced from a lambda. current_funccal = current_funccal->fc_func->uf_scoped; diff --git a/src/version.c b/src/version.c index 98663991c4..5475e0ad1a 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1390, /**/ 1389, /**/ @@ -3815,9 +3817,9 @@ list_version(void) # if defined(USE_GTK3) msg_puts(_("with GTK3 GUI.")); # elif defined(FEAT_GUI_GNOME) - msg_puts(_("with GTK2-GNOME GUI.")); + msg_puts(_("with GTK2-GNOME GUI.")); # else - msg_puts(_("with GTK2 GUI.")); + msg_puts(_("with GTK2 GUI.")); # endif #elif defined(FEAT_GUI_MOTIF) msg_puts(_("with X11-Motif GUI.")); diff --git a/src/viminfo.c b/src/viminfo.c index f1e1fc372b..5e4caf81cd 100644 --- a/src/viminfo.c +++ b/src/viminfo.c @@ -1606,7 +1606,7 @@ static yankreg_T *y_read_regs = NULL; static void prepare_viminfo_registers(void) { - y_read_regs = ALLOC_CLEAR_MULT(yankreg_T, NUM_REGISTERS); + y_read_regs = ALLOC_CLEAR_MULT(yankreg_T, NUM_REGISTERS); } static void