diff options
author | dundargoc <gocdundar@gmail.com> | 2023-09-29 14:58:48 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-10-09 11:45:46 +0200 |
commit | 8e932480f61d6101bf8bea1abc07ed93826221fd (patch) | |
tree | 06cf8d0af6e786aba6d01343c54ba52b01738daa /src/nvim/ex_cmds.c | |
parent | dacd34364ff3af98bc2d357c43e3ce06638e2ce9 (diff) | |
download | rneovim-8e932480f61d6101bf8bea1abc07ed93826221fd.tar.gz rneovim-8e932480f61d6101bf8bea1abc07ed93826221fd.tar.bz2 rneovim-8e932480f61d6101bf8bea1abc07ed93826221fd.zip |
refactor: the long goodbye
long is 32 bits on windows, while it is 64 bits on other architectures.
This makes the type suboptimal for a codebase meant to be
cross-platform. Replace it with more appropriate integer types.
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index c57324d5e9..e9a42ae508 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -3521,8 +3521,8 @@ static int do_sub(exarg_T *eap, const proftime_T timeout, const int cmdpreview_n && (cmdpreview_ns <= 0 || preview_lines.lines_needed <= (linenr_T)p_cwh || lnum <= curwin->w_botline); lnum++) { - int nmatch = (int)vim_regexec_multi(®match, curwin, curbuf, lnum, - (colnr_T)0, NULL, NULL); + int nmatch = vim_regexec_multi(®match, curwin, curbuf, lnum, + (colnr_T)0, NULL, NULL); if (nmatch) { colnr_T copycol; colnr_T matchcol; @@ -4087,9 +4087,9 @@ skip: // need to replace the line first (using \zs after \n). if (lastone || nmatch_tl > 0 - || (nmatch = (int)vim_regexec_multi(®match, curwin, - curbuf, sub_firstlnum, - matchcol, NULL, NULL)) == 0 + || (nmatch = vim_regexec_multi(®match, curwin, + curbuf, sub_firstlnum, + matchcol, NULL, NULL)) == 0 || regmatch.startpos[0].lnum > 0) { if (new_start != NULL) { // Copy the rest of the line, that didn't match. @@ -4149,8 +4149,8 @@ skip: copycol = 0; } if (nmatch == -1 && !lastone) { - nmatch = (int)vim_regexec_multi(®match, curwin, curbuf, - sub_firstlnum, matchcol, NULL, NULL); + nmatch = vim_regexec_multi(®match, curwin, curbuf, + sub_firstlnum, matchcol, NULL, NULL); } // 5. break if there isn't another match in this line @@ -4446,7 +4446,7 @@ void ex_global(exarg_T *eap) if (global_busy) { lnum = curwin->w_cursor.lnum; - match = (int)vim_regexec_multi(®match, curwin, curbuf, lnum, 0, NULL, NULL); + match = vim_regexec_multi(®match, curwin, curbuf, lnum, 0, NULL, NULL); if ((type == 'g' && match) || (type == 'v' && !match)) { global_exe_one(cmd, lnum); } @@ -4455,7 +4455,7 @@ void ex_global(exarg_T *eap) // pass 1: set marks for each (not) matching line for (lnum = eap->line1; lnum <= eap->line2 && !got_int; lnum++) { // a match on this line? - match = (int)vim_regexec_multi(®match, curwin, curbuf, lnum, 0, NULL, NULL); + match = vim_regexec_multi(®match, curwin, curbuf, lnum, 0, NULL, NULL); if (regmatch.regprog == NULL) { break; // re-compiling regprog failed } |