aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-09-21 06:02:53 +0800
committerGitHub <noreply@github.com>2022-09-21 06:02:53 +0800
commit585ab2564ada61c03443ed8f5709d2e5c8e0812a (patch)
treef7e0441f881d961215ceca32b621ce6dfec78765
parentec94014cd1d09884b12cb19021d5a1eff52cb76d (diff)
downloadrneovim-585ab2564ada61c03443ed8f5709d2e5c8e0812a.tar.gz
rneovim-585ab2564ada61c03443ed8f5709d2e5c8e0812a.tar.bz2
rneovim-585ab2564ada61c03443ed8f5709d2e5c8e0812a.zip
refactor: suppress PVS false positives (#20264)
Some V512 warnings have changed to V1086, and PVS apparently does not know `uv_run()` can change `*timeout_expired`.
-rw-r--r--src/nvim/drawline.c2
-rw-r--r--src/nvim/event/loop.c4
-rw-r--r--src/nvim/memline.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 9de8b9996a..25ea2e1000 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -894,7 +894,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange,
} else {
// Long line, use only the last SPWORDLEN bytes.
nextlinecol = (int)v - SPWORDLEN;
- memmove(nextline, line + nextlinecol, SPWORDLEN); // -V512
+ memmove(nextline, line + nextlinecol, SPWORDLEN); // -V1086
nextline_idx = SPWORDLEN + 1;
}
}
diff --git a/src/nvim/event/loop.c b/src/nvim/event/loop.c
index eff120331e..3329cbd574 100644
--- a/src/nvim/event/loop.c
+++ b/src/nvim/event/loop.c
@@ -58,9 +58,9 @@ bool loop_uv_run(Loop *loop, int ms, bool once)
mode = UV_RUN_NOWAIT;
}
- do {
+ do { // -V1044
uv_run(&loop->uv, mode);
- } while (ms > 0 && !once && !*timeout_expired);
+ } while (ms > 0 && !once && !*timeout_expired); // -V560
if (ms > 0) {
uv_timer_stop(&loop->poll_timer);
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index 6f283701c1..56342942db 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -570,7 +570,7 @@ static bool ml_check_b0_strings(ZERO_BL *b0p)
return (memchr(b0p->b0_version, NUL, 10)
&& memchr(b0p->b0_uname, NUL, B0_UNAME_SIZE)
&& memchr(b0p->b0_hname, NUL, B0_HNAME_SIZE)
- && memchr(b0p->b0_fname, NUL, B0_FNAME_SIZE_CRYPT)); // -V512
+ && memchr(b0p->b0_fname, NUL, B0_FNAME_SIZE_CRYPT)); // -V1086
}
/// Update the timestamp or the B0_SAME_DIR flag of the .swp file.