*: Fix conversion warnings for tv_get_number*()

This commit is contained in:
James McCoy 2017-06-06 14:30:48 -04:00
parent bf4de3f6f7
commit af59a290d8
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB
3 changed files with 4 additions and 4 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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.