mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
PVS/V547: expression is always true/false #10640
Functions marked with FUNC_ATTR_NONNULL_RET do not return NULL. Remove redundant checks.
This commit is contained in:
parent
f5b5f60b86
commit
00d915d021
@ -16064,9 +16064,6 @@ static void f_sign_jump(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
sign_group = NULL; // global sign group
|
sign_group = NULL; // global sign group
|
||||||
} else {
|
} else {
|
||||||
sign_group = xstrdup(sign_group_chk);
|
sign_group = xstrdup(sign_group_chk);
|
||||||
if (sign_group == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Buffer to place the sign
|
// Buffer to place the sign
|
||||||
@ -16115,9 +16112,6 @@ static void f_sign_place(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
group = NULL; // global sign group
|
group = NULL; // global sign group
|
||||||
} else {
|
} else {
|
||||||
group = vim_strsave((const char_u *)group_chk);
|
group = vim_strsave((const char_u *)group_chk);
|
||||||
if (group == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sign name
|
// Sign name
|
||||||
@ -16210,9 +16204,6 @@ static void f_sign_unplace(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
group = NULL; // global sign group
|
group = NULL; // global sign group
|
||||||
} else {
|
} else {
|
||||||
group = vim_strsave((const char_u *)group_chk);
|
group = vim_strsave((const char_u *)group_chk);
|
||||||
if (group == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argvars[1].v_type != VAR_UNKNOWN) {
|
if (argvars[1].v_type != VAR_UNKNOWN) {
|
||||||
|
@ -1793,17 +1793,14 @@ void ex_args(exarg_T *eap)
|
|||||||
// ":args": list arguments.
|
// ":args": list arguments.
|
||||||
if (ARGCOUNT > 0) {
|
if (ARGCOUNT > 0) {
|
||||||
char_u **items = xmalloc(sizeof(char_u *) * (size_t)ARGCOUNT);
|
char_u **items = xmalloc(sizeof(char_u *) * (size_t)ARGCOUNT);
|
||||||
|
// Overwrite the command, for a short list there is no scrolling
|
||||||
if (items != NULL) {
|
// required and no wait_return().
|
||||||
// Overwrite the command, for a short list there is no scrolling
|
gotocmdline(true);
|
||||||
// required and no wait_return().
|
for (int i = 0; i < ARGCOUNT; i++) {
|
||||||
gotocmdline(true);
|
items[i] = alist_name(&ARGLIST[i]);
|
||||||
for (int i = 0; i < ARGCOUNT; i++) {
|
|
||||||
items[i] = alist_name(&ARGLIST[i]);
|
|
||||||
}
|
|
||||||
list_in_columns(items, ARGCOUNT, curwin->w_arg_idx);
|
|
||||||
xfree(items);
|
|
||||||
}
|
}
|
||||||
|
list_in_columns(items, ARGCOUNT, curwin->w_arg_idx);
|
||||||
|
xfree(items);
|
||||||
}
|
}
|
||||||
} else if (eap->cmdidx == CMD_arglocal) {
|
} else if (eap->cmdidx == CMD_arglocal) {
|
||||||
garray_T *gap = &curwin->w_alist->al_ga;
|
garray_T *gap = &curwin->w_alist->al_ga;
|
||||||
|
@ -253,11 +253,7 @@ char_u * sign_typenr2name(int typenr)
|
|||||||
/// Return information about a sign in a Dict
|
/// Return information about a sign in a Dict
|
||||||
dict_T * sign_get_info(signlist_T *sign)
|
dict_T * sign_get_info(signlist_T *sign)
|
||||||
{
|
{
|
||||||
dict_T *d;
|
dict_T *d = tv_dict_alloc();
|
||||||
|
|
||||||
if ((d = tv_dict_alloc()) == NULL) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
tv_dict_add_nr(d, S_LEN("id"), sign->id);
|
tv_dict_add_nr(d, S_LEN("id"), sign->id);
|
||||||
tv_dict_add_str(d, S_LEN("group"), ((sign->group == NULL)
|
tv_dict_add_str(d, S_LEN("group"), ((sign->group == NULL)
|
||||||
? (char *)""
|
? (char *)""
|
||||||
|
Loading…
Reference in New Issue
Block a user