diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_cmds.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_getln.c | 2 | ||||
-rw-r--r-- | src/nvim/globals.h | 13 | ||||
-rw-r--r-- | src/nvim/path.c | 2 |
4 files changed, 10 insertions, 9 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 85844c37bd..7bc9a9244f 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -4895,7 +4895,7 @@ int find_help_tags(const char_u *arg, int *num_matches, char_u ***matches, } } - *matches = (char_u **)""; + *matches = &vim_emptystr; *num_matches = 0; int flags = TAG_HELP | TAG_REGEXP | TAG_NAMES | TAG_VERBOSE; if (keep_lang) { diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 32620ac3c2..adba3d4e7e 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -4702,7 +4702,7 @@ ExpandFromContext ( return ret; } - *file = (char_u **)""; + *file = &vim_emptystr; *num_file = 0; if (xp->xp_context == EXPAND_HELP) { /* With an empty argument we would get all the help tags, which is diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 2550fb8163..2509c727d6 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -1072,17 +1072,18 @@ EXTERN char_u e_cmdmap_key[] INIT(=N_( EXTERN char top_bot_msg[] INIT(= N_("search hit TOP, continuing at BOTTOM")); EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP")); -/* For undo we need to know the lowest time possible. */ +// For undo we need to know the lowest time possible. EXTERN time_t starttime; EXTERN FILE *time_fd INIT(= NULL); /* where to write startup timing */ -/* - * Some compilers warn for not using a return value, but in some situations we - * can't do anything useful with the value. Assign to this variable to avoid - * the warning. - */ +// Some compilers warn for not using a return value, but in some situations we +// can't do anything useful with the value. Assign to this variable to avoid +// the warning. EXTERN int vim_ignored; +// Use this to avoid PVS warning V1032 for code like this: +// *foo = (char_u **)""; +EXTERN char_u *vim_emptystr INIT(= (char_u *)""); // Start a msgpack-rpc channel over stdin/stdout. EXTERN bool embedded_mode INIT(= false); diff --git a/src/nvim/path.c b/src/nvim/path.c index de697642c7..7f5dbe5c02 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -1267,7 +1267,7 @@ int gen_expand_wildcards(int num_pat, char_u **pat, int *num_file, } *num_file = ga.ga_len; - *file = (ga.ga_data != NULL) ? (char_u **)ga.ga_data : (char_u **)""; + *file = (ga.ga_data != NULL) ? (char_u **)ga.ga_data : &vim_emptystr; recursive = false; |