mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #15774 fix(pvs): fix warnings, script
This commit is contained in:
commit
bc570b0064
@ -373,13 +373,13 @@ run_analysis() {(
|
|||||||
analyze \
|
analyze \
|
||||||
--lic-file PVS-Studio.lic \
|
--lic-file PVS-Studio.lic \
|
||||||
--threads "$(get_jobs_num)" \
|
--threads "$(get_jobs_num)" \
|
||||||
--exclude-path src/nvim/xdiff \
|
--exclude-path src/xdiff \
|
||||||
--output-file PVS-studio.log \
|
--output-file PVS-studio.log \
|
||||||
--file build/compile_commands.json \
|
--file build/compile_commands.json \
|
||||||
--sourcetree-root . || true
|
--sourcetree-root . || true
|
||||||
|
|
||||||
rm -rf PVS-studio.{xml,err,tsk,html.d}
|
rm -rf PVS-studio.{xml,err,tsk,html.d}
|
||||||
local plog_args="PVS-studio.log --srcRoot . --excludedCodes V011,V1042"
|
local plog_args="PVS-studio.log --srcRoot . --excludedCodes V011,V1042,V1051,V1074"
|
||||||
plog-converter $plog_args --renderTypes xml --output PVS-studio.xml
|
plog-converter $plog_args --renderTypes xml --output PVS-studio.xml
|
||||||
plog-converter $plog_args --renderTypes errorfile --output PVS-studio.err
|
plog-converter $plog_args --renderTypes errorfile --output PVS-studio.err
|
||||||
plog-converter $plog_args --renderTypes tasklist --output PVS-studio.tsk
|
plog-converter $plog_args --renderTypes tasklist --output PVS-studio.tsk
|
||||||
|
@ -3112,12 +3112,13 @@ void fileinfo(int fullname, // when non-zero print full path
|
|||||||
(size_t)(IOSIZE - (p - buffer)), true);
|
(size_t)(IOSIZE - (p - buffer)), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool dontwrite = bt_dontwrite(curbuf);
|
||||||
vim_snprintf_add((char *)buffer, IOSIZE, "\"%s%s%s%s%s%s",
|
vim_snprintf_add((char *)buffer, IOSIZE, "\"%s%s%s%s%s%s",
|
||||||
curbufIsChanged()
|
curbufIsChanged()
|
||||||
? (shortmess(SHM_MOD) ? " [+]" : _(" [Modified]")) : " ",
|
? (shortmess(SHM_MOD) ? " [+]" : _(" [Modified]")) : " ",
|
||||||
(curbuf->b_flags & BF_NOTEDITED) && !bt_dontwrite(curbuf)
|
(curbuf->b_flags & BF_NOTEDITED) && !dontwrite
|
||||||
? _("[Not edited]") : "",
|
? _("[Not edited]") : "",
|
||||||
(curbuf->b_flags & BF_NEW) && !bt_dontwrite(curbuf)
|
(curbuf->b_flags & BF_NEW) && !dontwrite
|
||||||
? new_file_message() : "",
|
? new_file_message() : "",
|
||||||
(curbuf->b_flags & BF_READERR)
|
(curbuf->b_flags & BF_READERR)
|
||||||
? _("[Read errors]") : "",
|
? _("[Read errors]") : "",
|
||||||
|
@ -6193,7 +6193,7 @@ int assert_inrange(typval_T *argvars)
|
|||||||
char msg[55];
|
char msg[55];
|
||||||
vim_snprintf(msg, sizeof(msg),
|
vim_snprintf(msg, sizeof(msg),
|
||||||
"range %" PRIdVARNUMBER " - %" PRIdVARNUMBER ",",
|
"range %" PRIdVARNUMBER " - %" PRIdVARNUMBER ",",
|
||||||
lower, upper);
|
lower, upper); // -V576
|
||||||
fill_assert_error(&ga, &argvars[3], (char_u *)msg, NULL, &argvars[2],
|
fill_assert_error(&ga, &argvars[3], (char_u *)msg, NULL, &argvars[2],
|
||||||
ASSERT_INRANGE);
|
ASSERT_INRANGE);
|
||||||
assert_error(&ga);
|
assert_error(&ga);
|
||||||
|
@ -1950,7 +1950,7 @@ static int source_using_linegetter(void *cookie, LineGetter fgetline, const char
|
|||||||
snprintf((char *)sourcing_name_buf, sizeof(sourcing_name_buf),
|
snprintf((char *)sourcing_name_buf, sizeof(sourcing_name_buf),
|
||||||
"%s called at %s:%" PRIdLINENR, traceback_name, save_sourcing_name,
|
"%s called at %s:%" PRIdLINENR, traceback_name, save_sourcing_name,
|
||||||
save_sourcing_lnum);
|
save_sourcing_lnum);
|
||||||
sourcing_name = sourcing_name_buf;
|
sourcing_name = sourcing_name_buf; // -V507 reassigned below, before return.
|
||||||
}
|
}
|
||||||
sourcing_lnum = 0;
|
sourcing_lnum = 0;
|
||||||
|
|
||||||
|
@ -450,11 +450,11 @@ static int put_view(FILE *fd, win_T *wp, int add_edit, unsigned *flagp, int curr
|
|||||||
}
|
}
|
||||||
} else if (fprintf(fd,
|
} else if (fprintf(fd,
|
||||||
"let s:l = %" PRIdLINENR " - ((%" PRIdLINENR
|
"let s:l = %" PRIdLINENR " - ((%" PRIdLINENR
|
||||||
" * winheight(0) + %" PRId64 ") / %" PRId64 ")\n",
|
" * winheight(0) + %d) / %d)\n",
|
||||||
wp->w_cursor.lnum,
|
wp->w_cursor.lnum,
|
||||||
wp->w_cursor.lnum - wp->w_topline,
|
wp->w_cursor.lnum - wp->w_topline,
|
||||||
(int64_t)(wp->w_height_inner / 2),
|
(wp->w_height_inner / 2),
|
||||||
(int64_t)wp->w_height_inner) < 0) {
|
wp->w_height_inner) < 0) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
if (fprintf(fd,
|
if (fprintf(fd,
|
||||||
|
@ -170,6 +170,8 @@ void *xrealloc(void *ptr, size_t size)
|
|||||||
|
|
||||||
/// xmalloc() wrapper that allocates size + 1 bytes and zeroes the last byte
|
/// xmalloc() wrapper that allocates size + 1 bytes and zeroes the last byte
|
||||||
///
|
///
|
||||||
|
/// Commonly used to allocate strings, e.g. `char *s = xmallocz(len)`.
|
||||||
|
///
|
||||||
/// @see {xmalloc}
|
/// @see {xmalloc}
|
||||||
/// @param size
|
/// @param size
|
||||||
/// @return pointer to allocated space. Never NULL
|
/// @return pointer to allocated space. Never NULL
|
||||||
|
Loading…
Reference in New Issue
Block a user