mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.1102: Coverity gets confused by an unnecessary NULL check
Problem: Coverity gets confused by an unnecessary NULL check.
Solution: Remove the check for NULL.
9004949221
This commit is contained in:
parent
a67bcb3fbf
commit
b7cd7e0e5c
@ -8147,15 +8147,17 @@ static void f_setline(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
/// Create quickfix/location list from VimL values
|
/// Create quickfix/location list from VimL values
|
||||||
///
|
///
|
||||||
/// Used by `setqflist()` and `setloclist()` functions. Accepts invalid
|
/// Used by `setqflist()` and `setloclist()` functions. Accepts invalid
|
||||||
/// list_arg, action_arg and what_arg arguments in which case errors out,
|
/// args argument in which case errors out, including VAR_UNKNOWN parameters.
|
||||||
/// including VAR_UNKNOWN parameters.
|
|
||||||
///
|
///
|
||||||
/// @param[in,out] wp Window to create location list for. May be NULL in
|
/// @param[in,out] wp Window to create location list for. May be NULL in
|
||||||
/// which case quickfix list will be created.
|
/// which case quickfix list will be created.
|
||||||
/// @param[in] list_arg Quickfix list contents.
|
/// @param[in] args [list, action, what]
|
||||||
/// @param[in] action_arg Action to perform: append to an existing list,
|
/// @param[in] args[0] Quickfix list contents.
|
||||||
/// replace its content or create a new one.
|
/// @param[in] args[1] Optional. Action to perform:
|
||||||
/// @param[in] title_arg New list title. Defaults to caller function name.
|
/// append to an existing list, replace its content,
|
||||||
|
/// or create a new one.
|
||||||
|
/// @param[in] args[2] Optional. Quickfix list properties or title.
|
||||||
|
/// Defaults to caller function name.
|
||||||
/// @param[out] rettv Return value: 0 in case of success, -1 otherwise.
|
/// @param[out] rettv Return value: 0 in case of success, -1 otherwise.
|
||||||
static void set_qf_ll_list(win_T *wp, typval_T *args, typval_T *rettv)
|
static void set_qf_ll_list(win_T *wp, typval_T *args, typval_T *rettv)
|
||||||
FUNC_ATTR_NONNULL_ARG(2, 3)
|
FUNC_ATTR_NONNULL_ARG(2, 3)
|
||||||
@ -8165,7 +8167,7 @@ static void set_qf_ll_list(win_T *wp, typval_T *args, typval_T *rettv)
|
|||||||
int action = ' ';
|
int action = ' ';
|
||||||
static int recursive = 0;
|
static int recursive = 0;
|
||||||
rettv->vval.v_number = -1;
|
rettv->vval.v_number = -1;
|
||||||
dict_T *d = NULL;
|
dict_T *what = NULL;
|
||||||
|
|
||||||
typval_T *list_arg = &args[0];
|
typval_T *list_arg = &args[0];
|
||||||
if (list_arg->v_type != VAR_LIST) {
|
if (list_arg->v_type != VAR_LIST) {
|
||||||
@ -8193,18 +8195,18 @@ static void set_qf_ll_list(win_T *wp, typval_T *args, typval_T *rettv)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
typval_T *title_arg = &args[2];
|
typval_T *const what_arg = &args[2];
|
||||||
if (title_arg->v_type == VAR_UNKNOWN) {
|
if (what_arg->v_type == VAR_UNKNOWN) {
|
||||||
// Option argument was not given.
|
// Option argument was not given.
|
||||||
goto skip_args;
|
goto skip_args;
|
||||||
} else if (title_arg->v_type == VAR_STRING) {
|
} else if (what_arg->v_type == VAR_STRING) {
|
||||||
title = tv_get_string_chk(title_arg);
|
title = tv_get_string_chk(what_arg);
|
||||||
if (!title) {
|
if (!title) {
|
||||||
// Type error. Error already printed by tv_get_string_chk().
|
// Type error. Error already printed by tv_get_string_chk().
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (title_arg->v_type == VAR_DICT) {
|
} else if (what_arg->v_type == VAR_DICT && what_arg->vval.v_dict != NULL) {
|
||||||
d = title_arg->vval.v_dict;
|
what = what_arg->vval.v_dict;
|
||||||
} else {
|
} else {
|
||||||
EMSG(_(e_dictreq));
|
EMSG(_(e_dictreq));
|
||||||
return;
|
return;
|
||||||
@ -8217,7 +8219,7 @@ skip_args:
|
|||||||
|
|
||||||
recursive++;
|
recursive++;
|
||||||
list_T *const l = list_arg->vval.v_list;
|
list_T *const l = list_arg->vval.v_list;
|
||||||
if (set_errorlist(wp, l, action, (char_u *)title, d) == OK) {
|
if (set_errorlist(wp, l, action, (char_u *)title, what) == OK) {
|
||||||
rettv->vval.v_number = 0;
|
rettv->vval.v_number = 0;
|
||||||
}
|
}
|
||||||
recursive--;
|
recursive--;
|
||||||
|
@ -6317,6 +6317,7 @@ static void qf_free_stack(win_T *wp, qf_info_T *qi)
|
|||||||
// Populate the quickfix list with the items supplied in the list
|
// Populate the quickfix list with the items supplied in the list
|
||||||
// of dictionaries. "title" will be copied to w:quickfix_title
|
// of dictionaries. "title" will be copied to w:quickfix_title
|
||||||
// "action" is 'a' for add, 'r' for replace. Otherwise create a new list.
|
// "action" is 'a' for add, 'r' for replace. Otherwise create a new list.
|
||||||
|
// When "what" is not NULL then only set some properties.
|
||||||
int set_errorlist(win_T *wp, list_T *list, int action, char_u *title,
|
int set_errorlist(win_T *wp, list_T *list, int action, char_u *title,
|
||||||
dict_T *what)
|
dict_T *what)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user