mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 14:56:08 +00:00
refactor: fix clang-tidy warnings
Enable and fix bugprone-misplaced-widening-cast warning. Fix some modernize-macro-to-enum and readability-else-after-return warnings, but don't enable them. While the warnings can be useful, they are in general too noisy to enable.
This commit is contained in:
@@ -3017,10 +3017,9 @@ shada_write_file_open: {}
|
||||
assert(sd_reader.close != NULL);
|
||||
sd_reader.close(&sd_reader);
|
||||
return FAIL;
|
||||
} else {
|
||||
(*wp)++;
|
||||
goto shada_write_file_open;
|
||||
}
|
||||
(*wp)++;
|
||||
goto shada_write_file_open;
|
||||
} else {
|
||||
semsg(_(SERR "System error while opening temporary ShaDa file %s "
|
||||
"for writing: %s"), tempname, os_strerror(error));
|
||||
@@ -3257,13 +3256,12 @@ static ShaDaReadResult fread_len(ShaDaReadDef *const sd_reader, char *const buff
|
||||
semsg(_(SERR "System error while reading ShaDa file: %s"),
|
||||
sd_reader->error);
|
||||
return kSDReadStatusReadError;
|
||||
} else {
|
||||
semsg(_(RCERR "Error while reading ShaDa file: "
|
||||
"last entry specified that it occupies %" PRIu64 " bytes, "
|
||||
"but file ended earlier"),
|
||||
(uint64_t)length);
|
||||
return kSDReadStatusNotShaDa;
|
||||
}
|
||||
semsg(_(RCERR "Error while reading ShaDa file: "
|
||||
"last entry specified that it occupies %" PRIu64 " bytes, "
|
||||
"but file ended earlier"),
|
||||
(uint64_t)length);
|
||||
return kSDReadStatusNotShaDa;
|
||||
}
|
||||
return kSDReadStatusSuccess;
|
||||
}
|
||||
@@ -3576,16 +3574,15 @@ shada_read_next_item_start:
|
||||
entry->type = kSDItemMissing;
|
||||
}
|
||||
return spm_ret;
|
||||
} else {
|
||||
entry->data.unknown_item.contents = xmalloc(length);
|
||||
const ShaDaReadResult fl_ret =
|
||||
fread_len(sd_reader, entry->data.unknown_item.contents, length);
|
||||
if (fl_ret != kSDReadStatusSuccess) {
|
||||
shada_free_shada_entry(entry);
|
||||
entry->type = kSDItemMissing;
|
||||
}
|
||||
return fl_ret;
|
||||
}
|
||||
entry->data.unknown_item.contents = xmalloc(length);
|
||||
const ShaDaReadResult fl_ret =
|
||||
fread_len(sd_reader, entry->data.unknown_item.contents, length);
|
||||
if (fl_ret != kSDReadStatusSuccess) {
|
||||
shada_free_shada_entry(entry);
|
||||
entry->type = kSDItemMissing;
|
||||
}
|
||||
return fl_ret;
|
||||
}
|
||||
|
||||
msgpack_unpacked unpacked;
|
||||
|
Reference in New Issue
Block a user