*: Fix linter errors

This commit is contained in:
ZyX
2017-12-11 10:19:20 +03:00
parent d46e37cb4c
commit f4132fb38b
8 changed files with 29 additions and 25 deletions

View File

@@ -1540,7 +1540,8 @@ ex_let_vars (
listitem_T *item = tv_list_first(l);
while (*arg != ']') {
arg = skipwhite(arg + 1);
arg = ex_let_one(arg, TV_LIST_ITEM_TV(item), TRUE, (char_u *)",;]", nextchars);
arg = ex_let_one(arg, TV_LIST_ITEM_TV(item), true, (const char_u *)",;]",
nextchars);
item = TV_LIST_ITEM_NEXT(l, item);
if (arg == NULL) {
return FAIL;
@@ -2415,13 +2416,14 @@ static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv,
lp->ll_li = TV_LIST_ITEM_NEXT(lp->ll_list, lp->ll_li);
lp->ll_n1++;
}
if (ri != NULL)
if (ri != NULL) {
EMSG(_("E710: List value has more items than target"));
else if (lp->ll_empty2
} else if (lp->ll_empty2
? (lp->ll_li != NULL
&& TV_LIST_ITEM_NEXT(lp->ll_list, lp->ll_li) != NULL)
: lp->ll_n1 != lp->ll_n2)
: lp->ll_n1 != lp->ll_n2) {
EMSG(_("E711: List value has not enough items"));
}
} else {
typval_T oldtv = TV_INITIAL_VALUE;
dict_T *dict = lp->ll_dict;
@@ -8561,8 +8563,9 @@ static void filter_map(typval_T *argvars, typval_T *rettv, int map)
nli = TV_LIST_ITEM_NEXT(l, li);
vimvars[VV_KEY].vv_nr = idx;
if (filter_map_one(TV_LIST_ITEM_TV(li), expr, map, &rem) == FAIL
|| did_emsg)
|| did_emsg) {
break;
}
if (!map && rem) {
tv_list_item_remove(l, li);
}
@@ -19235,9 +19238,9 @@ int var_item_copy(const vimconv_T *const conv,
case VAR_LIST:
to->v_type = VAR_LIST;
to->v_lock = 0;
if (from->vval.v_list == NULL)
if (from->vval.v_list == NULL) {
to->vval.v_list = NULL;
else if (copyID != 0 && tv_list_copyid(from->vval.v_list) == copyID) {
} else if (copyID != 0 && tv_list_copyid(from->vval.v_list) == copyID) {
// Use the copy made earlier.
to->vval.v_list = tv_list_latest_copy(from->vval.v_list);
tv_list_ref(to->vval.v_list);
@@ -22400,7 +22403,7 @@ typval_T eval_call_provider(char *provider, char *method, list_T *arguments)
{.v_type = VAR_LIST, .vval.v_list = arguments, .v_lock = 0},
{.v_type = VAR_UNKNOWN}
};
typval_T rettv = {.v_type = VAR_UNKNOWN, .v_lock = 0};
typval_T rettv = { .v_type = VAR_UNKNOWN, .v_lock = VAR_UNLOCKED };
tv_list_ref(arguments);
int dummy;

View File

@@ -696,8 +696,8 @@ bool tv_list_equal(list_T *const l1, list_T *const l2, const bool ic,
listitem_T *item1 = tv_list_first(l1);
listitem_T *item2 = tv_list_first(l2);
for (; item1 != NULL && item2 != NULL
; item1 = TV_LIST_ITEM_NEXT(l1, item1),
item2 = TV_LIST_ITEM_NEXT(n2, item2)) {
; (item1 = TV_LIST_ITEM_NEXT(l1, item1),
item2 = TV_LIST_ITEM_NEXT(n2, item2))) {
if (!tv_equal(TV_LIST_ITEM_TV(item1), TV_LIST_ITEM_TV(item2), ic,
recursive)) {
return false;

View File

@@ -586,9 +586,10 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE(
}
size_t len;
char *buf;
if (!encode_vim_list_to_buf(
if (!(
encode_vim_list_to_buf(
TV_LIST_ITEM_TV(tv_list_last(val_list))->vval.v_list, &len,
&buf)) {
&buf))) {
goto _convert_one_value_regular_dict;
}
TYPVAL_ENCODE_CONV_EXT_STRING(tv, buf, len, type);
@@ -721,7 +722,8 @@ typval_encode_stop_converting_one_item:
TV_LIST_ITEM_TV(cur_mpsv->data.l.li)->vval.v_list);
TYPVAL_ENCODE_SPECIAL_DICT_KEY_CHECK(
encode_vim_to__error_ret, *TV_LIST_ITEM_TV(tv_list_first(kv_pair)));
if (_TYPVAL_ENCODE_CONVERT_ONE_VALUE(
if (
_TYPVAL_ENCODE_CONVERT_ONE_VALUE(
TYPVAL_ENCODE_FIRST_ARG_NAME, &mpstack, cur_mpsv,
TV_LIST_ITEM_TV(tv_list_first(kv_pair)), copyID, objname)
== FAIL) {

View File

@@ -5577,8 +5577,7 @@ int match_add(win_T *wp, const char *const grp, const char *const pat,
}
// Set up position matches
if (pos_list != NULL)
{
if (pos_list != NULL) {
linenr_T toplnum = 0;
linenr_T botlnum = 0;