diff options
author | Lewis Russell <lewis6991@gmail.com> | 2022-08-16 12:26:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-16 12:26:08 +0100 |
commit | 542fa8a9cc10abb8eddab25a19844d19b94f53c1 (patch) | |
tree | fa29fc00d016beaddd5893336c19d12757e16494 | |
parent | 9a4b8dc603fb9f5a804d69951848e0ff75d0905f (diff) | |
download | rneovim-542fa8a9cc10abb8eddab25a19844d19b94f53c1.tar.gz rneovim-542fa8a9cc10abb8eddab25a19844d19b94f53c1.tar.bz2 rneovim-542fa8a9cc10abb8eddab25a19844d19b94f53c1.zip |
refactor: change pre-decrement/increment to post (#19799)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
-rw-r--r-- | src/nvim/edit.c | 33 | ||||
-rw-r--r-- | src/nvim/eval/userfunc.c | 35 | ||||
-rw-r--r-- | src/nvim/ex_cmds.c | 40 | ||||
-rw-r--r-- | src/nvim/ex_eval.c | 18 | ||||
-rw-r--r-- | src/nvim/ex_getln.c | 14 | ||||
-rw-r--r-- | src/nvim/file_search.c | 2 | ||||
-rw-r--r-- | src/nvim/fileio.c | 34 | ||||
-rw-r--r-- | src/nvim/fold.c | 6 | ||||
-rw-r--r-- | src/nvim/getchar.c | 6 | ||||
-rw-r--r-- | src/nvim/hardcopy.c | 4 | ||||
-rw-r--r-- | src/nvim/if_cscope.c | 2 | ||||
-rw-r--r-- | src/nvim/indent_c.c | 12 | ||||
-rw-r--r-- | src/nvim/main.c | 22 | ||||
-rw-r--r-- | src/nvim/mbyte.c | 8 | ||||
-rw-r--r-- | src/nvim/memline.c | 22 | ||||
-rw-r--r-- | src/nvim/menu.c | 6 | ||||
-rw-r--r-- | src/nvim/message.c | 36 | ||||
-rw-r--r-- | src/nvim/mouse.c | 4 | ||||
-rw-r--r-- | src/nvim/move.c | 18 | ||||
-rw-r--r-- | src/nvim/ops.c | 23 | ||||
-rw-r--r-- | src/nvim/path.c | 24 | ||||
-rw-r--r-- | src/nvim/regexp.c | 8 | ||||
-rw-r--r-- | src/nvim/regexp_bt.c | 14 | ||||
-rw-r--r-- | src/nvim/regexp_nfa.c | 4 | ||||
-rw-r--r-- | src/nvim/search.c | 64 | ||||
-rw-r--r-- | src/nvim/spell.c | 58 | ||||
-rw-r--r-- | src/nvim/spellfile.c | 72 | ||||
-rw-r--r-- | src/nvim/strings.c | 12 | ||||
-rw-r--r-- | src/nvim/syntax.c | 46 | ||||
-rw-r--r-- | src/nvim/tag.c | 30 | ||||
-rw-r--r-- | src/nvim/undo.c | 12 | ||||
-rw-r--r-- | src/nvim/window.c | 22 |
32 files changed, 351 insertions, 360 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index e1473f30c8..7b4fb34883 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -1747,7 +1747,7 @@ void change_indent(int type, int amount, int round, int replaced, int call_chang replace_push(replaced); replaced = NUL; } - ++start_col; + start_col++; } } @@ -1913,7 +1913,7 @@ int get_literal(bool no_simplify) cc = cc * 10 + nc - '0'; } - ++i; + i++; } if (cc > 255 @@ -1948,7 +1948,7 @@ int get_literal(bool no_simplify) cc = '\n'; } - --no_mapping; + no_mapping--; if (nc) { vungetc(nc); // A character typed with i_CTRL-V_digit cannot have modifiers. @@ -3253,7 +3253,7 @@ int cursor_down(long n, int upd_topline) if (hasFolding(lnum, NULL, &last)) { lnum = last + 1; } else { - ++lnum; + lnum++; } if (lnum >= curbuf->b_ml.ml_line_count) { break; @@ -3433,7 +3433,7 @@ void replace_push(int c) memmove(p + 1, p, (size_t)replace_offset); } *p = (char_u)c; - ++replace_stack_nr; + replace_stack_nr++; } /* @@ -3468,7 +3468,7 @@ static void replace_join(int off) { for (ssize_t i = replace_stack_nr; --i >= 0;) { if (replace_stack[i] == NUL && off-- <= 0) { - --replace_stack_nr; + replace_stack_nr--; memmove(replace_stack + i, replace_stack + i + 1, (size_t)(replace_stack_nr - i)); return; @@ -3794,12 +3794,9 @@ bool in_cinkeys(int keytyped, int when, bool line_is_empty) while (*look == '>') { look++; } - } - /* - * Is it a word: "=word"? - */ - else if (*look == '=' && look[1] != ',' && look[1] != NUL) { - ++look; + // Is it a word: "=word"? + } else if (*look == '=' && look[1] != ',' && look[1] != NUL) { + look++; if (*look == '~') { icase = true; look++; @@ -5219,8 +5216,8 @@ static bool ins_tab(void) // Find first white before the cursor fpos = curwin->w_cursor; while (fpos.col > 0 && ascii_iswhite(ptr[-1])) { - --fpos.col; - --ptr; + fpos.col--; + ptr--; } // In Replace mode, don't change characters before the insert point. @@ -5252,8 +5249,8 @@ static bool ins_tab(void) } } } - ++fpos.col; - ++ptr; + fpos.col++; + ptr++; vcol += i; } @@ -5264,8 +5261,8 @@ static bool ins_tab(void) // Skip over the spaces we need. while (vcol < want_vcol && *ptr == ' ') { vcol += lbr_chartabsize(line, ptr, vcol); - ++ptr; - ++repl_off; + ptr++; + repl_off++; } if (vcol > want_vcol) { // Must have a char with 'showbreak' just before it. diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index c527c70be0..c46cb6ba5d 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -448,13 +448,13 @@ int get_func_tv(const char_u *name, int len, typval_T *rettv, char **arg, funcex ret = FAIL; break; } - ++argcount; + argcount++; if (*argp != ',') { break; } } if (*argp == ')') { - ++argp; + argp++; } else { ret = FAIL; } @@ -845,7 +845,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett rettv->vval.v_number = -1; return; } - ++depth; + depth++; // Save search patterns and redo buffer. save_search_patterns(); if (!ins_compl_active()) { @@ -1017,7 +1017,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett estack_push_ufunc(fp, 1); if (p_verbose >= 12) { - ++no_wait_return; + no_wait_return++; verbose_enter_scroll(); smsg(_("calling %s"), SOURCING_NAME); @@ -1051,7 +1051,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett msg_puts("\n"); // don't overwrite this either verbose_leave_scroll(); - --no_wait_return; + no_wait_return--; } const bool do_profiling_yes = do_profiling == PROF_YES; @@ -1101,7 +1101,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT); } - --RedrawingDisabled; + RedrawingDisabled--; // when the function was aborted because of an error, return -1 if ((did_emsg @@ -1131,7 +1131,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett // when being verbose, mention the return value if (p_verbose >= 12) { - ++no_wait_return; + no_wait_return++; verbose_enter_scroll(); if (aborting()) { @@ -1161,7 +1161,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett msg_puts("\n"); // don't overwrite this either verbose_leave_scroll(); - --no_wait_return; + no_wait_return--; } estack_pop(); @@ -1929,7 +1929,7 @@ void ex_function(exarg_T *eap) todo = (int)func_hashtab.ht_used; for (hi = func_hashtab.ht_array; todo > 0 && !got_int; ++hi) { if (!HASHITEM_EMPTY(hi)) { - --todo; + todo--; fp = HI2UF(hi); if (message_filtered(fp->uf_name)) { continue; @@ -1962,7 +1962,7 @@ void ex_function(exarg_T *eap) todo = (int)func_hashtab.ht_used; for (hi = func_hashtab.ht_array; todo > 0 && !got_int; ++hi) { if (!HASHITEM_EMPTY(hi)) { - --todo; + todo--; fp = HI2UF(hi); if (!isdigit(*fp->uf_name) && vim_regexec(®match, (char *)fp->uf_name, 0)) { @@ -1974,7 +1974,7 @@ void ex_function(exarg_T *eap) } } if (*p == '/') { - ++p; + p++; } eap->nextcmd = (char *)check_nextcmd(p); return; @@ -2096,9 +2096,8 @@ void ex_function(exarg_T *eap) } if (arg != NULL && (fudi.fd_di == NULL || !tv_is_func(fudi.fd_di->di_tv))) { int j = (*arg == K_SPECIAL) ? 3 : 0; - while (arg[j] != NUL && (j == 0 ? eval_isnamec1(arg[j]) - : eval_isnamec(arg[j]))) { - ++j; + while (arg[j] != NUL && (j == 0 ? eval_isnamec1(arg[j]) : eval_isnamec(arg[j]))) { + j++; } if (arg[j] != NUL) { emsg_funcname((char *)e_invarg2, arg); @@ -2645,10 +2644,10 @@ char *get_user_func_name(expand_T *xp, int idx) assert(hi); if (done < func_hashtab.ht_used) { if (done++ > 0) { - ++hi; + hi++; } while (HASHITEM_EMPTY(hi)) { - ++hi; + hi++; } fp = HI2UF(hi); @@ -2856,7 +2855,7 @@ void ex_return(exarg_T *eap) } if (eap->skip) { - ++emsg_skip; + emsg_skip++; } eap->nextcmd = NULL; @@ -2888,7 +2887,7 @@ void ex_return(exarg_T *eap) } if (eap->skip) { - --emsg_skip; + emsg_skip--; } } diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 078b4ec1fb..327834b646 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -303,7 +303,7 @@ void ex_align(exarg_T *eap) new_indent--; break; } - --new_indent; + new_indent--; } } } @@ -1094,12 +1094,12 @@ void ex_copy(linenr_T line1, linenr_T line2, linenr_T n) if (line1 == n) { line1 = curwin->w_cursor.lnum; } - ++line1; + line1++; if (curwin->w_cursor.lnum < line1) { - ++line1; + line1++; } if (curwin->w_cursor.lnum < line2) { - ++line2; + line2++; } ++curwin->w_cursor.lnum; } @@ -1201,7 +1201,7 @@ void do_bang(int addr_count, exarg_T *eap, bool forceit, bool do_in, bool do_out break; } } - ++p; + p++; } } while (trailarg != NULL); @@ -1445,7 +1445,7 @@ static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char *cmd, b } beginline(BL_WHITE | BL_FIX); // cursor on first non-blank - --no_wait_return; + no_wait_return--; if (linecount > p_report) { if (do_in) { @@ -1463,8 +1463,8 @@ static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char *cmd, b error: // put cursor back in same position for ":w !cmd" curwin->w_cursor = cursor_save; - --no_wait_return; - wait_return(FALSE); + no_wait_return--; + wait_return(false); } filterend: @@ -2114,7 +2114,7 @@ void do_wqall(exarg_T *eap) * 4. if overwriting is allowed (even after a dialog) */ if (not_writing()) { - ++error; + error++; break; } if (buf->b_ffname == NULL) { @@ -2249,7 +2249,7 @@ int getfile(int fnum, char *ffname_arg, char *sfname_arg, int setpm, linenr_T ln } } if (other) { - --no_wait_return; + no_wait_return--; } if (setpm) { setpcmark(); @@ -2962,7 +2962,7 @@ void ex_append(exarg_T *eap) } if (eap->cmdidx != CMD_append) { - --lnum; + lnum--; } // when the buffer is empty need to delete the dummy line @@ -3018,7 +3018,7 @@ void ex_append(exarg_T *eap) vcol = 0; for (p = theline; indent > vcol; ++p) { if (*p == ' ') { - ++vcol; + vcol++; } else if (*p == TAB) { vcol += 8 - vcol % 8; } else { @@ -3047,7 +3047,7 @@ void ex_append(exarg_T *eap) } xfree(theline); - ++lnum; + lnum++; if (empty) { ml_delete(2L, false); @@ -3139,10 +3139,10 @@ void ex_z(exarg_T *eap) kind = x; if (*kind == '-' || *kind == '+' || *kind == '=' || *kind == '^' || *kind == '.') { - ++x; + x++; } while (*x == '-' || *x == '+') { - ++x; + x++; } if (*x != 0) { @@ -3199,7 +3199,7 @@ void ex_z(exarg_T *eap) if (*kind == '+') { start += (linenr_T)bigness * (linenr_T)(x - kind - 1) + 1; } else if (eap->addr_count == 0) { - ++start; + start++; } end = start + (linenr_T)bigness - 1; curs = end; @@ -4300,7 +4300,7 @@ skip: * has been appended to new_start, we don't need * it in the buffer. */ - ++lnum; + lnum++; if (u_savedel(lnum, nmatch_tl) != OK) { break; } @@ -5500,7 +5500,7 @@ void fix_help_buffer(void) } s += l - 1; } - ++s; + s++; } // The help file is latin1 or utf-8; // conversion to the current @@ -5722,8 +5722,8 @@ static void helptags_one(char *dir, const char *ext, const char *tagfname, bool *p2 = '\t'; break; } - ++p1; - ++p2; + p1++; + p2++; } } diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index c39bb16498..69d509abb7 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -505,7 +505,7 @@ static int throw_exception(void *value, except_type_T type, char *cmdname) } else { verbose_enter(); } - ++no_wait_return; + no_wait_return++; if (debug_break_level > 0 || *p_vfile == NUL) { msg_scroll = TRUE; // always scroll up, don't overwrite } @@ -515,7 +515,7 @@ static int throw_exception(void *value, except_type_T type, char *cmdname) if (debug_break_level > 0 || *p_vfile == NUL) { cmdline_row = msg_row; } - --no_wait_return; + no_wait_return--; if (debug_break_level > 0) { msg_silent = save_msg_silent; } else { @@ -558,7 +558,7 @@ static void discard_exception(except_T *excp, bool was_finished) } else { verbose_enter(); } - ++no_wait_return; + no_wait_return++; if (debug_break_level > 0 || *p_vfile == NUL) { msg_scroll = TRUE; // always scroll up, don't overwrite } @@ -626,7 +626,7 @@ static void catch_exception(except_T *excp) } else { verbose_enter(); } - ++no_wait_return; + no_wait_return++; if (debug_break_level > 0 || *p_vfile == NUL) { msg_scroll = TRUE; // always scroll up, don't overwrite } @@ -636,7 +636,7 @@ static void catch_exception(except_T *excp) if (debug_break_level > 0 || *p_vfile == NUL) { cmdline_row = msg_row; } - --no_wait_return; + no_wait_return--; if (debug_break_level > 0) { msg_silent = save_msg_silent; } else { @@ -748,12 +748,12 @@ static void report_pending(int action, int pending, void *value) if (debug_break_level > 0) { msg_silent = FALSE; // display messages } - ++no_wait_return; - msg_scroll = TRUE; // always scroll up, don't overwrite + no_wait_return++; + msg_scroll = true; // always scroll up, don't overwrite smsg(mesg, s); msg_puts("\n"); // don't overwrite this either cmdline_row = msg_row; - --no_wait_return; + no_wait_return--; if (debug_break_level > 0) { msg_silent = save_msg_silent; } @@ -2054,7 +2054,7 @@ int has_loop_cmd(char *p) // skip modifiers, white space and ':' for (;;) { while (*p == ' ' || *p == '\t' || *p == ':') { - ++p; + p++; } len = modifier_len(p); if (len == 0) { diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index a2e94d500b..bce5ec3ce5 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -2156,14 +2156,14 @@ static int command_line_handle_key(CommandLineState *s) if (i > 0) { ccline.cmdbuff[len] = '\\'; } - ++len; + len++; } if (i > 0) { ccline.cmdbuff[len] = p[j]; } } - ++len; + len++; } if (i == 0) { @@ -3589,7 +3589,7 @@ void put_on_cmdline(char_u *str, int len, int redraw) msg_col -= i; if (msg_col < 0) { msg_col += Columns; - --msg_row; + msg_row--; } } } @@ -4135,9 +4135,9 @@ char_u *ExpandOne(expand_T *xp, char_u *str, char_u *orig, int options, int mode if (findex == -1) { findex = xp->xp_numfiles; } - --findex; + findex--; } else { // mode == WILD_NEXT - ++findex; + findex++; } /* @@ -4877,7 +4877,7 @@ char_u *addstar(char_u *fname, size_t len, int context) && vim_strchr((char *)retval, '`') == NULL) { retval[len++] = '*'; } else if (len > 0 && retval[len - 1] == '$') { - --len; + len--; } retval[len] = NUL; } @@ -5518,7 +5518,7 @@ static void expand_shellcmd(char_u *filepat, int *num_file, char ***file, int fl } } if (*e != NUL) { - ++e; + e++; } } *file = ga.ga_data; diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 176765e6ac..2d09e7aa71 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -307,7 +307,7 @@ void *vim_findfile_init(char_u *path, char_u *filename, char_u *stopdirs, int le search_ctx->ffsc_start_dir = vim_strnsave(rel_fname, len); } if (*++path != NUL) { - ++path; + path++; } } else if (*path == NUL || !vim_isAbsName(path)) { #ifdef BACKSLASH_IN_FILENAME diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index bc76e3225e..09f40427ca 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -632,7 +632,7 @@ int readfile(char *fname, char *sfname, linenr_T from, linenr_T lines_to_skip, } if (aborting()) { // autocmds may abort script processing - --no_wait_return; + no_wait_return--; msg_scroll = msg_save; curbuf->b_p_ro = TRUE; // must use "w!" now return FAIL; @@ -1197,11 +1197,11 @@ retry: } // Deal with a bad byte and continue with the next. - ++fromp; - --from_size; + fromp++; + from_size--; if (bad_char_behavior == BAD_KEEP) { *top++ = *(fromp - 1); - --to_size; + to_size--; } else if (bad_char_behavior != BAD_DROP) { *top++ = (char)bad_char_behavior; to_size--; @@ -1239,7 +1239,7 @@ retry: // Check for a trailing incomplete UTF-8 sequence tail = ptr + size - 1; while (tail > ptr && (*tail & 0xc0) == 0x80) { - --tail; + tail--; } if (tail + utf_byte2len(*tail) <= ptr + size) { tail = NULL; @@ -1557,7 +1557,7 @@ rewind_retry: * Keep it fast! */ if (fileformat == EOL_MAC) { - --ptr; + ptr--; while (++ptr, --size >= 0) { // catch most common case first if ((c = *ptr) != NUL && c != CAR && c != NL) { @@ -1578,20 +1578,20 @@ rewind_retry: if (read_undo_file) { sha256_update(&sha_ctx, (char_u *)line_start, (size_t)len); } - ++lnum; + lnum++; if (--read_count == 0) { error = true; // break loop line_start = ptr; // nothing left to write break; } } else { - --skip_count; + skip_count--; } line_start = ptr + 1; } } } else { - --ptr; + ptr--; while (++ptr, --size >= 0) { if ((c = *ptr) != NUL && c != NL) { // catch most common case continue; @@ -1634,14 +1634,14 @@ rewind_retry: if (read_undo_file) { sha256_update(&sha_ctx, (char_u *)line_start, (size_t)len); } - ++lnum; + lnum++; if (--read_count == 0) { error = true; // break loop line_start = ptr; // nothing left to write break; } } else { - --skip_count; + skip_count--; } line_start = ptr + 1; } @@ -2000,7 +2000,7 @@ static linenr_T readfile_linenr(linenr_T linecnt, char_u *p, char_u *endp) lnum = curbuf->b_ml.ml_line_count - linecnt + 1; for (s = p; s < endp; ++s) { if (*s == '\n') { - ++lnum; + lnum++; } } return lnum; @@ -2478,7 +2478,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en } else { // less lines end -= old_line_count - buf->b_ml.ml_line_count; if (end < start) { - --no_wait_return; + no_wait_return--; msg_scroll = msg_save; emsg(_("E204: Autocommand changed number of lines in unexpected way")); return FAIL; @@ -4820,8 +4820,8 @@ int check_timestamps(int focus) } } } - --no_wait_return; - need_check_timestamps = FALSE; + no_wait_return--; + need_check_timestamps = false; if (need_wait_return && didit == 2) { // make sure msg isn't overwritten msg_puts("\n"); @@ -5681,7 +5681,7 @@ char *file_pat_to_reg_pat(const char *pat, const char *pat_end, char *allow_dirs reg_pat[i++] = '.'; reg_pat[i++] = '*'; while (p[1] == '*') { // "**" matches like "*" - ++p; + p++; } break; case '.': @@ -5769,7 +5769,7 @@ char *file_pat_to_reg_pat(const char *pat, const char *pat_end, char *allow_dirs case '}': reg_pat[i++] = '\\'; reg_pat[i++] = ')'; - --nested; + nested--; break; case ',': if (nested) { diff --git a/src/nvim/fold.c b/src/nvim/fold.c index b02c12c7cb..5f4509647e 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -863,7 +863,7 @@ int foldMoveTo(const bool updown, const int dir, const long count) if (fp - (fold_T *)gap->ga_data >= gap->ga_len) { break; } - --fp; + fp--; } else { if (fp == (fold_T *)gap->ga_data) { break; @@ -1793,7 +1793,7 @@ static void foldtext_cleanup(char_u *str) char_u *cms_start = (char_u *)skipwhite((char *)curbuf->b_p_cms); size_t cms_slen = STRLEN(cms_start); while (cms_slen > 0 && ascii_iswhite(cms_start[cms_slen - 1])) { - --cms_slen; + cms_slen--; } // locate "%s" in 'commentstring', use the part before and after it. @@ -1805,7 +1805,7 @@ static void foldtext_cleanup(char_u *str) // exclude white space before "%s" while (cms_slen > 0 && ascii_iswhite(cms_start[cms_slen - 1])) { - --cms_slen; + cms_slen--; } // skip "%s" and white space after it diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index cd45691a0c..6dfca06279 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1338,7 +1338,7 @@ static void closescript(void) file_free(scriptin[curscript], false); scriptin[curscript] = NULL; if (curscript > 0) { - --curscript; + curscript--; } } @@ -2396,7 +2396,7 @@ static int vgetorpeek(bool advance) return NUL; } - ++vgetc_busy; + vgetc_busy++; if (advance) { KeyStuffed = FALSE; @@ -2783,7 +2783,7 @@ static int vgetorpeek(bool advance) gotchars(nop_buf, 3); } - --vgetc_busy; + vgetc_busy--; return c; } diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index 0be45ec9ae..9c522e11d8 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -350,7 +350,7 @@ static char *parse_list_options(char_u *option_str, option_table_T *table, size_ stringp = (char_u *)commap; if (*stringp == ',') { - ++stringp; + stringp++; } } @@ -837,7 +837,7 @@ void ex_hardcopy(exarg_T *eap) } } if (settings.duplex && prtpos.file_line <= eap->line2) { - ++page_count; + page_count++; } // Remember the position where the next page starts. diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c index cdd746d17d..689d1fce0d 100644 --- a/src/nvim/if_cscope.c +++ b/src/nvim/if_cscope.c @@ -663,7 +663,7 @@ static char *cs_create_cmd(char *csoption, char *pattern) pat = pattern; if (search != 4 && search != 6) { while (ascii_iswhite(*pat)) { - ++pat; + pat++; } } diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index 8edff55821..34a3de4f78 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -317,17 +317,17 @@ static bool cin_has_js_key(const char_u *text) if (*s == '\'' || *s == '"') { // can be 'key': or "key": quote = *s; - ++s; + s++; } if (!vim_isIDc(*s)) { // need at least one ID character return false; } while (vim_isIDc(*s)) { - ++s; + s++; } if (*s && *s == quote) { - ++s; + s++; } s = cin_skipcomment(s); @@ -1768,7 +1768,7 @@ void parse_cino(buf_T *buf) n += (sw * fraction + divider / 2) / divider; } } - ++p; + p++; } if (l[1] == '-') { n = -n; @@ -3334,7 +3334,7 @@ int get_c_indent(void) amount += curbuf->b_ind_open_extra; } } - ++whilelevel; + whilelevel++; } /* * We are after a "normal" statement. @@ -3848,7 +3848,7 @@ static int find_match(int lookfor, linenr_T ourscope) * another "do", so increment whilelevel. XXX */ if (cin_iswhileofdo(look, curwin->w_cursor.lnum)) { - ++whilelevel; + whilelevel++; continue; } diff --git a/src/nvim/main.c b/src/nvim/main.c index 69d05d15e5..7de91cb06f 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -1245,8 +1245,8 @@ static void command_line_scan(mparm_T *parmp) } else if (argv[0][0] == '-') { // "-S" followed by another option: use default session file. a = SESSION_FILE; - ++argc; - --argv; + argc++; + argv--; } else { a = argv[0]; } @@ -1616,9 +1616,9 @@ static void create_windows(mparm_T *parmp) // Watch out for autocommands that delete a window. // // Don't execute Win/Buf Enter/Leave autocommands here - ++autocmd_no_enter; - ++autocmd_no_leave; - dorewind = TRUE; + autocmd_no_enter++; + autocmd_no_leave++; + dorewind = true; while (done++ < 1000) { if (dorewind) { if (parmp->window_layout == WIN_TABS) { @@ -1680,8 +1680,8 @@ static void create_windows(mparm_T *parmp) curwin = firstwin; } curbuf = curwin->w_buffer; - --autocmd_no_enter; - --autocmd_no_leave; + autocmd_no_enter--; + autocmd_no_leave--; } } @@ -1698,8 +1698,8 @@ static void edit_buffers(mparm_T *parmp, char_u *cwd) /* * Don't execute Win/Buf Enter/Leave autocommands here */ - ++autocmd_no_enter; - ++autocmd_no_leave; + autocmd_no_enter++; + autocmd_no_leave++; // When w_arg_idx is -1 remove the window (see create_windows()). if (curwin->w_arg_idx == -1) { @@ -1785,7 +1785,7 @@ static void edit_buffers(mparm_T *parmp, char_u *cwd) if (parmp->window_layout == WIN_TABS) { goto_tabpage(1); } - --autocmd_no_enter; + autocmd_no_enter--; // make the first window the current window win = firstwin; @@ -1799,7 +1799,7 @@ static void edit_buffers(mparm_T *parmp, char_u *cwd) } win_enter(win, false); - --autocmd_no_leave; + autocmd_no_leave--; TIME_MSG("editing files in windows"); if (parmp->window_count > 1 && parmp->window_layout != WIN_TABS) { win_equal(curwin, false, 'b'); // adjust heights diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 53bbaab694..ca5a3ddbbf 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -1605,7 +1605,7 @@ void show_utf8(void) } sprintf((char *)IObuff + rlen, "%02x ", (line[i] == NL) ? NUL : line[i]); // NUL is stored as NL - --clen; + clen--; rlen += (int)STRLEN(IObuff + rlen); if (rlen > IOSIZE - 20) { break; @@ -1638,7 +1638,7 @@ int utf_head_off(const char_u *base, const char_u *p) // Move q to the first byte of this char. while (q > base && (*q & 0xc0) == 0x80) { - --q; + q--; } // Check for illegal sequence. Do allow an illegal byte after where we // started. @@ -1659,10 +1659,10 @@ int utf_head_off(const char_u *base, const char_u *p) if (arabic_maycombine(c)) { // Advance to get a sneak-peak at the next char const char_u *j = q; - --j; + j--; // Move j to the first byte of this char. while (j > base && (*j & 0xc0) == 0x80) { - --j; + j--; } if (arabic_combine(utf_ptr2char((char *)j), c)) { continue; diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 8b8f709396..05960ac1b6 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -1136,7 +1136,7 @@ void ml_recover(bool checkext) if (txt_start <= (int)HEADER_SIZE || txt_start >= (int)dp->db_txt_end) { p = (char_u *)"???"; - ++error; + error++; } else { p = (char_u *)dp + txt_start; } @@ -1205,10 +1205,10 @@ void ml_recover(bool checkext) if (got_int) { emsg(_("E311: Recovery Interrupted")); } else if (error) { - ++no_wait_return; + no_wait_return++; msg(">>>>>>>>>>>>>"); emsg(_("E312: Errors detected while recovering; look for lines starting with ???")); - --no_wait_return; + no_wait_return--; msg(_("See \":help E312\" for more information.")); msg(">>>>>>>>>>>>>"); } else { @@ -1655,12 +1655,12 @@ static int recov_file_names(char **names, char_u *path, int prepend_dot) p += i; // file name has been expanded to full path } if (STRCMP(p, names[num_names]) != 0) { - ++num_names; + num_names++; } else { xfree(names[num_names]); } } else { - ++num_names; + num_names++; } return num_names; @@ -2179,7 +2179,7 @@ static int ml_append_int(buf_T *buf, linenr_T lnum, char_u *line, colnr_T len, b memmove((char *)dp_right + dp_right->db_txt_start, line, (size_t)len); - ++line_count_right; + line_count_right++; } /* * may move lines from the left/old block to the right/new one. @@ -2219,7 +2219,7 @@ static int ml_append_int(buf_T *buf, linenr_T lnum, char_u *line, colnr_T len, b } memmove((char *)dp_left + dp_left->db_txt_start, line, (size_t)len); - ++line_count_left; + line_count_left++; } if (db_idx < 0) { // left block is new @@ -2993,9 +2993,9 @@ static bhdr_T *ml_find_line(buf_T *buf, linenr_T lnum, int action) * update high for insert/delete */ if (action == ML_INSERT) { - ++high; + high++; } else if (action == ML_DELETE) { - --high; + high--; } dp = hp->bh_data; @@ -3299,7 +3299,7 @@ static void attention_message(buf_T *buf, char_u *fname) { assert(buf->b_fname != NULL); - ++no_wait_return; + no_wait_return++; (void)emsg(_("E325: ATTENTION")); msg_puts(_("\nFound a swap file by the name \"")); msg_home_replace(fname); @@ -3334,7 +3334,7 @@ static void attention_message(buf_T *buf, char_u *fname) msg_outtrans((char *)fname); msg_puts(_("\"\n to avoid this message.\n")); cmdline_row = msg_row; - --no_wait_return; + no_wait_return--; } /// Trigger the SwapExists autocommands. diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 1aa1fb5f5a..9cb9503b3c 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -952,7 +952,7 @@ char *set_context_in_menu_cmd(expand_T *xp, const char *cmd, char *arg, bool for } while (*p != NUL && ascii_iswhite(*p)) { - ++p; + p++; } arg = after_dot = p; @@ -1807,9 +1807,9 @@ static char *menu_skip_part(char *p) { while (*p != NUL && *p != '.' && !ascii_iswhite(*p)) { if ((*p == '\\' || *p == Ctrl_V) && p[1] != NUL) { - ++p; + p++; } - ++p; + p++; } return p; } diff --git a/src/nvim/message.c b/src/nvim/message.c index 6910fc16ae..9041ef8d5c 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -319,7 +319,7 @@ bool msg_attr_keep(const char *s, int attr, bool keep, bool multiline) if (entered >= 3) { return TRUE; } - ++entered; + entered++; // Add message to history (unless it's a repeated kept message or a // truncated message) @@ -356,7 +356,7 @@ bool msg_attr_keep(const char *s, int attr, bool keep, bool multiline) need_fileinfo = false; xfree(buf); - --entered; + entered--; return retval; } @@ -1015,7 +1015,7 @@ int delete_first_msg(void) xfree(p->msg); hl_msg_free(p->multiattr); xfree(p); - --msg_hist_len; + msg_hist_len--; return OK; } @@ -1980,13 +1980,13 @@ static char_u *screen_puts_mbyte(char_u *s, int l, int attr) msg_col -= cw; if (msg_col == 0) { msg_col = Columns; - ++msg_row; + msg_row++; } } else { msg_col += cw; if (msg_col >= Columns) { msg_col = 0; - ++msg_row; + msg_row++; } } return s + l; @@ -2239,7 +2239,7 @@ static void msg_puts_display(const char_u *str, int maxlen, int attr, int recurs * for a character. */ if (lines_left > 0) { - --lines_left; + lines_left--; } if (p_more && lines_left == 0 && State != MODE_HITRETURN && !msg_no_more && !exmode_active) { @@ -2288,7 +2288,7 @@ static void msg_puts_display(const char_u *str, int maxlen, int attr, int recurs msg_col = 0; } else if (*s == '\b') { // go to previous char if (msg_col) { - --msg_col; + msg_col--; } } else if (*s == TAB) { // translate Tab into spaces do { @@ -2322,7 +2322,7 @@ static void msg_puts_display(const char_u *str, int maxlen, int attr, int recurs s += l - 1; } } - ++s; + s++; } // Output any postponed text. @@ -2670,7 +2670,7 @@ static msgchunk_T *disp_sb_line(int row, msgchunk_T *smp) msg_col = mp->sb_msg_col; p = mp->sb_text; if (*p == '\n') { // don't display the line break - ++p; + p++; } msg_puts_display(p, -1, mp->sb_attr, TRUE); if (mp->sb_eol || mp->sb_next == NULL) { @@ -2699,7 +2699,7 @@ static void t_puts(int *t_col, const char_u *t_s, const char_u *s, int attr) } if (msg_col >= Columns) { msg_col = 0; - ++msg_row; + msg_row++; } } @@ -2954,7 +2954,7 @@ static int do_more_prompt(int typed_char) HL_ATTR(HLF_MSG)); for (i = 0; mp != NULL && i < Rows - 1; i++) { mp = disp_sb_line(i, mp); - ++msg_scrolled; + msg_scrolled++; } to_redraw = false; } @@ -3053,12 +3053,12 @@ static void msg_screen_putchar(int c, int attr) if (cmdmsg_rl) { if (--msg_col == 0) { msg_col = Columns; - ++msg_row; + msg_row++; } } else { if (++msg_col >= Columns) { msg_col = 0; - ++msg_row; + msg_row++; } } } @@ -3355,7 +3355,7 @@ int redirecting(void) void verbose_enter(void) { if (*p_vfile != NUL) { - ++msg_silent; + msg_silent++; } } @@ -3374,7 +3374,7 @@ void verbose_leave(void) void verbose_enter_scroll(void) { if (*p_vfile != NUL) { - ++msg_silent; + msg_silent++; } else { // always scroll up, don't overwrite msg_scroll = TRUE; @@ -3536,7 +3536,7 @@ int do_dialog(int type, char_u *title, char_u *message, char_u *buttons, int dfl * Since we wait for a keypress, don't make the * user press RETURN as well afterwards. */ - ++no_wait_return; + no_wait_return++; hotkeys = msg_show_console_dialog(message, buttons, dfltbutton); for (;;) { @@ -3585,7 +3585,7 @@ int do_dialog(int type, char_u *title, char_u *message, char_u *buttons, int dfl msg_silent = save_msg_silent; State = oldState; setmouse(); - --no_wait_return; + no_wait_return--; msg_end_prompt(); return retval; @@ -3739,7 +3739,7 @@ static void copy_hotkeys_and_msg(const char_u *message, char_u *buttons, int def } } else if (*r == DLG_HOTKEY_CHAR || first_hotkey) { if (*r == DLG_HOTKEY_CHAR) { - ++r; + r++; } first_hotkey = false; diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index a4a521fa80..41afc71a14 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -386,7 +386,7 @@ retnomove: count = 0; for (first = true; curwin->w_topline < curbuf->b_ml.ml_line_count;) { if (curwin->w_topfill > 0) { - ++count; + count++; } else { count += plines_win(curwin, curwin->w_topline, true); } @@ -514,7 +514,7 @@ bool mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump) break; // past end of file } row -= count; - ++lnum; + lnum++; } if (!retval) { diff --git a/src/nvim/move.c b/src/nvim/move.c index 6d4eb8ef49..3b95e59e8c 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -1056,7 +1056,7 @@ bool scrolldown(long line_count, int byfold) // A sequence of folded lines only counts for one logical line linenr_T first; if (hasFolding(curwin->w_topline, &first, NULL)) { - ++done; + done++; if (!byfold) { line_count -= curwin->w_topline - first - 1; } @@ -1092,7 +1092,7 @@ bool scrolldown(long line_count, int byfold) while (wrow >= curwin->w_height_inner && curwin->w_cursor.lnum > 1) { linenr_T first; if (hasFolding(curwin->w_cursor.lnum, &first, NULL)) { - --wrow; + wrow--; if (first == 1) { curwin->w_cursor.lnum = 1; } else { @@ -1406,8 +1406,8 @@ void scroll_cursor_top(int min_scroll, int always) } if (hasFolding(curwin->w_cursor.lnum, &top, &bot)) { - --top; - ++bot; + top--; + bot++; } else { top = curwin->w_cursor.lnum - 1; bot = curwin->w_cursor.lnum + 1; @@ -1453,8 +1453,8 @@ void scroll_cursor_top(int min_scroll, int always) extra += i; new_topline = top; - --top; - ++bot; + top--; + bot++; } /* @@ -1664,7 +1664,7 @@ void scroll_cursor_bot(int min_scroll, int set_topbot) for (i = 0; i < scrolled && boff.lnum < curwin->w_botline;) { botline_forw(curwin, &boff); i += boff.height; - ++line_count; + line_count++; } if (i < scrolled) { // below curwin->w_botline, don't scroll line_count = 9999; @@ -1726,7 +1726,7 @@ void scroll_cursor_halfway(int atend) } else { ++below; // count a "~" line if (atend) { - ++used; + used++; } } } @@ -1835,7 +1835,7 @@ void cursor_correct(void) if (topline < botline) { above += win_get_fill(curwin, topline + 1); } - ++topline; + topline++; } } if (topline == botline || botline == 0) { diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 55bffe6fc5..77400531b4 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1927,8 +1927,8 @@ static int op_replace(oparg_T *oap, int c) // times. if (utf_char2cells(c) > 1) { if ((numc & 1) && !bd.is_short) { - ++bd.endspaces; - ++n; + bd.endspaces++; + n++; } numc = numc / 2; } @@ -3104,7 +3104,7 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) if (y_array != NULL) { *ptr = NUL; } - ++ptr; + ptr++; // A trailing '\n' makes the register linewise. if (*ptr == NUL) { y_type = kMTLineWise; @@ -3442,12 +3442,9 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) } } curbuf->b_op_start = curwin->w_cursor; - } - /* - * Line mode: BACKWARD is the same as FORWARD on the previous line - */ - else if (dir == BACKWARD) { - --lnum; + } else if (dir == BACKWARD) { + // Line mode: BACKWARD is the same as FORWARD on the previous line + lnum--; } new_cursor = curwin->w_cursor; @@ -3586,7 +3583,7 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) new_lnum++; } lnum++; - ++nr_lines; + nr_lines++; if (flags & PUT_FIXINDENT) { old_pos = curwin->w_cursor; curwin->w_cursor.lnum = lnum; @@ -4001,7 +3998,7 @@ char_u *skip_comment(char_u *line, bool process, bool include_space, bool *is_co || *comment_flags == ':') { break; } - ++comment_flags; + comment_flags++; } // If we found a colon, it means that we are not processing a line @@ -4285,7 +4282,7 @@ static int same_leader(linenr_T lnum, int leader1_len, char_u *leader1_flags, in } } else { while (ascii_iswhite(line1[idx1])) { - ++idx1; + idx1++; } } } @@ -4698,7 +4695,7 @@ static int fmt_check_par(linenr_T lnum, int *leader_len, char_u **leader_flags, */ flags = *leader_flags; while (*flags && *flags != ':' && *flags != COM_END) { - ++flags; + flags++; } } diff --git a/src/nvim/path.c b/src/nvim/path.c index 15b67cf35b..caea11debd 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -227,7 +227,7 @@ char_u *get_past_head(const char_u *path) #endif while (vim_ispathsep(*retval)) { - ++retval; + retval++; } return (char_u *)retval; @@ -666,8 +666,8 @@ static size_t do_path_expand(garray_T *gap, const char_u *path, size_t wildoff, for (p = buf + wildoff; p < s; ++p) { if (rem_backslash(p)) { STRMOVE(p, p + 1); - --e; - --s; + e--; + s--; } } @@ -695,11 +695,11 @@ static size_t do_path_expand(garray_T *gap, const char_u *path, size_t wildoff, regmatch.rm_ic = true; // Always ignore case on Windows. #endif if (flags & (EW_NOERROR | EW_NOTWILD)) { - ++emsg_silent; + emsg_silent++; } regmatch.regprog = vim_regcomp(pat, RE_MAGIC); if (flags & (EW_NOERROR | EW_NOTWILD)) { - --emsg_silent; + emsg_silent--; } xfree(pat); @@ -742,9 +742,9 @@ static size_t do_path_expand(garray_T *gap, const char_u *path, size_t wildoff, * find matches. */ STRCPY(buf + len, "/**"); STRCPY(buf + len + 3, path_end); - ++stardepth; + stardepth++; (void)do_path_expand(gap, buf, len + 1, flags, true); - --stardepth; + stardepth--; } STRCPY(buf + len, path_end); @@ -1401,7 +1401,7 @@ static int expand_backtick(garray_T *gap, char_u *pat, int flags) cmd = skipwhite(cmd); // skip over white space p = cmd; while (*p != NUL && *p != '\r' && *p != '\n') { // skip over entry - ++p; + p++; } // add an entry if it is not empty if (p > cmd) { @@ -1409,11 +1409,11 @@ static int expand_backtick(garray_T *gap, char_u *pat, int flags) *p = NUL; addfile(gap, (char_u *)cmd, flags); *p = i; - ++cnt; + cnt++; } cmd = p; while (*cmd != NUL && (*cmd == '\r' || *cmd == '\n')) { - ++cmd; + cmd++; } } @@ -1656,12 +1656,12 @@ void simplify_filename(char_u *filename) *p = NUL; } else { if (p > start && tail[-1] == '.') { - --p; + p--; } STRMOVE(p, tail); // strip previous component } - --components; + components--; } } else if (p == start && !relative) { // leading "/.." or "/../" STRMOVE(p, tail); // strip ".." or "../" diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 4d0bf03d8b..b7ec4bf94e 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -821,7 +821,7 @@ static int64_t gethexchrs(int maxinputlen) } nr <<= 4; nr |= hex2nr(c); - ++regparse; + regparse++; } if (i == 0) { @@ -878,7 +878,7 @@ static int64_t getoctchrs(void) } nr <<= 3; nr |= hex2nr(c); - ++regparse; + regparse++; } if (i == 0) { @@ -2095,8 +2095,8 @@ static int vim_regsub_both(char_u *source, typval_T *expr, char_u *dest, int des dst++; } - ++s; - --len; + s++; + len--; } } } diff --git a/src/nvim/regexp_bt.c b/src/nvim/regexp_bt.c index f79a772795..769d2ceeef 100644 --- a/src/nvim/regexp_bt.c +++ b/src/nvim/regexp_bt.c @@ -2189,7 +2189,7 @@ collection: while (*regparse != NUL && *regparse != ']') { if (*regparse == '-') { - ++regparse; + regparse++; // The '-' is not used for a range at the end and // after or before a '\n'. if (*regparse == ']' || *regparse == NUL @@ -2619,7 +2619,7 @@ static char_u *regpiece(int *flagp) regoptail(ret, regnode(BACK)); regoptail(ret, ret); reginsert_limits(BRACE_LIMITS, minval, maxval, ret); - ++num_complex_braces; + num_complex_braces++; } if (minval > 0 && maxval > 0) { *flagp = (HASWIDTH | (flags & (HASNL | HASLOOKBH))); @@ -2792,7 +2792,7 @@ static char_u *reg(int paren, int *flagp) EMSG2_RET_NULL(_("E51: Too many %s("), reg_magic == MAGIC_ALL); } parno = regnpar; - ++regnpar; + regnpar++; ret = regnode(MOPEN + parno); } else if (paren == REG_NPAREN) { // Make a NOPEN node. @@ -3181,7 +3181,7 @@ static int regrepeat(char_u *p, long maxcount) } else { break; } - ++count; + count++; } break; @@ -3299,7 +3299,7 @@ do_class: } else { break; } - ++count; + count++; } break; @@ -3415,7 +3415,7 @@ do_class: break; } scan += len; - ++count; + count++; } } } @@ -3453,7 +3453,7 @@ do_class: } scan++; } - ++count; + count++; } break; diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 7f16373280..554def5b8a 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -5488,7 +5488,7 @@ static void nfa_save_listids(nfa_regprog_T *prog, int *list) for (i = prog->nstate; --i >= 0;) { list[i] = p->lastlist[1]; p->lastlist[1] = 0; - ++p; + p++; } } @@ -5503,7 +5503,7 @@ static void nfa_restore_listids(nfa_regprog_T *prog, int *list) p = &prog->state[0]; for (i = prog->nstate; --i >= 0;) { p->lastlist[1] = list[i]; - ++p; + p++; } } diff --git a/src/nvim/search.c b/src/nvim/search.c index 94ec26e709..18838f00d5 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -515,7 +515,7 @@ void last_pat_prog(regmmatch_T *regmatch) } ++emsg_off; // So it doesn't beep if bad expr (void)search_regcomp((char_u *)"", 0, last_idx, SEARCH_KEEP, regmatch); - --emsg_off; + emsg_off--; } /// Lowest level search function. @@ -1162,9 +1162,9 @@ int do_search(oparg_T *oap, int dirc, int search_delim, char_u *pat, long count, } else { // single '+' spats[0].off.off = 1; } - ++p; + p++; while (ascii_isdigit(*p)) { // skip number - ++p; + p++; } } @@ -1428,7 +1428,7 @@ int do_search(oparg_T *oap, int dirc, int search_delim, char_u *pat, long count, emsg(_("E386: Expected '?' or '/' after ';'")); goto end_do_search; } - ++pat; + pat++; } if (options & SEARCH_MARK) { @@ -2138,10 +2138,10 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel) } if (*ptr == '"' && (ptr == linep || ptr[-1] != '\'' || ptr[1] != '\'')) { - ++do_quotes; + do_quotes++; } if (*ptr == '\\' && ptr[1] != NUL) { - ++ptr; + ptr++; } } do_quotes &= 1; // result is 1 with even number of quotes @@ -2344,7 +2344,7 @@ int check_linecomment(const char_u *line) && !is_pos_in_string(line, (colnr_T)(p - line))) { break; } - ++p; + p++; } } @@ -2631,7 +2631,7 @@ bool findpar(bool *pincl, int dir, long count, int what, int both) } setpcmark(); if (both && *ml_get(curr) == '}') { // include line with '}' - ++curr; + curr++; } curwin->w_cursor.lnum = curr; if (curr == curbuf->b_ml.ml_line_count && what != '}') { @@ -2669,7 +2669,7 @@ static int inmacro(char_u *opt, char_u *s) && (s[0] == NUL || s[1] == NUL || s[1] == ' ')))) { break; } - ++macro; + macro++; if (macro[0] == NUL) { break; } @@ -3112,7 +3112,7 @@ int current_word(oparg_T *oap, long count, int include, int bigword) oap->start = start_pos; oap->motion_type = kMTCharWise; } - --count; + count--; } /* @@ -3162,7 +3162,7 @@ int current_word(oparg_T *oap, long count, int include, int bigword) } } } - --count; + count--; } if (include_white && (cls() != 0 @@ -3325,7 +3325,7 @@ extend: } else { ncount = count; if (start_blank) { - --ncount; + ncount--; } } if (ncount > 0) { @@ -3853,7 +3853,7 @@ extend: break; } } - --start_lnum; + start_lnum--; } /* @@ -3861,13 +3861,13 @@ extend: */ end_lnum = start_lnum; while (end_lnum <= curbuf->b_ml.ml_line_count && linewhite(end_lnum)) { - ++end_lnum; + end_lnum++; } end_lnum--; i = (int)count; if (!include && white_in_front) { - --i; + i--; } while (i--) { if (end_lnum == curbuf->b_ml.ml_line_count) { @@ -3879,14 +3879,12 @@ extend: } if (include || !do_white) { - ++end_lnum; - /* - * skip to end of paragraph - */ + end_lnum++; + // skip to end of paragraph while (end_lnum < curbuf->b_ml.ml_line_count && !linewhite(end_lnum + 1) && !startPS(end_lnum + 1, 0, 0)) { - ++end_lnum; + end_lnum++; } } @@ -3900,7 +3898,7 @@ extend: if (include || do_white) { while (end_lnum < curbuf->b_ml.ml_line_count && linewhite(end_lnum + 1)) { - ++end_lnum; + end_lnum++; } } } @@ -3911,7 +3909,7 @@ extend: */ if (!white_in_front && !linewhite(end_lnum) && include) { while (start_lnum > 1 && linewhite(start_lnum - 1)) { - --start_lnum; + start_lnum--; } } @@ -3985,7 +3983,7 @@ static int find_prev_quote(char_u *line, int col_start, int quotechar, char_u *e if (escape != NULL) { while (col_start - n > 0 && vim_strchr((char *)escape, line[col_start - n - 1]) != NULL) { - ++n; + n++; } } if (n & 1) { @@ -4171,11 +4169,11 @@ bool current_quote(oparg_T *oap, long count, bool include, int quotechar) if (include) { if (ascii_iswhite(line[col_end + 1])) { while (ascii_iswhite(line[col_end + 1])) { - ++col_end; + col_end++; } } else { while (col_start > 0 && ascii_iswhite(line[col_start - 1])) { - --col_start; + col_start--; } } } @@ -5469,7 +5467,7 @@ void find_pattern_in_path(char_u *ptr, Direction dir, size_t len, bool whole, bo } did_show = true; while (depth_displayed < depth && !got_int) { - ++depth_displayed; + depth_displayed++; for (i = 0; i < depth_displayed; i++) { msg_puts(" "); } @@ -5511,11 +5509,11 @@ void find_pattern_in_path(char_u *ptr, Direction dir, size_t len, bool whole, bo // Avoid checking before the start of the line, can // happen if \zs appears in the regexp. if (p[-1] == '"' || p[-1] == '<') { - --p; - ++i; + p--; + i++; } if (p[i] == '"' || p[i] == '>') { - ++i; + i++; } } save_char = p[i]; @@ -5563,7 +5561,7 @@ void find_pattern_in_path(char_u *ptr, Direction dir, size_t len, bool whole, bo // Something wrong. We will forget one of our already visited files // now. xfree(files[old_files].name); - ++old_files; + old_files++; } files[depth].name = curr_fname = new_fname; files[depth].lnum = 0; @@ -5862,7 +5860,7 @@ exit_matched: while (depth >= 0 && !already && vim_fgets(line = file_line, LSIZE, files[depth].fp)) { fclose(files[depth].fp); - --old_files; + old_files--; files[old_files].name = files[depth].name; files[old_files].matched = files[depth].matched; depth--; @@ -5950,10 +5948,10 @@ static void show_pat_in_path(char_u *line, int type, bool did_show, int action, if (fp != NULL) { // We used fgets(), so get rid of newline at end if (p >= line && *p == '\n') { - --p; + p--; } if (p >= line && *p == '\r') { - --p; + p--; } *(p + 1) = NUL; } diff --git a/src/nvim/spell.c b/src/nvim/spell.c index ed2b8bbdb5..c22a83fbb1 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -491,13 +491,13 @@ static void find_word(matchinf_T *mip, int mode) } endlen[endidxcnt] = wlen; endidx[endidxcnt++] = arridx++; - --len; + len--; // Skip over the zeros, there can be several flag/region // combinations. while (len > 0 && byts[arridx] == 0) { - ++arridx; - --len; + arridx++; + len--; } if (len == 0) { break; // no children, word must end here @@ -535,8 +535,8 @@ static void find_word(matchinf_T *mip, int mode) // Continue at the child (if there is one). arridx = idxs[lo]; - ++wlen; - --flen; + wlen++; + flen--; // One space in the good word may stand for several spaces in the // checked word. @@ -548,8 +548,8 @@ static void find_word(matchinf_T *mip, int mode) if (ptr[wlen] != ' ' && ptr[wlen] != TAB) { break; } - ++wlen; - --flen; + wlen++; + flen--; } } } @@ -560,7 +560,7 @@ static void find_word(matchinf_T *mip, int mode) // Verify that one of the possible endings is valid. Try the longest // first. while (endidxcnt > 0) { - --endidxcnt; + endidxcnt--; arridx = endidx[endidxcnt]; wlen = endlen[endidxcnt]; @@ -980,7 +980,7 @@ bool match_compoundrule(slang_T *slang, char_u *compflags) bool match = false; // compare against all the flags in [] - ++p; + p++; while (*p != ']' && *p != NUL) { if (*p++ == c) { match = true; @@ -992,7 +992,7 @@ bool match_compoundrule(slang_T *slang, char_u *compflags) } else if (*p != c) { break; // flag of word doesn't match flag in pattern } - ++p; + p++; } // Skip to the next "/", where the next pattern starts. @@ -1108,8 +1108,8 @@ static void find_prefix(matchinf_T *mip, int mode) mip->mi_prefarridx = arridx; mip->mi_prefcnt = len; while (len > 0 && byts[arridx] == 0) { - ++arridx; - --len; + arridx++; + len--; } mip->mi_prefcnt -= len; @@ -1158,8 +1158,8 @@ static void find_prefix(matchinf_T *mip, int mode) // Continue at the child (if there is one). arridx = idxs[lo]; - ++wlen; - --flen; + wlen++; + flen--; } } @@ -1407,7 +1407,7 @@ size_t spell_move_to(win_T *wp, int dir, bool allwords, bool curline, hlf_T *att capcol = -1; } else { if (lnum < wp->w_buffer->b_ml.ml_line_count) { - ++lnum; + lnum++; } else if (!p_ws) { break; // at first line and 'nowrapscan' } else { @@ -1435,7 +1435,7 @@ size_t spell_move_to(win_T *wp, int dir, bool allwords, bool curline, hlf_T *att } // Capcol skips over the inserted space. - --capcol; + capcol--; // But after empty line check first word in next line if (empty_line) { @@ -1810,7 +1810,7 @@ static int count_syllables(slang_T *slang, const char_u *word) } } if (len != 0) { // found a match, count syllable - ++cnt; + cnt++; skip = false; } else { // No recognized syllable item, at least a syllable char then? @@ -2606,10 +2606,10 @@ void ex_spellrepall(exarg_T *eap) changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col); if (curwin->w_cursor.lnum != prev_lnum) { - ++sub_nlines; + sub_nlines++; prev_lnum = curwin->w_cursor.lnum; } - ++sub_nsubs; + sub_nsubs++; } curwin->w_cursor.col += (colnr_T)STRLEN(repl_to); } @@ -2900,12 +2900,12 @@ static void spell_soundfold_wsal(slang_T *slang, char_u *inword, char_u *res) if ((pf = smp[n].sm_oneof_w) != NULL) { // Check for match with one of the chars in "sm_oneof". while (*pf != NUL && *pf != word[i + k]) { - ++pf; + pf++; } if (*pf == NUL) { continue; } - ++k; + k++; } char_u *s = smp[n].sm_rules; pri = 5; // default priority @@ -2975,12 +2975,12 @@ static void spell_soundfold_wsal(slang_T *slang, char_u *inword, char_u *res) // Check for match with one of the chars in // "sm_oneof". while (*pf != NUL && *pf != word[i + k0]) { - ++pf; + pf++; } if (*pf == NUL) { continue; } - ++k0; + k0++; } p0 = 5; @@ -3284,7 +3284,7 @@ void spell_dump_compl(char_u *pat, int ic, Direction *dir, int dumpflags_arg) && (pat == NULL || !ins_compl_interrupted())) { if (curi[depth] > byts[arridx[depth]]) { // Done all bytes at this node, go up one level. - --depth; + depth--; line_breakcheck(); ins_compl_check_keys(50, false); } else { @@ -3317,7 +3317,7 @@ void spell_dump_compl(char_u *pat, int ic, Direction *dir, int dumpflags_arg) dump_word(slang, word, pat, dir, dumpflags, flags, lnum); if (pat == NULL) { - ++lnum; + lnum++; } } @@ -3342,7 +3342,7 @@ void spell_dump_compl(char_u *pat, int ic, Direction *dir, int dumpflags_arg) assert(depth >= 0); if (depth <= patlen && mb_strnicmp(word, pat, (size_t)depth) != 0) { - --depth; + depth--; } } } @@ -3480,7 +3480,7 @@ static linenr_T dump_prefixes(slang_T *slang, char_u *word, char_u *pat, Directi len = byts[n]; if (curi[depth] > len) { // Done all bytes at this node, go up one level. - --depth; + depth--; line_breakcheck(); } else { // Do one more byte at this node. @@ -3503,7 +3503,7 @@ static linenr_T dump_prefixes(slang_T *slang, char_u *word, char_u *pat, Directi (c & WF_RAREPFX) ? (flags | WF_RARE) : flags, lnum); if (lnum != 0) { - ++lnum; + lnum++; } } @@ -3519,7 +3519,7 @@ static linenr_T dump_prefixes(slang_T *slang, char_u *word, char_u *pat, Directi (c & WF_RAREPFX) ? (flags | WF_RARE) : flags, lnum); if (lnum != 0) { - ++lnum; + lnum++; } } } diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index 6994d4343d..fc35719000 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -840,7 +840,7 @@ static void tree_count_words(char_u *byts, idx_T *idxs) wordcount[depth - 1] += wordcount[depth]; } - --depth; + depth--; fast_breakcheck(); } else { // Do one more byte at this node. @@ -855,12 +855,12 @@ static void tree_count_words(char_u *byts, idx_T *idxs) // Skip over any other NUL bytes (same word with different // flags). while (byts[n + 1] == 0) { - ++n; - ++curi[depth]; + n++; + curi[depth]++; } } else { // Normal char, go one level deeper to count the words. - ++depth; + depth++; arridx[depth] = idxs[n]; curi[depth] = 1; wordcount[depth] = 0; @@ -1371,21 +1371,21 @@ static int read_compound(FILE *fd, slang_T *slang, int len) if (todo < 2) { return SP_FORMERROR; // need at least two bytes } - --todo; + todo--; c = getc(fd); // <compmax> if (c < 2) { c = MAXWLEN; } slang->sl_compmax = c; - --todo; + todo--; c = getc(fd); // <compminlen> if (c < 1) { c = 0; } slang->sl_compminlen = c; - --todo; + todo--; c = getc(fd); // <compsylmax> if (c < 1) { c = MAXWLEN; @@ -1396,9 +1396,9 @@ static int read_compound(FILE *fd, slang_T *slang, int len) if (c != 0) { ungetc(c, fd); // be backwards compatible with Vim 7.0b } else { - --todo; + todo--; c = getc(fd); // only use the lower byte for now - --todo; + todo--; slang->sl_compoptions = c; gap = &slang->sl_comppat; @@ -2065,7 +2065,7 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) // Read all the lines in the file one by one. while (!vim_fgets(rline, MAXLINELEN, fd) && !got_int) { line_breakcheck(); - ++lnum; + lnum++; // Skip comment lines. if (*rline == '#') { @@ -2092,7 +2092,7 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) itemcnt = 0; for (p = line;;) { while (*p != NUL && *p <= ' ') { // skip white space and CR/NL - ++p; + p++; } if (*p == NUL) { break; @@ -2104,11 +2104,11 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) // A few items have arbitrary text argument, don't split them. if (itemcnt == 2 && spell_info_item(items[0])) { while (*p >= ' ' || *p == TAB) { // skip until CR/NL - ++p; + p++; } } else { while (*p > ' ') { // skip until white space or CR/NL - ++p; + p++; } } if (*p == NUL) { @@ -2385,7 +2385,7 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) // Check for the "S" flag, which apparently means that another // block with the same affix name is following. if (itemcnt > lasti && STRCMP(items[lasti], "S") == 0) { - ++lasti; + lasti++; cur_aff->ah_follows = true; } else { cur_aff->ah_follows = false; @@ -2807,7 +2807,7 @@ static void aff_process_flags(afffile_T *affile, affentry_T *entry) } } if (affile->af_flagtype == AFT_NUM && *p == ',') { - ++p; + p++; } } if (*entry->ae_flags == NUL) { @@ -2943,7 +2943,7 @@ static void process_compflags(spellinfo_T *spin, afffile_T *aff, char_u *compfla *tp++ = (char_u)id; } if (aff->af_flagtype == AFT_NUM && *p == ',') { - ++p; + p++; } } } @@ -3070,7 +3070,7 @@ static void spell_free_aff(afffile_T *aff) todo = (int)ht->ht_used; for (hi = ht->ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { - --todo; + todo--; ah = HI2AH(hi); for (ae = ah->ah_first; ae != NULL; ae = ae->ae_next) { vim_regfree(ae->ae_prog); @@ -3140,7 +3140,7 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile) // the hashtable. while (!vim_fgets(line, MAXLINELEN, fd) && !got_int) { line_breakcheck(); - ++lnum; + lnum++; if (line[0] == '#' || line[0] == '/') { continue; // comment line } @@ -3148,7 +3148,7 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile) // the word is kept to allow multi-word terms like "et al.". l = (int)STRLEN(line); while (l > 0 && line[l - 1] <= ' ') { - --l; + l--; } if (l == 0) { continue; // empty line @@ -3184,7 +3184,7 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile) // Skip non-ASCII words when "spin->si_ascii" is true. if (spin->si_ascii && has_non_ascii(w)) { - ++non_ascii; + non_ascii++; xfree(pc); continue; } @@ -3225,7 +3225,7 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile) smsg(_("First duplicate word in %s line %d: %s"), fname, lnum, dw); } - ++duplicate; + duplicate++; } else { hash_add_item(&ht, hi, dw, hash); } @@ -3360,7 +3360,7 @@ static int get_pfxlist(afffile_T *affile, char_u *afflist, char_u *store_afflist } } if (affile->af_flagtype == AFT_NUM && *p == ',') { - ++p; + p++; } } @@ -3390,7 +3390,7 @@ static void get_compflags(afffile_T *affile, char_u *afflist, char_u *store_affl } } if (affile->af_flagtype == AFT_NUM && *p == ',') { - ++p; + p++; } } @@ -3436,7 +3436,7 @@ static int store_aff_word(spellinfo_T *spin, char_u *word, char_u *afflist, afff todo = (int)ht->ht_used; for (hi = ht->ht_array; todo > 0 && retval == OK; ++hi) { if (!HASHITEM_EMPTY(hi)) { - --todo; + todo--; ah = HI2AH(hi); // Check that the affix combines, if required, and that the word @@ -3684,7 +3684,7 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname) // Read all the lines in the file one by one. while (!vim_fgets(rline, MAXLINELEN, fd) && !got_int) { line_breakcheck(); - ++lnum; + lnum++; // Skip comment lines. if (*rline == '#') { @@ -3694,7 +3694,7 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname) // Remove CR, LF and white space from the end. l = (int)STRLEN(rline); while (l > 0 && rline[l - 1] <= ' ') { - --l; + l--; } if (l == 0) { continue; // empty or blank line @@ -3717,7 +3717,7 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname) } if (*line == '/') { - ++line; + line++; if (STRNCMP(line, "encoding=", 9) == 0) { if (spin->si_conv.vc_type != CONV_NONE) { smsg(_("Duplicate /encoding= line ignored in %s line %ld: %s"), @@ -3800,13 +3800,13 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname) fname, lnum, p); break; } - ++p; + p++; } } // Skip non-ASCII words when "spin->si_ascii" is true. if (spin->si_ascii && has_non_ascii(line)) { - ++non_ascii; + non_ascii++; continue; } @@ -4171,7 +4171,7 @@ static int deref_wordnode(spellinfo_T *spin, wordnode_T *node) cnt += deref_wordnode(spin, np->wn_child); } free_wordnode(spin, np); - ++cnt; + cnt++; } ++cnt; // length field } @@ -4246,7 +4246,7 @@ static long node_compress(spellinfo_T *spin, wordnode_T *node, hashtab_T *ht, lo // Note that with "child" we mean not just the node that is pointed to, // but the whole list of siblings of which the child node is the first. for (np = node; np != NULL && !got_int; np = np->wn_sibling) { - ++len; + len++; if ((child = np->wn_child) != NULL) { // Compress the child first. This fills hashkey. compressed += node_compress(spin, child, ht, tot); @@ -4579,7 +4579,7 @@ static int write_vim_spell(spellinfo_T *spin, char_u *fname) if (round == 2) { // <word> fwv &= fwrite(hi->hi_key, l, 1, fd); } - --todo; + todo--; } } if (round == 1) { @@ -4780,7 +4780,7 @@ static int put_node(FILE *fd, wordnode_T *node, int idx, int regionmask, bool pr // Count the number of siblings. int siblingcount = 0; for (wordnode_T *np = node; np != NULL; np = np->wn_sibling) { - ++siblingcount; + siblingcount++; } // Write the sibling count. @@ -5010,7 +5010,7 @@ static int sug_filltree(spellinfo_T *spin, slang_T *slang) wordcount[depth - 1] += wordcount[depth]; } - --depth; + depth--; line_breakcheck(); } else { // Do one more byte at this node. @@ -5031,8 +5031,8 @@ static int sug_filltree(spellinfo_T *spin, slang_T *slang) return FAIL; } - ++words_done; - ++wordcount[depth]; + words_done++; + wordcount[depth]++; // Reset the block count each time to avoid compression // kicking in. diff --git a/src/nvim/strings.c b/src/nvim/strings.c index dbd413c2d5..78312c738c 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -264,7 +264,7 @@ char_u *vim_strsave_shellescape(const char_u *string, bool do_special, bool do_n *d++ = '\\'; *d++ = '\''; *d++ = '\''; - ++p; + p++; continue; } if ((*p == '\n' && (csh_like || do_newline)) @@ -431,8 +431,8 @@ int vim_stricmp(const char *s1, const char *s2) if (*s1 == NUL) { break; // strings match until NUL } - ++s1; - ++s2; + s1++; + s2++; } return 0; // strings match } @@ -457,9 +457,9 @@ int vim_strnicmp(const char *s1, const char *s2, size_t len) if (*s1 == NUL) { break; // strings match until NUL } - ++s1; - ++s2; - --len; + s1++; + s2++; + len--; } return 0; // strings match } diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 1079533df2..8771aeeb32 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -379,7 +379,7 @@ void syntax_start(win_T *wp, linenr_T lnum) && current_lnum < syn_buf->b_ml.ml_line_count) { (void)syn_finish_line(false); if (!current_state_stored) { - ++current_lnum; + current_lnum++; (void)store_current_state(); } @@ -724,7 +724,7 @@ static void syn_sync(win_T *wp, linenr_T start_lnum, synstate_T *last_valid) } else if (found_m_endpos.col > current_col) { current_col = found_m_endpos.col; } else { - ++current_col; + current_col++; } // syn_current_attr() will have skipped the check for @@ -732,7 +732,7 @@ static void syn_sync(win_T *wp, linenr_T start_lnum, synstate_T *last_valid) // careful not to go past the NUL. prev_current_col = current_col; if (syn_getcurline()[current_col] != NUL) { - ++current_col; + current_col++; } check_state_ends(); current_col = prev_current_col; @@ -1030,7 +1030,7 @@ static void syn_stack_alloc(void) // Move the states from the old array to the new one. for (from = syn_block->b_sst_first; from != NULL; from = from->sst_next) { - ++to; + to++; *to = *from; to->sst_next = to + 1; } @@ -1501,7 +1501,7 @@ bool syntax_check_changed(linenr_T lnum) /* * Store the current state in b_sst_array[] for later use. */ - ++current_lnum; + current_lnum++; (void)store_current_state(); } } @@ -2096,9 +2096,9 @@ static int syn_current_attr(const bool syncing, const bool displaying, bool *con check_state_ends(); if (!GA_EMPTY(¤t_state) && syn_getcurline()[current_col] != NUL) { - ++current_col; + current_col++; check_state_ends(); - --current_col; + current_col--; } } } else if (can_spell != NULL) { @@ -2583,7 +2583,7 @@ static void find_endpos(int idx, lpos_T *startpos, lpos_T *m_endpos, lpos_T *hl_ if (spp->sp_type != SPTYPE_START) { break; } - ++idx; + idx++; } /* @@ -2591,7 +2591,7 @@ static void find_endpos(int idx, lpos_T *startpos, lpos_T *m_endpos, lpos_T *hl_ */ if (spp->sp_type == SPTYPE_SKIP) { spp_skip = spp; - ++idx; + idx++; } else { spp_skip = NULL; } @@ -3654,7 +3654,7 @@ static void syn_list_one(const int id, const bool syncing, const bool link_only) && SYN_ITEMS(curwin->w_s)[idx].sp_type == SPTYPE_END) { put_pattern("end", '=', &SYN_ITEMS(curwin->w_s)[idx++], attr); } - --idx; + idx--; msg_putchar(' '); } syn_list_flags(namelist1, spp->sp_flags, attr); @@ -3928,7 +3928,7 @@ static void syn_clear_keyword(int id, hashtab_T *ht) if (HASHITEM_EMPTY(hi)) { continue; } - --todo; + todo--; kp_prev = NULL; for (kp = HI2KE(hi); kp != NULL;) { if (kp->k_syn.id == id) { @@ -3968,7 +3968,7 @@ static void clear_keywtab(hashtab_T *ht) todo = (int)ht->ht_used; for (hi = ht->ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { - --todo; + todo--; for (kp = HI2KE(hi); kp != NULL; kp = kp_next) { kp_next = kp->ke_next; xfree(kp->next_list); @@ -4258,7 +4258,7 @@ static void syn_cmd_include(exarg_T *eap, int syncing) } if (arg[0] == '@') { - ++arg; + arg++; rest = get_group_name(arg, &group_name_end); if (rest == NULL) { emsg(_("E397: Filename required")); @@ -4584,7 +4584,7 @@ static void syn_cmd_region(exarg_T *eap, int syncing) // must be a pattern or matchgroup then key_end = rest; while (*key_end && !ascii_iswhite(*key_end) && *key_end != '=') { - ++key_end; + key_end++; } xfree(key); key = vim_strnsave_up(rest, (size_t)(key_end - rest)); @@ -4709,8 +4709,8 @@ static void syn_cmd_region(exarg_T *eap, int syncing) SYN_ITEMS(curwin->w_s)[idx].sp_next_list = syn_opt_arg.next_list; } - ++curwin->w_s->b_syn_patterns.ga_len; - ++idx; + curwin->w_s->b_syn_patterns.ga_len++; + idx++; if (syn_opt_arg.flags & HL_FOLD) { ++curwin->w_s->b_syn_folditems; } @@ -5082,7 +5082,7 @@ static char_u *get_syn_pattern(char_u *arg, synpat_T *ci) /* * Check for a match, highlight or region offset. */ - ++end; + end++; do { for (idx = SPO_COUNT; --idx >= 0;) { if (STRNCMP(end, spo_name_tab[idx], 3) == 0) { @@ -5127,7 +5127,7 @@ static char_u *get_syn_pattern(char_u *arg, synpat_T *ci) if (*end != ',') { break; } - ++end; + end++; } } } while (idx >= 0); @@ -5402,7 +5402,7 @@ static int get_id_list(char_u **const arg, const int keylen, int16_t **const lis retval[count] = (int16_t)id; } } - ++count; + count++; } p = skipwhite(end); if (*p != ',') { @@ -5478,7 +5478,7 @@ static int in_id_list(stateitem_T *cur_si, int16_t *list, struct sp_syn *ssp, in // that we don't go back past the first one. while ((cur_si->si_flags & HL_TRANS_CONT) && cur_si > (stateitem_T *)(current_state.ga_data)) { - --cur_si; + cur_si--; } // cur_si->si_idx is -1 for keywords, these never contain anything. if (cur_si->si_idx >= 0 && in_id_list(NULL, ssp->cont_in_list, @@ -5542,9 +5542,9 @@ static int in_id_list(stateitem_T *cur_si, int16_t *list, struct sp_syn *ssp, in // restrict recursiveness to 30 to avoid an endless loop for a // cluster that includes itself (indirectly) if (scl_list != NULL && depth < 30) { - ++depth; + depth++; r = in_id_list(NULL, scl_list, ssp, contained); - --depth; + depth--; if (r) { return retval; } @@ -5615,7 +5615,7 @@ void ex_syntax(exarg_T *eap) } xfree(subcmd_name); if (eap->skip) { - --emsg_skip; + emsg_skip--; } } diff --git a/src/nvim/tag.c b/src/nvim/tag.c index aa68cbf0b0..a4b320173c 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -465,7 +465,7 @@ bool do_tag(char_u *tag, int type, int count, int forceit, int verbose) // when the argument starts with '/', use it as a regexp if (!no_regexp && *name == '/') { flags = TAG_REGEXP; - ++name; + name++; } else { flags = TAG_NOIC; } @@ -653,13 +653,13 @@ bool do_tag(char_u *tag, int type, int count, int forceit, int verbose) || cur_match < num_matches - 1))) { error_cur_match = cur_match; if (use_tagstack) { - --tagstackidx; + tagstackidx--; } if (type == DT_PREV) { - --cur_match; + cur_match--; } else { type = DT_NEXT; - ++cur_match; + cur_match++; } continue; } @@ -1076,9 +1076,9 @@ static int tag_strnicmp(char_u *s1, char_u *s2, size_t len) if (*s1 == NUL) { break; // strings match until NUL } - ++s1; - ++s2; - --len; + s1++; + s2++; + len--; } return 0; // strings match } @@ -1612,7 +1612,7 @@ int find_tags(char_u *pat, int *num_matches, char ***matchesp, int flags, int mi // unless found already. help_pri++; if (STRICMP(help_lang, "en") != 0) { - ++help_pri; + help_pri++; } } } @@ -2475,7 +2475,7 @@ static int parse_tag_line(char_u *lbuf, tagptrs_T *tagp) // Isolate file name, from first to second white space if (*p != NUL) { - ++p; + p++; } tagp->fname = p; p = (char_u *)vim_strchr((char *)p, TAB); @@ -2486,7 +2486,7 @@ static int parse_tag_line(char_u *lbuf, tagptrs_T *tagp) // find start of search command, after second white space if (*p != NUL) { - ++p; + p++; } if (*p == NUL) { return FAIL; @@ -2717,7 +2717,7 @@ static int jumpto_tag(const char_u *lbuf_arg, int forceit, int keep_help) goto erret; } - ++RedrawingDisabled; + RedrawingDisabled++; if (l_g_do_tagpreview != 0) { postponed_split = 0; // don't split again below @@ -3168,7 +3168,7 @@ static int add_tag_field(dict_T *dict, const char *field_name, const char_u *sta if (end == NULL) { end = start + STRLEN(start); while (end > start && (end[-1] == '\r' || end[-1] == '\n')) { - --end; + end--; } } len = (int)(end - start); @@ -3247,13 +3247,13 @@ int get_tags(list_T *list, char_u *pat, char_u *buf_fname) // separated by Tabs. n = p; while (*p != NUL && *p >= ' ' && *p < 127 && *p != ':') { - ++p; + p++; } len = (int)(p - n); if (*p == ':' && len > 0) { s = ++p; while (*p != NUL && *p >= ' ') { - ++p; + p++; } n[len] = NUL; if (add_tag_field(dict, (char *)n, s, p) == FAIL) { @@ -3263,7 +3263,7 @@ int get_tags(list_T *list, char_u *pat, char_u *buf_fname) } else { // Skip field without colon. while (*p != NUL && *p >= ' ') { - ++p; + p++; } } if (*p == NUL) { diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 1874958964..ce8dede175 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -150,7 +150,7 @@ static void u_check_tree(u_header_T *uhp, u_header_T *exp_uh_next, u_header_T *e if (uhp == NULL) { return; } - ++header_count; + header_count++; if (uhp == curbuf->b_u_curhead && ++seen_b_u_curhead > 1) { emsg("b_u_curhead found twice (looping?)"); return; @@ -1334,7 +1334,7 @@ void u_write_undo(const char *const name, const bool forceit, buf_T *const buf, if (uhp->uh_walk != mark) { uhp->uh_walk = mark; #ifdef U_DEBUG - ++headers_written; + headers_written++; #endif if (!serialize_uhp(&bi, uhp)) { goto write_error; @@ -2598,7 +2598,7 @@ static void u_undo_end(bool did_undo, bool absolute, bool quiet) } if (curbuf->b_ml.ml_flags & ML_EMPTY) { - --u_newcount; + u_newcount--; } u_oldcount -= u_newcount; @@ -2742,7 +2742,7 @@ void ex_undolist(exarg_T *eap) if (uhp->uh_prev.ptr != NULL && uhp->uh_prev.ptr->uh_walk != nomark && uhp->uh_prev.ptr->uh_walk != mark) { uhp = uhp->uh_prev.ptr; - ++changes; + changes++; } // go to alternate branch if we haven't been there else if (uhp->uh_alt_next.ptr != NULL @@ -2755,7 +2755,7 @@ void ex_undolist(exarg_T *eap) && uhp->uh_next.ptr->uh_walk != nomark && uhp->uh_next.ptr->uh_walk != mark) { uhp = uhp->uh_next.ptr; - --changes; + changes--; } else { // need to backtrack; mark this node as done uhp->uh_walk = nomark; @@ -2763,7 +2763,7 @@ void ex_undolist(exarg_T *eap) uhp = uhp->uh_alt_prev.ptr; } else { uhp = uhp->uh_next.ptr; - --changes; + changes--; } } } diff --git a/src/nvim/window.c b/src/nvim/window.c index 8dc24479e4..9fddc59699 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -1671,7 +1671,7 @@ int win_count(void) int count = 0; FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { - ++count; + count++; } return count; } @@ -2460,7 +2460,7 @@ void close_windows(buf_T *buf, bool keep_curwin) tabpage_T *tp, *nexttp; int h = tabline_height(); - ++RedrawingDisabled; + RedrawingDisabled++; // Start from lastwin to close floating windows with the same buffer first. // When the autocommand window is involved win_close() may need to print an error message. @@ -2497,7 +2497,7 @@ void close_windows(buf_T *buf, bool keep_curwin) } } - --RedrawingDisabled; + RedrawingDisabled--; redraw_tabline = true; if (h != tabline_height()) { @@ -3821,7 +3821,7 @@ static int frame_minwidth(frame_T *topfrp, win_T *next_curwin) m = (int)p_wmw + topfrp->fr_win->w_vsep_width; // Current window is minimal one column wide if (p_wmw == 0 && topfrp->fr_win == curwin && next_curwin == NULL) { - ++m; + m++; } } } else if (topfrp->fr_layout == FR_COL) { @@ -4094,7 +4094,7 @@ int win_new_tabpage(int after, char_u *filename) n = 2; for (tp = first_tabpage; tp->tp_next != NULL && n < after; tp = tp->tp_next) { - ++n; + n++; } } newtp->tp_next = tp->tp_next; @@ -4240,7 +4240,7 @@ tabpage_T *find_tabpage(int n) int i = 1; for (tp = first_tabpage; tp != NULL && i != n; tp = tp->tp_next) { - ++i; + i++; } return tp; } @@ -4255,7 +4255,7 @@ int tabpage_index(tabpage_T *ftp) tabpage_T *tp; for (tp = first_tabpage; tp != NULL && tp != ftp; tp = tp->tp_next) { - ++i; + i++; } return i; } @@ -4517,7 +4517,7 @@ void tabpage_move(int nr) } for (tp = first_tabpage; tp->tp_next != NULL && n < nr; tp = tp->tp_next) { - ++n; + n++; } if (tp == curtab || (nr > 0 && tp->tp_next != NULL @@ -6226,7 +6226,7 @@ void scroll_to_fraction(win_T *wp, int prev_height) if (lnum == 1) { // first line in buffer is folded line_size = 1; - --sline; + sline--; break; } lnum--; @@ -6564,7 +6564,7 @@ char_u *file_name_in_line(char_u *line, int col, int options, long count, char_u if (ptr[len] == '\\' && ptr[len + 1] == ' ') { // Skip over the "\" in "\ ". - ++len; + len++; } len += (size_t)(utfc_ptr2len(ptr + len)); } @@ -6575,7 +6575,7 @@ char_u *file_name_in_line(char_u *line, int col, int options, long count, char_u */ if (len > 2 && vim_strchr(".,:;!", ptr[len - 1]) != NULL && ptr[len - 2] != '.') { - --len; + len--; } if (file_lnum != NULL) { |