diff options
author | dundargoc <gocdundar@gmail.com> | 2023-04-17 22:18:58 +0200 |
---|---|---|
committer | dundargoc <gocdundar@gmail.com> | 2023-07-03 12:49:09 +0200 |
commit | fcf3519c65a2d6736de437f686e788684a6c8564 (patch) | |
tree | 2c5ae2854f3688497b05f80bd0302feb9162a308 /src/nvim/ex_docmd.c | |
parent | f771d6247147b393238fe57065a96fb5e9635358 (diff) | |
download | rneovim-fcf3519c65a2d6736de437f686e788684a6c8564.tar.gz rneovim-fcf3519c65a2d6736de437f686e788684a6c8564.tar.bz2 rneovim-fcf3519c65a2d6736de437f686e788684a6c8564.zip |
refactor: remove long
long is 32-bits even on 64-bit windows which makes the type suboptimal
for a codebase meant to be cross-platform.
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index a70b3b1893..b3181e1b18 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -999,10 +999,10 @@ void *getline_cookie(LineGetter fgetline, void *cookie) /// ":bwipeout", etc. /// /// @return the buffer number. -static int compute_buffer_local_count(cmd_addr_T addr_type, linenr_T lnum, long offset) +static int compute_buffer_local_count(cmd_addr_T addr_type, linenr_T lnum, int offset) { buf_T *nextbuf; - long count = offset; + int count = offset; buf_T *buf = firstbuf; while (buf->b_next != NULL && buf->b_fnum < lnum) { @@ -5391,8 +5391,8 @@ static void ex_syncbind(exarg_T *eap) { win_T *save_curwin = curwin; buf_T *save_curbuf = curbuf; - long topline; - long y; + linenr_T topline; + int y; linenr_T old_linenr = curwin->w_cursor.lnum; setpcmark(); @@ -5719,7 +5719,7 @@ static void ex_sleep(exarg_T *eap) setcursor_mayforce(true); } - long len = eap->line2; + linenr_T len = eap->line2; switch (*eap->arg) { case 'm': break; @@ -5732,7 +5732,7 @@ static void ex_sleep(exarg_T *eap) } /// Sleep for "msec" milliseconds, but return early on CTRL-C. -void do_sleep(long msec) +void do_sleep(int64_t msec) { ui_flush(); // flush before waiting LOOP_PROCESS_EVENTS_UNTIL(&main_loop, main_loop.events, msec, got_int); @@ -5860,7 +5860,7 @@ static void ex_put(exarg_T *eap) static void ex_copymove(exarg_T *eap) { const char *errormsg = NULL; - long n = get_address(eap, &eap->arg, eap->addr_type, false, false, false, 1, &errormsg); + linenr_T n = get_address(eap, &eap->arg, eap->addr_type, false, false, false, 1, &errormsg); if (eap->arg == NULL) { // error detected if (errormsg != NULL) { emsg(errormsg); @@ -5877,11 +5877,11 @@ static void ex_copymove(exarg_T *eap) } if (eap->cmdidx == CMD_move) { - if (do_move(eap->line1, eap->line2, (linenr_T)n) == FAIL) { + if (do_move(eap->line1, eap->line2, n) == FAIL) { return; } } else { - ex_copy(eap->line1, eap->line2, (linenr_T)n); + ex_copy(eap->line1, eap->line2, n); } u_clearline(); beginline(BL_SOL | BL_FIX); @@ -5991,7 +5991,7 @@ static void ex_undo(exarg_T *eap) return; } - long step = eap->line2; + linenr_T step = eap->line2; if (eap->forceit) { // undo! 123 // change number for "undo!" must be lesser than current change number @@ -6579,9 +6579,9 @@ static void ex_findpat(exarg_T *eap) break; } - long n = 1; + int n = 1; if (ascii_isdigit(*eap->arg)) { // get count - n = getdigits_long(&eap->arg, false, 0); + n = getdigits_int(&eap->arg, false, 0); eap->arg = skipwhite(eap->arg); } if (*eap->arg == '/') { // Match regexp, not just whole words |