mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 20:18:32 +00:00
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.
This commit is contained in:
@@ -886,7 +886,7 @@ static void f_copy(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
/// "count()" function
|
||||
static void f_count(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
{
|
||||
long n = 0;
|
||||
varnumber_T n = 0;
|
||||
int ic = 0;
|
||||
bool error = false;
|
||||
|
||||
@@ -1085,8 +1085,9 @@ static void f_ctxsize(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
/// Otherwise use the column number as a byte offset.
|
||||
static void set_cursorpos(typval_T *argvars, typval_T *rettv, bool charcol)
|
||||
{
|
||||
long lnum, col;
|
||||
long coladd = 0;
|
||||
linenr_T lnum;
|
||||
colnr_T col;
|
||||
colnr_T coladd = 0;
|
||||
bool set_curswant = true;
|
||||
|
||||
rettv->vval.v_number = -1;
|
||||
@@ -1114,12 +1115,12 @@ static void set_cursorpos(typval_T *argvars, typval_T *rettv, bool charcol)
|
||||
} else if (lnum == 0) {
|
||||
lnum = curwin->w_cursor.lnum;
|
||||
}
|
||||
col = (long)tv_get_number_chk(&argvars[1], NULL);
|
||||
col = (colnr_T)tv_get_number_chk(&argvars[1], NULL);
|
||||
if (charcol) {
|
||||
col = buf_charidx_to_byteidx(curbuf, (linenr_T)lnum, (int)col) + 1;
|
||||
col = buf_charidx_to_byteidx(curbuf, lnum, (int)col) + 1;
|
||||
}
|
||||
if (argvars[2].v_type != VAR_UNKNOWN) {
|
||||
coladd = (long)tv_get_number_chk(&argvars[2], NULL);
|
||||
coladd = (colnr_T)tv_get_number_chk(&argvars[2], NULL);
|
||||
}
|
||||
} else {
|
||||
emsg(_(e_invarg));
|
||||
@@ -1129,12 +1130,12 @@ static void set_cursorpos(typval_T *argvars, typval_T *rettv, bool charcol)
|
||||
return; // type error; errmsg already given
|
||||
}
|
||||
if (lnum > 0) {
|
||||
curwin->w_cursor.lnum = (linenr_T)lnum;
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
}
|
||||
if (col > 0) {
|
||||
curwin->w_cursor.col = (colnr_T)col - 1;
|
||||
curwin->w_cursor.col = col - 1;
|
||||
}
|
||||
curwin->w_cursor.coladd = (colnr_T)coladd;
|
||||
curwin->w_cursor.coladd = coladd;
|
||||
|
||||
// Make sure the cursor is in a valid position.
|
||||
check_cursor();
|
||||
|
Reference in New Issue
Block a user