From 06258772da183acaacc37729d3c0cb364571bcb7 Mon Sep 17 00:00:00 2001 From: G-flat <63449095+G-flat@users.noreply.github.com> Date: Thu, 1 Oct 2020 22:37:14 +0800 Subject: [PATCH 1/6] PVS/V1001: Remove assignment to unused variable --- src/nvim/api/buffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index e77870dcf3..3171b00e28 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -1531,10 +1531,10 @@ Integer nvim_buf_add_highlight(Buffer buffer, end_line++; } - ns_id = extmark_set(buf, ns_id, 0, - (int)line, (colnr_T)col_start, - end_line, (colnr_T)col_end, - decoration_hl(hl_id), kExtmarkUndo); + extmark_set(buf, ns_id, 0, + (int)line, (colnr_T)col_start, + end_line, (colnr_T)col_end, + decoration_hl(hl_id), kExtmarkUndo); return src_id; } From ccceab9659f7f180a4d8910aab51463a6515931a Mon Sep 17 00:00:00 2001 From: G-flat <63449095+G-flat@users.noreply.github.com> Date: Fri, 2 Oct 2020 07:24:40 +0800 Subject: [PATCH 2/6] PVS/V1001: Correct returned variable typo --- src/nvim/api/buffer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 3171b00e28..14ea4f7520 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -1531,11 +1531,11 @@ Integer nvim_buf_add_highlight(Buffer buffer, end_line++; } - extmark_set(buf, ns_id, 0, - (int)line, (colnr_T)col_start, - end_line, (colnr_T)col_end, - decoration_hl(hl_id), kExtmarkUndo); - return src_id; + ns_id = extmark_set(buf, ns_id, 0, + (int)line, (colnr_T)col_start, + end_line, (colnr_T)col_end, + decoration_hl(hl_id), kExtmarkUndo); + return ns_id; } /// Clears namespaced objects (highlights, extmarks, virtual text) from From 62c53ac3cf74e0b2c727fbd63c5504a15a1c1541 Mon Sep 17 00:00:00 2001 From: G-flat <63449095+G-flat@users.noreply.github.com> Date: Fri, 2 Oct 2020 07:29:44 +0800 Subject: [PATCH 3/6] PVS/V1001: Add cast to return statement --- src/nvim/api/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 14ea4f7520..0399227bab 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -1535,7 +1535,7 @@ Integer nvim_buf_add_highlight(Buffer buffer, (int)line, (colnr_T)col_start, end_line, (colnr_T)col_end, decoration_hl(hl_id), kExtmarkUndo); - return ns_id; + return (Integer)ns_id; } /// Clears namespaced objects (highlights, extmarks, virtual text) from From 1a49346319cafc5b8879cf6c7ce56c057467b4ee Mon Sep 17 00:00:00 2001 From: G-flat <63449095+G-flat@users.noreply.github.com> Date: Mon, 5 Oct 2020 14:16:51 +0800 Subject: [PATCH 4/6] PVS/V1001: Remove assignment to unused variable --- src/nvim/api/buffer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 0399227bab..3171b00e28 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -1531,11 +1531,11 @@ Integer nvim_buf_add_highlight(Buffer buffer, end_line++; } - ns_id = extmark_set(buf, ns_id, 0, - (int)line, (colnr_T)col_start, - end_line, (colnr_T)col_end, - decoration_hl(hl_id), kExtmarkUndo); - return (Integer)ns_id; + extmark_set(buf, ns_id, 0, + (int)line, (colnr_T)col_start, + end_line, (colnr_T)col_end, + decoration_hl(hl_id), kExtmarkUndo); + return src_id; } /// Clears namespaced objects (highlights, extmarks, virtual text) from From 1d08dfab5b057b51aed98450afd3ad1c888870ff Mon Sep 17 00:00:00 2001 From: G-flat <63449095+G-flat@users.noreply.github.com> Date: Mon, 5 Oct 2020 15:14:50 +0800 Subject: [PATCH 5/6] PVS/V1001: Prepare for rebase --- src/nvim/api/buffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 3171b00e28..e77870dcf3 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -1531,10 +1531,10 @@ Integer nvim_buf_add_highlight(Buffer buffer, end_line++; } - extmark_set(buf, ns_id, 0, - (int)line, (colnr_T)col_start, - end_line, (colnr_T)col_end, - decoration_hl(hl_id), kExtmarkUndo); + ns_id = extmark_set(buf, ns_id, 0, + (int)line, (colnr_T)col_start, + end_line, (colnr_T)col_end, + decoration_hl(hl_id), kExtmarkUndo); return src_id; } From 8972eea2e1f783adae1e3ab0e206543a4fbe632a Mon Sep 17 00:00:00 2001 From: G-flat <63449095+G-flat@users.noreply.github.com> Date: Mon, 5 Oct 2020 15:17:14 +0800 Subject: [PATCH 6/6] PVS/V1001: Remove assignment to unused variable --- src/nvim/api/buffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 174f6e94a9..2811a2da12 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -1531,10 +1531,10 @@ Integer nvim_buf_add_highlight(Buffer buffer, end_line++; } - ns_id = extmark_set(buf, ns_id, 0, - (int)line, (colnr_T)col_start, - end_line, (colnr_T)col_end, - decoration_hl(hl_id), kExtmarkNoUndo); + extmark_set(buf, ns_id, 0, + (int)line, (colnr_T)col_start, + end_line, (colnr_T)col_end, + decoration_hl(hl_id), kExtmarkNoUndo); return src_id; }