set(
_clang_gcc_warnings
+ -Wcast-align
-Wextra
-Wnon-virtual-dtor
- -Wcast-align
- -Wunused
+ -Wnull-dereference
-Woverloaded-virtual
-Wpedantic
+ -Wshadow
+ -Wunused
# Candidates for enabling in the future:
- # -Wshadow
# -Wold-style-cast
# -Wconversion
# -Wsign-conversion
- # -Wnull-dereference
# -Wformat=2
)
const auto path_suffix = std::string(original_path.substr(path.length()));
const auto real_path = Util::real_path(std::string(path));
- const auto add_relpath_candidates = [&](auto path) {
+ const auto add_relpath_candidates = [&](auto p) {
const std::string normalized_path =
- Util::normalize_abstract_absolute_path(path);
+ Util::normalize_abstract_absolute_path(p);
relpath_candidates.push_back(
Util::get_relative_path(actual_cwd, normalized_path));
if (apparent_cwd != actual_cwd) {
-// Copyright (C) 2022 Joel Rosdahl and other contributors
+// Copyright (C) 2022-2023 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
const uint8_t CacheEntry::k_format_version = 1;
CacheEntry::Header::Header(const Config& config,
- core::CacheEntryType entry_type)
+ core::CacheEntryType entry_type_)
: magic(k_ccache_magic),
entry_format_version(k_format_version),
- entry_type(entry_type),
+ entry_type(entry_type_),
compression_type(compression_type_from_config(config)),
compression_level(compression_level_from_config(config)),
self_contained(entry_type != CacheEntryType::result
-// Copyright (C) 2009-2022 Joel Rosdahl and other contributors
+// Copyright (C) 2009-2023 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
operator()(const core::Manifest::FileInfo& file_info) const
{
static_assert(sizeof(file_info) == 48); // No padding.
- util::XXH3_64 hash;
- hash.update(&file_info, sizeof(file_info));
- return hash.digest();
+ util::XXH3_64 h;
+ h.update(&file_info, sizeof(file_info));
+ return h.digest();
}
};
-// Copyright (C) 2020-2022 Joel Rosdahl and other contributors
+// Copyright (C) 2020-2023 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
throw WriteError(FMT("Failed to open {} for writing", path));
}
- auto write_data = [&](auto data, auto size) {
- util::throw_on_error<WriteError>(util::write_fd(*fd, data, size),
+ auto write_data = [&](auto d, auto s) {
+ util::throw_on_error<WriteError>(util::write_fd(*fd, d, s),
FMT("Failed to write to {}: ", path));
};