aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2022-08-25 14:30:12 +0100
committerGitHub <noreply@github.com>2022-08-25 14:30:12 +0100
commit99f8d34c8a7128a9adb43168ca5364ccbd568333 (patch)
tree0a28a1505debe6e4d1025f9c518a7b0fe1ab769c /src
parentcd2d3aa48f3531103a3a355d76394301e7b074df (diff)
parent93f24403f8cc760ff47979c596976b53a8b16358 (diff)
downloadrneovim-99f8d34c8a7128a9adb43168ca5364ccbd568333.tar.gz
rneovim-99f8d34c8a7128a9adb43168ca5364ccbd568333.tar.bz2
rneovim-99f8d34c8a7128a9adb43168ca5364ccbd568333.zip
Merge pull request #19934 from lewis6991/prepostincr
Diffstat (limited to 'src')
-rw-r--r--src/nvim/edit.c20
-rw-r--r--src/nvim/eval/userfunc.c10
-rw-r--r--src/nvim/ex_cmds.c10
-rw-r--r--src/nvim/ex_eval.c22
-rw-r--r--src/nvim/ex_getln.c4
-rw-r--r--src/nvim/file_search.c4
-rw-r--r--src/nvim/fileio.c16
-rw-r--r--src/nvim/garray.c2
-rw-r--r--src/nvim/getchar.c6
-rw-r--r--src/nvim/hardcopy.c20
-rw-r--r--src/nvim/hashtab.c4
-rw-r--r--src/nvim/if_cscope.c4
-rw-r--r--src/nvim/indent_c.c12
-rw-r--r--src/nvim/main.c2
-rw-r--r--src/nvim/mark.c20
-rw-r--r--src/nvim/mbyte.c18
-rw-r--r--src/nvim/memline.c36
-rw-r--r--src/nvim/menu.c8
-rw-r--r--src/nvim/message.c9
-rw-r--r--src/nvim/mouse.c2
-rw-r--r--src/nvim/move.c40
-rw-r--r--src/nvim/ops.c50
-rw-r--r--src/nvim/path.c4
-rw-r--r--src/nvim/quickfix.c8
-rw-r--r--src/nvim/regexp_bt.c2
-rw-r--r--src/nvim/screen.c2
-rw-r--r--src/nvim/search.c32
-rw-r--r--src/nvim/spellfile.c93
-rw-r--r--src/nvim/spellsuggest.c2
-rw-r--r--src/nvim/strings.c10
-rw-r--r--src/nvim/syntax.c56
-rw-r--r--src/nvim/tag.c8
-rw-r--r--src/nvim/undo.c2
-rw-r--r--src/nvim/version.c2
-rw-r--r--src/nvim/window.c24
35 files changed, 278 insertions, 286 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 81a67b86c3..79317d3df6 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -452,7 +452,7 @@ static int insert_check(VimState *state)
&& (curwin->w_cursor.lnum != curwin->w_topline
|| curwin->w_topfill > 0)) {
if (curwin->w_topfill > 0) {
- --curwin->w_topfill;
+ curwin->w_topfill--;
} else if (hasFolding(curwin->w_topline, NULL, &s->old_topline)) {
set_topline(curwin, s->old_topline + 1);
} else {
@@ -2692,7 +2692,7 @@ void auto_format(bool trailblank, bool prev_line)
* the start of a paragraph.
*/
if (prev_line && !paragraph_start(curwin->w_cursor.lnum)) {
- --curwin->w_cursor.lnum;
+ curwin->w_cursor.lnum--;
if (u_save_cursor() == FAIL) {
return;
}
@@ -2993,7 +2993,7 @@ static void stop_insert(pos_T *end_insert_pos, int esc, int nomove)
check_cursor_col(); // make sure it is not past the line
for (;;) {
if (gchar_cursor() == NUL && curwin->w_cursor.col > 0) {
- --curwin->w_cursor.col;
+ curwin->w_cursor.col--;
}
cc = gchar_cursor();
if (!ascii_iswhite(cc)) {
@@ -3010,7 +3010,7 @@ static void stop_insert(pos_T *end_insert_pos, int esc, int nomove)
tpos = curwin->w_cursor;
tpos.col++;
if (cc != NUL && gchar_pos(&tpos) == NUL) {
- ++curwin->w_cursor.col; // put cursor back on the NUL
+ curwin->w_cursor.col++; // put cursor back on the NUL
}
}
@@ -3082,8 +3082,8 @@ void beginline(int flags)
char_u *ptr;
for (ptr = get_cursor_line_ptr(); ascii_iswhite(*ptr)
- && !((flags & BL_FIX) && ptr[1] == NUL); ++ptr) {
- ++curwin->w_cursor.col;
+ && !((flags & BL_FIX) && ptr[1] == NUL); ptr++) {
+ curwin->w_cursor.col++;
}
}
curwin->w_set_curswant = TRUE;
@@ -3173,8 +3173,8 @@ int oneleft(void)
return FAIL;
}
- curwin->w_set_curswant = TRUE;
- --curwin->w_cursor.col;
+ curwin->w_set_curswant = true;
+ curwin->w_cursor.col--;
// if the character on the left of the current cursor is a multi-byte
// character, move to its first byte
@@ -3454,7 +3454,7 @@ int replace_push_mb(char_u *p)
int l = utfc_ptr2len((char *)p);
int j;
- for (j = l - 1; j >= 0; --j) {
+ for (j = l - 1; j >= 0; j--) {
replace_push(p[j]);
}
return l;
@@ -4271,7 +4271,7 @@ static void ins_ctrl_(void)
{
if (revins_on && revins_chars && revins_scol >= 0) {
while (gchar_cursor() != NUL && revins_chars--) {
- ++curwin->w_cursor.col;
+ curwin->w_cursor.col++;
}
}
p_ri = !p_ri;
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index 2542a5aeb0..bb2e2b19c2 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -852,7 +852,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett
saveRedobuff(&save_redo);
did_save_redo = true;
}
- ++fp->uf_calls;
+ fp->uf_calls++;
// check for CTRL-C hit
line_breakcheck();
// prepare the funccall_T structure
@@ -893,7 +893,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett
v->di_tv.v_type = VAR_DICT;
v->di_tv.v_lock = VAR_UNLOCKED;
v->di_tv.vval.v_dict = selfdict;
- ++selfdict->dv_refcount;
+ selfdict->dv_refcount++;
}
// Init a: variables, unless none found (in lambda).
@@ -1071,7 +1071,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett
|| (fc->caller != NULL && fc->caller->func->uf_profiling));
if (func_or_func_caller_profiling) {
- ++fp->uf_tm_count;
+ fp->uf_tm_count++;
call_start = profile_start();
fp->uf_tm_children = profile_zero();
}
@@ -1929,7 +1929,7 @@ void ex_function(exarg_T *eap)
if (ends_excmd(*eap->arg)) {
if (!eap->skip) {
todo = (int)func_hashtab.ht_used;
- for (hi = func_hashtab.ht_array; todo > 0 && !got_int; ++hi) {
+ for (hi = func_hashtab.ht_array; todo > 0 && !got_int; hi++) {
if (!HASHITEM_EMPTY(hi)) {
todo--;
fp = HI2UF(hi);
@@ -1962,7 +1962,7 @@ void ex_function(exarg_T *eap)
regmatch.rm_ic = p_ic;
todo = (int)func_hashtab.ht_used;
- for (hi = func_hashtab.ht_array; todo > 0 && !got_int; ++hi) {
+ for (hi = func_hashtab.ht_array; todo > 0 && !got_int; hi++) {
if (!HASHITEM_EMPTY(hi)) {
todo--;
fp = HI2UF(hi);
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index b4e8c6de7b..e08e977ff5 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -678,7 +678,7 @@ void ex_sort(exarg_T *eap)
// delete the original lines if appending worked
if (i == count) {
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
ml_delete(eap->line1, false);
}
} else {
@@ -1103,7 +1103,7 @@ void ex_copy(linenr_T line1, linenr_T line2, linenr_T n)
if (curwin->w_cursor.lnum < line2) {
line2++;
}
- ++curwin->w_cursor.lnum;
+ curwin->w_cursor.lnum++;
}
appended_lines_mark(n, count);
@@ -2601,7 +2601,7 @@ int do_ecmd(int fnum, char *ffname, char *sfname, exarg_T *eap, linenr_T newlnum
curwin->w_buffer = buf;
curbuf = buf;
- ++curbuf->b_nwindows;
+ curbuf->b_nwindows++;
// Set 'fileformat', 'binary' and 'fenc' when forced.
if (!oldbuf && eap != NULL) {
@@ -3018,7 +3018,7 @@ void ex_append(exarg_T *eap)
// Look for the "." after automatic indent.
vcol = 0;
- for (p = theline; indent > vcol; ++p) {
+ for (p = theline; indent > vcol; p++) {
if (*p == ' ') {
vcol++;
} else if (*p == TAB) {
@@ -3098,7 +3098,7 @@ void ex_change(exarg_T *eap)
append_indent = get_indent_lnum(eap->line1);
}
- for (lnum = eap->line2; lnum >= eap->line1; --lnum) {
+ for (lnum = eap->line2; lnum >= eap->line1; lnum--) {
if (curbuf->b_ml.ml_flags & ML_EMPTY) { // nothing to delete
break;
}
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c
index 82d6e66290..5ddcb0270b 100644
--- a/src/nvim/ex_eval.c
+++ b/src/nvim/ex_eval.c
@@ -830,7 +830,7 @@ void ex_if(exarg_T *eap)
if (cstack->cs_idx == CSTACK_LEN - 1) {
eap->errmsg = _("E579: :if nesting too deep");
} else {
- ++cstack->cs_idx;
+ cstack->cs_idx++;
cstack->cs_flags[cstack->cs_idx] = 0;
skip = CHECK_SKIP;
@@ -870,7 +870,7 @@ void ex_endif(exarg_T *eap)
(void)do_intthrow(eap->cstack);
}
- --eap->cstack->cs_idx;
+ eap->cstack->cs_idx--;
}
}
@@ -964,8 +964,8 @@ void ex_while(exarg_T *eap)
* cstack entry.
*/
if ((cstack->cs_lflags & CSL_HAD_LOOP) == 0) {
- ++cstack->cs_idx;
- ++cstack->cs_looplevel;
+ cstack->cs_idx++;
+ cstack->cs_looplevel++;
cstack->cs_line[cstack->cs_idx] = -1;
}
cstack->cs_flags[cstack->cs_idx] =
@@ -1118,7 +1118,7 @@ void ex_endwhile(exarg_T *eap)
eap->errmsg = _(e_endtry);
}
// Try to find the matching ":while" and report what's missing.
- for (idx = cstack->cs_idx; idx > 0; --idx) {
+ for (idx = cstack->cs_idx; idx > 0; idx--) {
fl = cstack->cs_flags[idx];
if ((fl & CSF_TRY) && !(fl & CSF_FINALLY)) {
// Give up at a try conditional not in its finally clause.
@@ -1248,8 +1248,8 @@ void ex_try(exarg_T *eap)
if (cstack->cs_idx == CSTACK_LEN - 1) {
eap->errmsg = _("E601: :try nesting too deep");
} else {
- ++cstack->cs_idx;
- ++cstack->cs_trylevel;
+ cstack->cs_idx++;
+ cstack->cs_trylevel++;
cstack->cs_flags[cstack->cs_idx] = CSF_TRY;
cstack->cs_pending[cstack->cs_idx] = CSTP_NONE;
@@ -1314,7 +1314,7 @@ void ex_catch(exarg_T *eap)
eap->errmsg = get_end_emsg(cstack);
skip = true;
}
- for (idx = cstack->cs_idx; idx > 0; --idx) {
+ for (idx = cstack->cs_idx; idx > 0; idx--) {
if (cstack->cs_flags[idx] & CSF_TRY) {
break;
}
@@ -1456,7 +1456,7 @@ void ex_finally(exarg_T *eap)
} else {
if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY)) {
eap->errmsg = get_end_emsg(cstack);
- for (idx = cstack->cs_idx - 1; idx > 0; --idx) {
+ for (idx = cstack->cs_idx - 1; idx > 0; idx--) {
if (cstack->cs_flags[idx] & CSF_TRY) {
break;
}
@@ -1906,7 +1906,7 @@ int cleanup_conditionals(cstack_T *cstack, int searched_cond, int inclusive)
int idx;
int stop = FALSE;
- for (idx = cstack->cs_idx; idx >= 0; --idx) {
+ for (idx = cstack->cs_idx; idx >= 0; idx--) {
if (cstack->cs_flags[idx] & CSF_TRY) {
/*
* Discard anything pending in a finally clause and continue the
@@ -2036,7 +2036,7 @@ void rewind_conditionals(cstack_T *cstack, int idx, int cond_type, int *cond_lev
if (cstack->cs_flags[cstack->cs_idx] & CSF_FOR) {
free_for_info(cstack->cs_forinfo[cstack->cs_idx]);
}
- --cstack->cs_idx;
+ cstack->cs_idx--;
}
}
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 43ea3e302b..afec21a86f 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -1260,7 +1260,7 @@ static int command_line_execute(VimState *state, int key)
}
if (s->wim_index < 3) {
- ++s->wim_index;
+ s->wim_index++;
}
if (s->c == ESC) {
@@ -1477,7 +1477,7 @@ static int command_line_handle_key(CommandLineState *s)
// delete current character is the same as backspace on next
// character, except at end of line
if (s->c == K_DEL && ccline.cmdpos != ccline.cmdlen) {
- ++ccline.cmdpos;
+ ccline.cmdpos++;
}
if (s->c == K_DEL) {
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c
index 2d09e7aa71..53f87d0e42 100644
--- a/src/nvim/file_search.c
+++ b/src/nvim/file_search.c
@@ -1429,7 +1429,7 @@ char_u *find_file_in_path_option(char_u *ptr, size_t len, int options, int first
ff_file_to_find = vim_strsave(NameBuff);
if (options & FNAME_UNESC) {
// Change all "\ " to " ".
- for (ptr = ff_file_to_find; *ptr != NUL; ++ptr) {
+ for (ptr = ff_file_to_find; *ptr != NUL; ptr++) {
if (ptr[0] == '\\' && ptr[1] == ' ') {
memmove(ptr, ptr + 1, STRLEN(ptr));
}
@@ -1466,7 +1466,7 @@ char_u *find_file_in_path_option(char_u *ptr, size_t len, int options, int first
/* When FNAME_REL flag given first use the directory of the file.
* Otherwise or when this fails use the current directory. */
- for (int run = 1; run <= 2; ++run) {
+ for (int run = 1; run <= 2; run++) {
size_t l = STRLEN(ff_file_to_find);
if (run == 1
&& rel_to_curdir
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index a21fc9e9d4..39bf1b3670 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -583,7 +583,7 @@ int readfile(char *fname, char *sfname, linenr_T from, linenr_T lines_to_skip,
return FAIL;
}
- ++no_wait_return; // don't wait for return yet
+ no_wait_return++; // don't wait for return yet
// Set '[ mark to the line above where the lines go (line 1 if zero).
orig_start = curbuf->b_op_start;
@@ -1011,7 +1011,7 @@ retry:
// Change NL to NUL to reverse the effect done
// below.
n = (int)(size - tlen);
- for (ni = 0; ni < n; ++ni) {
+ for (ni = 0; ni < n; ni++) {
if (p[ni] == NL) {
ptr[tlen++] = NUL;
} else {
@@ -1729,7 +1729,7 @@ failed:
os_remove(tmpname); // delete converted file
xfree(tmpname);
}
- --no_wait_return; // may wait for return now
+ no_wait_return--; // may wait for return now
/*
* In recovery mode everything but autocommands is skipped.
@@ -1999,7 +1999,7 @@ static linenr_T readfile_linenr(linenr_T linecnt, char_u *p, char_u *endp)
linenr_T lnum;
lnum = curbuf->b_ml.ml_line_count - linecnt + 1;
- for (s = p; s < endp; ++s) {
+ for (s = p; s < endp; s++) {
if (*s == '\n') {
lnum++;
}
@@ -2317,7 +2317,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
overwriting = FALSE;
}
- ++no_wait_return; // don't wait for return yet
+ no_wait_return++; // don't wait for return yet
/*
* Set '[ and '] marks to the lines to be written.
@@ -3485,7 +3485,7 @@ restore_backup:
}
lnum -= start; // compute number of written lines
- --no_wait_return; // may wait for return now
+ no_wait_return--; // may wait for return now
#if !defined(UNIX)
fname = sfname; // use shortname now, for the messages
@@ -3624,7 +3624,7 @@ restore_backup:
* Finish up. We get here either after failure or success.
*/
fail:
- --no_wait_return; // may wait for return now
+ no_wait_return--; // may wait for return now
nofail:
// Done saving, we accept changed buffer warnings again
@@ -3998,7 +3998,7 @@ static int buf_write_bytes(struct bw_info *ip)
ip->bw_conv_error_lnum = ip->bw_start_lnum;
}
if (c == NL) {
- ++ip->bw_start_lnum;
+ ip->bw_start_lnum++;
}
}
if (flags & FIO_LATIN1) {
diff --git a/src/nvim/garray.c b/src/nvim/garray.c
index 7a3c14b1bb..1afabe4e10 100644
--- a/src/nvim/garray.c
+++ b/src/nvim/garray.c
@@ -131,7 +131,7 @@ void ga_remove_duplicate_strings(garray_T *gap)
fnames[j - 1] = fnames[j];
}
- --gap->ga_len;
+ gap->ga_len--;
}
}
}
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 36ca31783e..1f4d28bcd3 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -932,7 +932,7 @@ int ins_typebuf(char *str, int noremap, int offset, bool nottyped, bool silent)
} else {
nrm = noremap;
}
- for (i = 0; i < addlen; ++i) {
+ for (i = 0; i < addlen; i++) {
typebuf.tb_noremap[typebuf.tb_off + i + offset] =
(char_u)((--nrm >= 0) ? val : RM_YES);
}
@@ -2563,7 +2563,7 @@ static int vgetorpeek(bool advance)
curwin->w_wcol += curwin_col_off();
col = 0; // no correction needed
} else {
- --curwin->w_wcol;
+ curwin->w_wcol--;
col = curwin->w_cursor.col - 1;
}
} else if (curwin->w_p_wrap && curwin->w_wrow) {
@@ -2929,7 +2929,7 @@ int fix_input_buffer(char_u *buf, int len)
// Two characters are special: NUL and K_SPECIAL.
// Replace NUL by K_SPECIAL KS_ZERO KE_FILLER
// Replace K_SPECIAL by K_SPECIAL KS_SPECIAL KE_FILLER
- for (i = len; --i >= 0; ++p) {
+ for (i = len; --i >= 0; p++) {
if (p[0] == NUL
|| (p[0] == K_SPECIAL
&& (i < 2 || p[1] != KS_EXTRA))) {
diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c
index e8410d1ee7..6f45b4a03d 100644
--- a/src/nvim/hardcopy.c
+++ b/src/nvim/hardcopy.c
@@ -324,7 +324,7 @@ static char *parse_list_options(char_u *option_str, option_table_T *table, size_
len = (int)(colonp - stringp);
- for (idx = 0; idx < table_size; ++idx) {
+ for (idx = 0; idx < table_size; idx++) {
if (STRNICMP(stringp, table[idx].name, len) == 0) {
break;
}
@@ -526,7 +526,7 @@ int prt_get_unit(int idx)
static char *(units[4]) = PRT_UNIT_NAMES;
if (printer_opts[idx].present) {
- for (i = 0; i < 4; ++i) {
+ for (i = 0; i < 4; i++) {
if (STRNICMP(printer_opts[idx].string, units[i], 2) == 0) {
u = i;
break;
@@ -751,11 +751,9 @@ void ex_hardcopy(exarg_T *eap)
/*
* Loop over all pages in the print job: 1 2 3 ...
*/
- for (page_count = 0; prtpos.file_line <= eap->line2; ++page_count) {
- /*
- * Loop over uncollated copies: 1 1 1, 2 2 2, 3 3 3, ...
- * For duplex: 12 12 12 34 34 34, ...
- */
+ for (page_count = 0; prtpos.file_line <= eap->line2; page_count++) {
+ // Loop over uncollated copies: 1 1 1, 2 2 2, 3 3 3, ...
+ // For duplex: 12 12 12 34 34 34, ...
for (uncollated_copies = 0;
uncollated_copies < settings.n_uncollated_copies;
uncollated_copies++) {
@@ -765,10 +763,8 @@ void ex_hardcopy(exarg_T *eap)
/*
* Do front and rear side of a page.
*/
- for (side = 0; side <= settings.duplex; ++side) {
- /*
- * Print one page.
- */
+ for (side = 0; side <= settings.duplex; side++) {
+ // Print one page.
// Check for interrupt character every page.
os_breakcheck();
@@ -2298,7 +2294,7 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
paper_name = "A4";
paper_strlen = 2;
}
- for (i = 0; i < (int)PRT_MEDIASIZE_LEN; ++i) {
+ for (i = 0; i < (int)PRT_MEDIASIZE_LEN; i++) {
if (STRLEN(prt_mediasize[i].name) == (unsigned)paper_strlen
&& STRNICMP(prt_mediasize[i].name, paper_name,
paper_strlen) == 0) {
diff --git a/src/nvim/hashtab.c b/src/nvim/hashtab.c
index 951e72ea52..308f64f011 100644
--- a/src/nvim/hashtab.c
+++ b/src/nvim/hashtab.c
@@ -67,7 +67,7 @@ void hash_clear(hashtab_T *ht)
void hash_clear_all(hashtab_T *ht, unsigned int off)
{
size_t todo = ht->ht_used;
- for (hashitem_T *hi = ht->ht_array; todo > 0; ++hi) {
+ for (hashitem_T *hi = ht->ht_array; todo > 0; hi++) {
if (!HASHITEM_EMPTY(hi)) {
xfree(hi->hi_key - off);
todo--;
@@ -356,7 +356,7 @@ static void hash_may_resize(hashtab_T *ht, size_t minitems)
hash_T newmask = newsize - 1;
size_t todo = ht->ht_used;
- for (hashitem_T *olditem = oldarray; todo > 0; ++olditem) {
+ for (hashitem_T *olditem = oldarray; todo > 0; olditem++) {
if (HASHITEM_EMPTY(olditem)) {
continue;
}
diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c
index 689d1fce0d..9d3b2b0455 100644
--- a/src/nvim/if_cscope.c
+++ b/src/nvim/if_cscope.c
@@ -900,7 +900,7 @@ static int cs_find(exarg_T *eap)
* Let's replace the NULs written by strtok() with spaces - we need the
* spaces to correctly display the quickfix/location list window's title.
*/
- for (int i = 0; i < eap_arg_len; ++i) {
+ for (int i = 0; i < eap_arg_len; i++) {
if (NUL == eap->arg[i]) {
eap->arg[i] = ' ';
}
@@ -1838,7 +1838,7 @@ static void cs_release_csp(size_t i, bool freefnpp)
// Can't use sigaction(), loop for two seconds. First yield the CPU
// to give cscope a chance to exit quickly.
sleep(0);
- for (waited = 0; waited < 40; ++waited) {
+ for (waited = 0; waited < 40; waited++) {
pid = waitpid(csinfo[i].pid, &pstat, WNOHANG);
waitpid_errno = errno;
if (pid != 0) {
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c
index 34a3de4f78..fe8c235cc1 100644
--- a/src/nvim/indent_c.c
+++ b/src/nvim/indent_c.c
@@ -383,7 +383,7 @@ bool cin_islabel(void) // XXX
cursor_save = curwin->w_cursor;
while (curwin->w_cursor.lnum > 1) {
- --curwin->w_cursor.lnum;
+ curwin->w_cursor.lnum--;
/*
* If we're in a comment or raw string now, skip to the start of
@@ -434,7 +434,7 @@ static int cin_isinit(void)
for (;;) {
int i, l;
- for (i = 0; i < (int)ARRAY_SIZE(skip); ++i) {
+ for (i = 0; i < (int)ARRAY_SIZE(skip); i++) {
l = (int)strlen(skip[i]);
if (cin_starts_with(s, skip[i])) {
s = cin_skipcomment(s + l);
@@ -465,7 +465,7 @@ bool cin_iscase(const char_u *s, bool strict)
{
s = cin_skipcomment(s);
if (cin_starts_with(s, "case")) {
- for (s += 4; *s; ++s) {
+ for (s += 4; *s; s++) {
s = cin_skipcomment(s);
if (*s == NUL) {
break;
@@ -588,7 +588,7 @@ static bool cin_is_cpp_namespace(const char_u *s)
*/
static const char_u *after_label(const char_u *l)
{
- for (; *l; ++l) {
+ for (; *l; l++) {
if (*l == ':') {
if (l[1] == ':') { // skip over "::" for C++
l++;
@@ -2330,7 +2330,7 @@ int get_c_indent(void)
/* look for opening unmatched paren, indent one level
* for each additional level */
n = 1;
- for (col = 0; col < our_paren_pos.col; ++col) {
+ for (col = 0; col < our_paren_pos.col; col++) {
switch (l[col]) {
case '(':
case '{':
@@ -2388,7 +2388,7 @@ int get_c_indent(void)
* but ignore (void) before the line (ignore_paren_col). */
col = our_paren_pos.col;
while ((int)our_paren_pos.col > ignore_paren_col) {
- --our_paren_pos.col;
+ our_paren_pos.col--;
switch (*ml_get_pos(&our_paren_pos)) {
case '(':
amount += curbuf->b_ind_unclosed2;
diff --git a/src/nvim/main.c b/src/nvim/main.c
index e4e30b7902..12c51e8a85 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -1709,7 +1709,7 @@ static void edit_buffers(mparm_T *parmp, char_u *cwd)
}
arg_idx = 1;
- for (i = 1; i < parmp->window_count; ++i) {
+ for (i = 1; i < parmp->window_count; i++) {
if (cwd != NULL) {
os_chdir((char *)cwd);
}
diff --git a/src/nvim/mark.c b/src/nvim/mark.c
index 593275d489..a15a27650b 100644
--- a/src/nvim/mark.c
+++ b/src/nvim/mark.c
@@ -704,12 +704,12 @@ void fmarks_check_names(buf_T *buf)
return;
}
- for (i = 0; i < NGLOBALMARKS; ++i) {
+ for (i = 0; i < NGLOBALMARKS; i++) {
fmarks_check_one(&namedfm[i], name, buf);
}
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
- for (i = 0; i < wp->w_jumplistlen; ++i) {
+ for (i = 0; i < wp->w_jumplistlen; i++) {
fmarks_check_one(&wp->w_jumplist[i], name, buf);
}
}
@@ -848,10 +848,10 @@ void ex_marks(exarg_T *eap)
}
show_one_mark('\'', arg, &curwin->w_pcmark, NULL, true);
- for (i = 0; i < NMARKS; ++i) {
+ for (i = 0; i < NMARKS; i++) {
show_one_mark(i + 'a', arg, &curbuf->b_namedm[i].mark, NULL, true);
}
- for (i = 0; i < NGLOBALMARKS; ++i) {
+ for (i = 0; i < NGLOBALMARKS; i++) {
if (namedfm[i].fmark.fnum != 0) {
name = fm_getname(&namedfm[i].fmark, 15);
} else {
@@ -975,7 +975,7 @@ void ex_delmarks(exarg_T *eap)
from = to = *p;
}
- for (i = from; i <= to; ++i) {
+ for (i = from; i <= to; i++) {
if (lower) {
curbuf->b_namedm[i - 'a'].mark.lnum = 0;
} else {
@@ -1027,7 +1027,7 @@ void ex_jumps(exarg_T *eap)
cleanup_jumplist(curwin, true);
// Highlight title
msg_puts_title(_("\n jump line col file/text"));
- for (i = 0; i < curwin->w_jumplistlen && !got_int; ++i) {
+ for (i = 0; i < curwin->w_jumplistlen && !got_int; i++) {
if (curwin->w_jumplist[i].fmark.mark.lnum != 0) {
name = fm_getname(&curwin->w_jumplist[i].fmark, 16);
@@ -1083,7 +1083,7 @@ void ex_changes(exarg_T *eap)
// Highlight title
msg_puts_title(_("\nchange line col text"));
- for (i = 0; i < curbuf->b_changelistlen && !got_int; ++i) {
+ for (i = 0; i < curbuf->b_changelistlen && !got_int; i++) {
if (curbuf->b_changelist[i].mark.lnum != 0) {
msg_putchar('\n');
if (got_int) {
@@ -1391,7 +1391,7 @@ void mark_col_adjust(linenr_T lnum, colnr_T mincol, linenr_T lnum_amount, long c
*/
FOR_ALL_WINDOWS_IN_TAB(win, curtab) {
// marks in the jumplist
- for (i = 0; i < win->w_jumplistlen; ++i) {
+ for (i = 0; i < win->w_jumplistlen; i++) {
if (win->w_jumplist[i].fmark.fnum == fnum) {
COL_ADJUST(&(win->w_jumplist[i].fmark.mark));
}
@@ -1493,7 +1493,7 @@ void copy_jumplist(win_T *from, win_T *to)
{
int i;
- for (i = 0; i < from->w_jumplistlen; ++i) {
+ for (i = 0; i < from->w_jumplistlen; i++) {
to->w_jumplist[i] = from->w_jumplist[i];
if (from->w_jumplist[i].fname != NULL) {
to->w_jumplist[i].fname = xstrdup(from->w_jumplist[i].fname);
@@ -1717,7 +1717,7 @@ void free_jumplist(win_T *wp)
{
int i;
- for (i = 0; i < wp->w_jumplistlen; ++i) {
+ for (i = 0; i < wp->w_jumplistlen; i++) {
free_xfmark(wp->w_jumplist[i]);
}
wp->w_jumplistlen = 0;
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index bfe5f70b6e..f9d8422481 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -882,7 +882,7 @@ int utf_ptr2len_len(const char_u *p, int size)
} else {
m = len;
}
- for (i = 1; i < m; ++i) {
+ for (i = 1; i < m; i++) {
if ((p[i] & 0xc0) != 0x80) {
return 1;
}
@@ -1595,7 +1595,7 @@ void show_utf8(void)
}
clen = 0;
- for (i = 0; i < len; ++i) {
+ for (i = 0; i < len; i++) {
if (clen == 0) {
// start of (composing) character, get its length
if (i > 0) {
@@ -1632,10 +1632,10 @@ int utf_head_off(const char_u *base, const char_u *p)
// Skip backwards over trailing bytes: 10xx.xxxx
// Skip backwar