mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
Merge #15774 fix(pvs): fix warnings, script
This commit is contained in:
@@ -3112,12 +3112,13 @@ void fileinfo(int fullname, // when non-zero print full path
|
||||
(size_t)(IOSIZE - (p - buffer)), true);
|
||||
}
|
||||
|
||||
bool dontwrite = bt_dontwrite(curbuf);
|
||||
vim_snprintf_add((char *)buffer, IOSIZE, "\"%s%s%s%s%s%s",
|
||||
curbufIsChanged()
|
||||
? (shortmess(SHM_MOD) ? " [+]" : _(" [Modified]")) : " ",
|
||||
(curbuf->b_flags & BF_NOTEDITED) && !bt_dontwrite(curbuf)
|
||||
(curbuf->b_flags & BF_NOTEDITED) && !dontwrite
|
||||
? _("[Not edited]") : "",
|
||||
(curbuf->b_flags & BF_NEW) && !bt_dontwrite(curbuf)
|
||||
(curbuf->b_flags & BF_NEW) && !dontwrite
|
||||
? new_file_message() : "",
|
||||
(curbuf->b_flags & BF_READERR)
|
||||
? _("[Read errors]") : "",
|
||||
|
@@ -6193,7 +6193,7 @@ int assert_inrange(typval_T *argvars)
|
||||
char msg[55];
|
||||
vim_snprintf(msg, sizeof(msg),
|
||||
"range %" PRIdVARNUMBER " - %" PRIdVARNUMBER ",",
|
||||
lower, upper);
|
||||
lower, upper); // -V576
|
||||
fill_assert_error(&ga, &argvars[3], (char_u *)msg, NULL, &argvars[2],
|
||||
ASSERT_INRANGE);
|
||||
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),
|
||||
"%s called at %s:%" PRIdLINENR, traceback_name, save_sourcing_name,
|
||||
save_sourcing_lnum);
|
||||
sourcing_name = sourcing_name_buf;
|
||||
sourcing_name = sourcing_name_buf; // -V507 reassigned below, before return.
|
||||
}
|
||||
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,
|
||||
"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_topline,
|
||||
(int64_t)(wp->w_height_inner / 2),
|
||||
(int64_t)wp->w_height_inner) < 0) {
|
||||
(wp->w_height_inner / 2),
|
||||
wp->w_height_inner) < 0) {
|
||||
return FAIL;
|
||||
}
|
||||
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
|
||||
///
|
||||
/// Commonly used to allocate strings, e.g. `char *s = xmallocz(len)`.
|
||||
///
|
||||
/// @see {xmalloc}
|
||||
/// @param size
|
||||
/// @return pointer to allocated space. Never NULL
|
||||
|
Reference in New Issue
Block a user