apt_get: libzstd-dev pkg-config libhiredis-dev asciidoctor
- name: Clang-Tidy
- os: ubuntu-18.04
- CC: clang-9
- CXX: clang++-9
+ os: ubuntu-20.04
+ CC: clang-12
+ CXX: clang++-12
RUN_TESTS: none
- CMAKE_PARAMS: -DENABLE_CLANG_TIDY=ON -DCLANGTIDY=/usr/bin/clang-tidy-9
- apt_get: libzstd-dev pkg-config libhiredis-dev clang-9 clang-tidy-9
+ CMAKE_PARAMS: -DENABLE_CLANG_TIDY=ON -DCLANGTIDY=/usr/bin/clang-tidy-12
+ apt_get: libzstd-dev pkg-config libhiredis-dev clang-12 clang-tidy-12
steps:
- name: Get source
-readability-implicit-bool-conversion,
-readability-magic-numbers,
-readability-else-after-return,
+ -readability-function-cognitive-complexity,
-readability-named-parameter,
-readability-qualified-auto,
-readability-redundant-declaration,
{
hash_buffer(HASH_DELIMITER);
hash_buffer(type);
- hash_buffer(std::string_view("", 1)); // NUL
+ hash_buffer(std::string_view("\x00", 1));
add_debug_text("### ");
add_debug_text(type);
add_debug_text("\n");
static_cast<int>(InodeCache::ContentType::precompiled_header) == 3,
"Numeric value is part of key, increment version number if changed.");
+const void* MMAP_FAILED = reinterpret_cast<void*>(-1); // NOLINT: Must cast here
+
} // namespace
struct InodeCache::Key
SharedRegion* sr = reinterpret_cast<SharedRegion*>(mmap(
nullptr, sizeof(SharedRegion), PROT_READ | PROT_WRITE, MAP_SHARED, *fd, 0));
fd.close();
- if (sr == reinterpret_cast<void*>(-1)) {
+ if (sr == MMAP_FAILED) {
LOG("Failed to mmap {}: {}", inode_cache_file, strerror(errno));
return false;
}
MAP_SHARED,
*tmp_file.fd,
0));
- if (sr == reinterpret_cast<void*>(-1)) {
+ if (sr == MMAP_FAILED) {
LOG("Failed to mmap new inode cache: {}", strerror(errno));
return false;
}
MTR_SCOPE("storage", "get");
if (mode != Mode::secondary_only) {
- const auto path = primary.get(key, type);
+ auto path = primary.get(key, type);
primary.increment_statistic(path ? core::Statistic::primary_storage_hit
: core::Statistic::primary_storage_miss);
if (path) {
Checks: '-*,
readability-*,
-readability-implicit-bool-conversion,
+ -readability-function-cognitive-complexity,
-readability-magic-numbers,
-readability-else-after-return,
-readability-named-parameter,