vim-patch:8.2.{210,424,436,...} #15976

* vim-patch:8.2.1082: Coverity complains about ignoring dict_add() return value

Problem:    Coverity complains about ignoring dict_add() return value.
Solution:   Add (void).
91639195ef

N/A patches for version.c:

vim-patch:8.2.0210: Coverity complains about uninitialized field

Problem:    Coverity complains about uninitialized field.
Solution:   Initialize the field.
eed3571fe0

vim-patch:8.2.0424: checking for wrong return value

Problem:    Checking for wrong return value. (Tom)
Solution:   Invert the check and fix the test.
97acfc781b

vim-patch:8.2.0436: no warnings for incorrect printf arguments

Problem:    No warnings for incorrect printf arguments.
Solution:   Fix attribute in declaration.  Fix uncovered mistakes. (Dominique
            Pelle, closes vim/vim#5834)
db99f9f29a

vim-patch:8.2.0498: Coverity complains about uninitialized field

Problem:    Coverity complains about uninitialized field.
Solution:   Initialize the whole typval_T.
4227c789ff

vim-patch:8.2.0668: compiler warning for int/size_t usage

Problem:    Compiler warning for int/size_t usage.
Solution:   Change "int" to "size_t". (Mike Williams)
7f6f56f43c

vim-patch:8.2.1034: compiler warning for uninitialized variables

Problem:    Compiler warning for uninitialized variables.
Solution:   Add initializations. (John Marriott)
38041da1c2

vim-patch:8.2.1117: Coverity warns for unsing unitialized field

Problem:    Coverity warns for unsing unitialized field.
Solution:   Initialize v_lock.
a9a8e5f0dc

vim-patch:8.2.1148: warning for using int instead of size_t

Problem:    Warning for using int instead of size_t.
Solution:   Change "len" argument to size_t. (Mike Williams)
cbb6bdcd89

vim-patch:8.2.1251: Vim9: warning for pointer usage, test failure undetected

Problem:    Vim9: warning for pointer usage, test failure undetected.
Solution:   Fix pointer indirection.  Give error when executing function
            failed for any reason.  Fix instruction names.
682d0a1546

printable_func_name() is applicable but the vim9 changes are N/A.
Compilers can detect misuse of static functions.

vim-patch:8.2.1275: Vim9: compiler warning for buffer size

Problem:    Vim9: compiler warning for buffer size.
Solution:   Change the offset from 10 to 15. (Dominique Pellé, closes vim/vim#6518)
5a67c37a55

vim-patch:8.2.1443: Vim9: crash when interrupting a nested :def function

Problem:    Vim9: crash when interrupting a nested :def function.
Solution:   Push a dummy return value onto the stack. (closes vim/vim#6701)
cdd70f09a5

vim-patch:8.2.1818: SE Linux: deprecation warning for security_context_t

Problem:    SE Linux: deprecation warning for security_context_t.
Solution:   Use "char *" instead. (James McCoy, closes vim/vim#7093)
8956023920

SELINUX support was removed in commit 1de77bbcec

vim-patch:8.2.2004: compiler warning for uninitialized variable

Problem:    Compiler warning for uninitialized variable.
Solution:   Initialize "ufunc". (John Marriott)
b3a01946b3

vim-patch:8.2.2051: Vim9: crash when aborting a user function call

Problem:    Vim9: crash when aborting a user function call.
Solution:   Do not use the return value when aboring. (closes vim/vim#7372)
34c54eb6cb

vim-patch:8.2.2270: warning for size_t to int conversion

Problem:    Warning for size_t to int conversion. (Randall W. Morris)
Solution:   Add a type cast.
38a434f7ba

vim-patch:8.2.2333: Vim9: warning for uninitialized variable

Problem:    Vim9: warning for uninitialized variable. (Tony Mechelynck)
Solution:   Initialize "res".
cb6cbf29e9

vim-patch:8.2.2460: Coverity warns for unused value

Problem:    Coverity warns for unused value.
Solution:   Do not reset the return value to OK.
fc1dafa91c

vim-patch:8.2.2461: Coverity warns for unchecked return value

Problem:    Coverity warns for unchecked return value.
Solution:   Add "(void)" to avoid the warning.
fef8064b54

vim-patch:8.2.2557: compiler warning for shadowd variable

Problem:    Compiler warning for shadowd variable.
Solution:   Declare "p" only once.
087b5ff35d

vim-patch:8.2.2730: Coverity complains about not restoring character

Problem:    Coverity complains about not restoring character.
Solution:   Also restore the character in case of an error.
c9605f0595

vim-patch:8.2.2795: Coverity warns for not using return value

Problem:    Coverity warns for not using return value.
Solution:   Check the return value of compiling the substitute expression.
169502fb0b

vim-patch:8.2.2995: linker errors with dynamic Python 3.10

Problem:    Linker errors with dynamic Python 3.10.
Solution:   Add a couple of library entries. (Zdenek Dohnal, closes vim/vim#8381,
            closes vim/vim#8356)
90478f35a8

vim-patch:8.2.3000: Vim9: warning for uninitialized variable

Problem:    Vim9: warning for uninitialized variable.
Solution:   Add initialization. (John Marriott)
3b814af7e1

vim-patch:8.2.3014: Coverity warns for freeing static string

Problem:    Coverity warns for freeing static string.
Solution:   Do not assign static string to pointer. (Dominique Pellé,
            closes vim/vim#8397)
6e9695525e

vim-patch:8.2.3205: Coverity reports a null pointer dereference

Problem:    Coverity reports a null pointer dereference.
Solution:   Change the logic to avoid Coverity gets confused.
1b862c466b

vim-patch:8.2.3294: Lua: memory leak when adding dict item fails

Problem:    Lua: memory leak when adding dict item fails.
Solution:   Free the typval and the dict item.
1b6acf02b7

vim-patch:8.2.3302: Coverity is not run from github

Problem:    Coverity is not run from github.
Solution:   Add a coverity script. (James McCoy, closes vim/vim#8714)
d57a6bd98c

vim-patch:8.2.3319: Coverity action on github does not work

Problem:    Coverity action on github does not work.
Solution:   Remove undefined $SRCDIR. (James McCoy, closes vim/vim#8739)
eed9616120

* vim-patch:8.2.1085: Coverity complains about ignoring dict_add() return value

Problem:    Coverity complains about ignoring dict_add() return value.
Solution:   Add (void).
6d90c61c5a
This commit is contained in:
Jan Edmund Lazo
2021-10-09 19:40:11 -04:00
committed by GitHub
parent 5940a3415b
commit 65b8232260
2 changed files with 11 additions and 10 deletions

View File

@@ -7296,7 +7296,7 @@ static void f_getreginfo(typval_T *argvars, typval_T *rettv, FunPtr fptr)
if (list == NULL) { if (list == NULL) {
return; return;
} }
tv_dict_add_list(dict, S_LEN("regcontents"), list); (void)tv_dict_add_list(dict, S_LEN("regcontents"), list);
char buf[NUMBUFLEN + 2]; char buf[NUMBUFLEN + 2];
buf[0] = NUL; buf[0] = NUL;
@@ -7315,14 +7315,15 @@ static void f_getreginfo(typval_T *argvars, typval_T *rettv, FunPtr fptr)
case kMTUnknown: case kMTUnknown:
abort(); abort();
} }
tv_dict_add_str(dict, S_LEN("regtype"), buf); (void)tv_dict_add_str(dict, S_LEN("regtype"), buf);
buf[0] = get_register_name(get_unname_register()); buf[0] = get_register_name(get_unname_register());
buf[1] = NUL; buf[1] = NUL;
if (regname == '"') { if (regname == '"') {
tv_dict_add_str(dict, S_LEN("points_to"), buf); (void)tv_dict_add_str(dict, S_LEN("points_to"), buf);
} else { } else {
tv_dict_add_bool(dict, S_LEN("isunnamed"), regname == buf[0] ? kBoolVarTrue : kBoolVarFalse); (void)tv_dict_add_bool(dict, S_LEN("isunnamed"),
regname == buf[0] ? kBoolVarTrue : kBoolVarFalse);
} }
} }

View File

@@ -2817,17 +2817,17 @@ static void do_autocmd_textyankpost(oparg_T *oap, yankreg_T *reg)
tv_list_append_string(list, (const char *)reg->y_array[i], -1); tv_list_append_string(list, (const char *)reg->y_array[i], -1);
} }
tv_list_set_lock(list, VAR_FIXED); tv_list_set_lock(list, VAR_FIXED);
tv_dict_add_list(dict, S_LEN("regcontents"), list); (void)tv_dict_add_list(dict, S_LEN("regcontents"), list);
// Register type. // Register type.
char buf[NUMBUFLEN+2]; char buf[NUMBUFLEN+2];
format_reg_type(reg->y_type, reg->y_width, buf, ARRAY_SIZE(buf)); format_reg_type(reg->y_type, reg->y_width, buf, ARRAY_SIZE(buf));
tv_dict_add_str(dict, S_LEN("regtype"), buf); (void)tv_dict_add_str(dict, S_LEN("regtype"), buf);
// Name of requested register, or empty string for unnamed operation. // Name of requested register, or empty string for unnamed operation.
buf[0] = (char)oap->regname; buf[0] = (char)oap->regname;
buf[1] = NUL; buf[1] = NUL;
tv_dict_add_str(dict, S_LEN("regname"), buf); (void)tv_dict_add_str(dict, S_LEN("regname"), buf);
// Motion type: inclusive or exclusive. // Motion type: inclusive or exclusive.
tv_dict_add_bool(dict, S_LEN("inclusive"), tv_dict_add_bool(dict, S_LEN("inclusive"),
@@ -2836,10 +2836,10 @@ static void do_autocmd_textyankpost(oparg_T *oap, yankreg_T *reg)
// Kind of operation: yank, delete, change). // Kind of operation: yank, delete, change).
buf[0] = (char)get_op_char(oap->op_type); buf[0] = (char)get_op_char(oap->op_type);
buf[1] = NUL; buf[1] = NUL;
tv_dict_add_str(dict, S_LEN("operator"), buf); (void)tv_dict_add_str(dict, S_LEN("operator"), buf);
// Selection type: visual or not. // Selection type: visual or not.
tv_dict_add_bool(dict, S_LEN("visual"), (void)tv_dict_add_bool(dict, S_LEN("visual"),
oap->is_VIsual ? kBoolVarTrue : kBoolVarFalse); oap->is_VIsual ? kBoolVarTrue : kBoolVarFalse);
tv_dict_set_keys_readonly(dict); tv_dict_set_keys_readonly(dict);