mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
refactor: suppress clang and PVS warnings (#19940)
This commit is contained in:
@@ -8148,6 +8148,7 @@ repeat:
|
|||||||
// Only replace it when it starts with '~'
|
// Only replace it when it starts with '~'
|
||||||
if (*dirname == '~') {
|
if (*dirname == '~') {
|
||||||
s = xstrdup(dirname);
|
s = xstrdup(dirname);
|
||||||
|
assert(s != NULL); // suppress clang "Argument with 'nonnull' attribute passed null"
|
||||||
*fnamep = s;
|
*fnamep = s;
|
||||||
xfree(*bufp);
|
xfree(*bufp);
|
||||||
*bufp = s;
|
*bufp = s;
|
||||||
|
@@ -1252,7 +1252,7 @@ static void do_sort_uniq(typval_T *argvars, typval_T *rettv, bool sort)
|
|||||||
idx++;
|
idx++;
|
||||||
li = TV_LIST_ITEM_NEXT(l, li);
|
li = TV_LIST_ITEM_NEXT(l, li);
|
||||||
}
|
}
|
||||||
if (info.item_compare_func_err) {
|
if (info.item_compare_func_err) { // -V547
|
||||||
emsg(_("E882: Uniq compare function failed"));
|
emsg(_("E882: Uniq compare function failed"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -791,6 +791,7 @@ static void ex_unletlock(exarg_T *eap, char *argstart, int deep, ex_unletlock_ca
|
|||||||
semsg(_(e_invarg2), arg - 1);
|
semsg(_(e_invarg2), arg - 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
assert(*lv.ll_name == '$'); // suppress clang "Uninitialized argument value"
|
||||||
if (!error && !eap->skip && callback(&lv, arg, eap, deep) == FAIL) {
|
if (!error && !eap->skip && callback(&lv, arg, eap, deep) == FAIL) {
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
|
@@ -640,6 +640,7 @@ static char_u *ins_compl_infercase_gettext(char_u *str, int char_len, int compl_
|
|||||||
while (i < char_len) {
|
while (i < char_len) {
|
||||||
if (gap.ga_data != NULL) {
|
if (gap.ga_data != NULL) {
|
||||||
ga_grow(&gap, 10);
|
ga_grow(&gap, 10);
|
||||||
|
assert(gap.ga_data != NULL); // suppress clang "Dereference of NULL pointer"
|
||||||
p = (char *)gap.ga_data + gap.ga_len;
|
p = (char *)gap.ga_data + gap.ga_len;
|
||||||
gap.ga_len += utf_char2bytes(wca[i++], p);
|
gap.ga_len += utf_char2bytes(wca[i++], p);
|
||||||
} else if ((p - (char *)IObuff) + 6 >= IOSIZE) {
|
} else if ((p - (char *)IObuff) + 6 >= IOSIZE) {
|
||||||
|
Reference in New Issue
Block a user