mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
*: Fix conversion warnings for tv_get_number*()
This commit is contained in:
parent
bf4de3f6f7
commit
af59a290d8
@ -6691,7 +6691,7 @@ static void f_argv(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
int idx;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN) {
|
||||
idx = tv_get_number_chk(&argvars[0], NULL);
|
||||
idx = (int)tv_get_number_chk(&argvars[0], NULL);
|
||||
if (idx >= 0 && idx < ARGCOUNT) {
|
||||
rettv->vval.v_string = (char_u *)xstrdup(
|
||||
(const char *)alist_name(&ARGLIST[idx]));
|
||||
@ -7427,7 +7427,7 @@ static void f_complete(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
return;
|
||||
}
|
||||
|
||||
const int startcol = tv_get_number_chk(&argvars[0], NULL);
|
||||
const colnr_T startcol = tv_get_number_chk(&argvars[0], NULL);
|
||||
if (startcol <= 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -2442,7 +2442,7 @@ varnumber_T tv_get_number_chk(const typval_T *const tv, bool *const ret_error)
|
||||
linenr_T tv_get_lnum(const typval_T *const tv)
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
linenr_T lnum = tv_get_number_chk(tv, NULL);
|
||||
linenr_T lnum = (linenr_T)tv_get_number_chk(tv, NULL);
|
||||
if (lnum == 0) { // No valid number, try using same function as line() does.
|
||||
int fnum;
|
||||
pos_T *const fp = var2fpos(tv, true, &fnum);
|
||||
|
@ -1477,7 +1477,7 @@ do_set (
|
||||
if (removing) {
|
||||
value = *(long *)varp - value;
|
||||
}
|
||||
errmsg = (char_u *)set_num_option(opt_idx, varp, value,
|
||||
errmsg = (char_u *)set_num_option(opt_idx, varp, (long)value,
|
||||
errbuf, sizeof(errbuf),
|
||||
opt_flags);
|
||||
} else if (opt_idx >= 0) { // String.
|
||||
|
Loading…
Reference in New Issue
Block a user