Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pvs warnings #21145

Merged
merged 5 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/nvim/api/win_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ static void parse_border_title(Object title, Object title_pos, FloatConfig *fcon
return;
}

if (title.type == kObjectTypeArray && title.data.array.size == 0) {
if (title.data.array.size == 0) {
api_set_error(err, kErrorTypeValidation, "title cannot be an empty array");
return;
}
Expand All @@ -391,7 +391,6 @@ static void parse_border_title(Object title, Object title_pos, FloatConfig *fcon
fconfig->title_chunks = parse_virt_text(title.data.array, err, &fconfig->title_width);

fconfig->title = true;
return;
}

static bool parse_title_pos(Object title_pos, FloatConfig *fconfig, Error *err)
Expand Down
2 changes: 1 addition & 1 deletion src/nvim/ex_eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ void ex_endif(exarg_T *eap)
/// Handle ":else" and ":elseif".
void ex_else(exarg_T *eap)
{
int result;
bool result = false;
cstack_T *const cstack = eap->cstack;

bool skip = CHECK_SKIP;
Expand Down
3 changes: 3 additions & 0 deletions src/nvim/linematch.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http:https://www.viva64.com

#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
Expand Down
1 change: 1 addition & 0 deletions src/nvim/msgpack_rpc/unpacker.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ bool unpacker_parse_redraw(Unpacker *p)
size_t size = p->read_size;
GridLineEvent *g = p->grid_line_event;

// -V:NEXT_TYPE:501
#define NEXT_TYPE(tok, typ) \
result = mpack_rtoken(&data, &size, &tok); \
if (result == MPACK_EOF) { \
Expand Down
2 changes: 1 addition & 1 deletion src/nvim/os/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ int os_file_mkdir(char *fname, int32_t mode)
*tail = NUL;
int r;
char *failed_dir;
if ((r = os_mkdir_recurse(fname, mode, &failed_dir) < 0)) {
if (((r = os_mkdir_recurse(fname, mode, &failed_dir)) < 0)) {
semsg(_(e_mkdir), failed_dir, os_strerror(r));
xfree(failed_dir);
}
Expand Down
2 changes: 1 addition & 1 deletion src/nvim/quickfix.c
Original file line number Diff line number Diff line change
Expand Up @@ -6711,7 +6711,7 @@ static bool mark_quickfix_ctx(qf_info_T *qi, int copyID)
typval_T *ctx = qi->qf_lists[i].qf_ctx;
if (ctx != NULL && ctx->v_type != VAR_NUMBER
&& ctx->v_type != VAR_STRING && ctx->v_type != VAR_FLOAT) {
abort = abort || set_ref_in_item(ctx, copyID, NULL, NULL);
abort = set_ref_in_item(ctx, copyID, NULL, NULL);
}

Callback *cb = &qi->qf_lists[i].qf_qftf_cb;
Expand Down