mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
refactor: fix clang/PVS warnings (#24213)
This commit is contained in:
parent
d191bdf9d5
commit
2493815290
@ -709,7 +709,7 @@ static void set_option_to(uint64_t channel_id, void *to, int type, String name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OptVal optval = NIL_OPTVAL;
|
OptVal optval;
|
||||||
|
|
||||||
if (flags & SOPT_BOOL) {
|
if (flags & SOPT_BOOL) {
|
||||||
VALIDATE(value.type == kObjectTypeBoolean, "Option '%s' value must be Boolean", name.data, {
|
VALIDATE(value.type == kObjectTypeBoolean, "Option '%s' value must be Boolean", name.data, {
|
||||||
|
@ -735,10 +735,10 @@ static void get_statuscol_display_info(statuscol_T *stcp, winlinevars_T *wlv)
|
|||||||
wlv->draw_state = WL_STC;
|
wlv->draw_state = WL_STC;
|
||||||
wlv->char_attr = stcp->cur_attr;
|
wlv->char_attr = stcp->cur_attr;
|
||||||
wlv->p_extra = stcp->textp;
|
wlv->p_extra = stcp->textp;
|
||||||
wlv->n_extra =
|
char *const section_end = stcp->hlrecp->start ? stcp->hlrecp->start : stcp->text_end;
|
||||||
(int)((stcp->hlrecp->start ? stcp->hlrecp->start : stcp->text_end) - stcp->textp);
|
wlv->n_extra = (int)(section_end - stcp->textp);
|
||||||
// Prepare for next highlight section if not yet at the end
|
// Prepare for next highlight section if not yet at the end
|
||||||
if (stcp->textp + wlv->n_extra < stcp->text_end) {
|
if (section_end < stcp->text_end) {
|
||||||
int hl = stcp->hlrecp->userhl;
|
int hl = stcp->hlrecp->userhl;
|
||||||
stcp->textp = stcp->hlrecp->start;
|
stcp->textp = stcp->hlrecp->start;
|
||||||
stcp->cur_attr = hl < 0 ? syn_id2attr(-hl) : stcp->num_attr;
|
stcp->cur_attr = hl < 0 ? syn_id2attr(-hl) : stcp->num_attr;
|
||||||
|
@ -673,6 +673,7 @@ int tv_list_assign_range(list_T *const dest, list_T *const src, const long idx1_
|
|||||||
idx = idx1;
|
idx = idx1;
|
||||||
dest_li = first_li;
|
dest_li = first_li;
|
||||||
for (src_li = tv_list_first(src); src_li != NULL;) {
|
for (src_li = tv_list_first(src); src_li != NULL;) {
|
||||||
|
assert(dest_li != NULL);
|
||||||
if (op != NULL && *op != '=') {
|
if (op != NULL && *op != '=') {
|
||||||
eexe_mod_op(TV_LIST_ITEM_TV(dest_li), TV_LIST_ITEM_TV(src_li), op);
|
eexe_mod_op(TV_LIST_ITEM_TV(dest_li), TV_LIST_ITEM_TV(src_li), op);
|
||||||
} else {
|
} else {
|
||||||
@ -683,7 +684,6 @@ int tv_list_assign_range(list_T *const dest, list_T *const src, const long idx1_
|
|||||||
if (src_li == NULL || (!empty_idx2 && idx2 == idx)) {
|
if (src_li == NULL || (!empty_idx2 && idx2 == idx)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
assert(dest_li != NULL);
|
|
||||||
if (TV_LIST_ITEM_NEXT(dest, dest_li) == NULL) {
|
if (TV_LIST_ITEM_NEXT(dest, dest_li) == NULL) {
|
||||||
// Need to add an empty item.
|
// Need to add an empty item.
|
||||||
tv_list_append_number(dest, 0);
|
tv_list_append_number(dest, 0);
|
||||||
@ -1622,7 +1622,7 @@ const char *tv_list_find_str(list_T *const l, const int n)
|
|||||||
|
|
||||||
/// Like tv_list_find() but when a negative index is used that is not found use
|
/// Like tv_list_find() but when a negative index is used that is not found use
|
||||||
/// zero and set "idx" to zero. Used for first index of a range.
|
/// zero and set "idx" to zero. Used for first index of a range.
|
||||||
listitem_T *tv_list_find_index(list_T *const l, long *const idx)
|
static listitem_T *tv_list_find_index(list_T *const l, long *const idx)
|
||||||
FUNC_ATTR_WARN_UNUSED_RESULT
|
FUNC_ATTR_WARN_UNUSED_RESULT
|
||||||
{
|
{
|
||||||
listitem_T *li = tv_list_find(l, (int)(*idx));
|
listitem_T *li = tv_list_find(l, (int)(*idx));
|
||||||
|
@ -1175,7 +1175,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char *fword, bool soun
|
|||||||
// word).
|
// word).
|
||||||
int depth = 0;
|
int depth = 0;
|
||||||
trystate_T *sp = &stack[0];
|
trystate_T *sp = &stack[0];
|
||||||
CLEAR_POINTER(sp); // -V1068
|
CLEAR_POINTER(sp); // -V1086
|
||||||
sp->ts_curi = 1;
|
sp->ts_curi = 1;
|
||||||
|
|
||||||
if (soundfold) {
|
if (soundfold) {
|
||||||
|
Loading…
Reference in New Issue
Block a user