Skip to content

Commit

Permalink
Fix warnings under clang-15 (#315)
Browse files Browse the repository at this point in the history
Signed-off-by: JaySon-Huang <[email protected]>
  • Loading branch information
JaySon-Huang authored Sep 26, 2022
1 parent 40551e2 commit 6a7472a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cache/lru_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void LRUHandleTable::Resize() {
std::unique_ptr<LRUHandle* []> new_list {
new LRUHandle* [size_t{1} << new_length_bits] {}
};
uint32_t count = 0;
[[maybe_unused]] uint32_t count = 0;
for (uint32_t i = 0; i < old_length; i++) {
LRUHandle* h = list_[i];
while (h != nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion db/version_edit_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void VersionEditHandlerBase::Iterate(log::Reader& reader,
assert(log_read_status);
assert(log_read_status->ok());

size_t recovered_edits = 0;
[[maybe_unused]] size_t recovered_edits = 0;
Status s = Initialize();
while (reader.LastRecordEnd() < max_manifest_read_size_ && s.ok() &&
reader.ReadRecord(&record, &scratch) && log_read_status->ok()) {
Expand Down
4 changes: 0 additions & 4 deletions db/version_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3108,13 +3108,9 @@ void VersionStorageInfo::SetFinalized() {
assert(MaxBytesForLevel(level) >= max_bytes_prev_level);
max_bytes_prev_level = MaxBytesForLevel(level);
}
int num_empty_non_l0_level = 0;
for (int level = 0; level < num_levels(); level++) {
assert(LevelFiles(level).size() == 0 ||
LevelFiles(level).size() == LevelFilesBrief(level).num_files);
if (level > 0 && NumLevelBytes(level) > 0) {
num_empty_non_l0_level++;
}
if (LevelFiles(level).size() > 0) {
assert(level < num_non_empty_levels());
}
Expand Down
2 changes: 1 addition & 1 deletion third-party/folly/folly/Traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace folly {
#if !defined(_MSC_VER)
template <class T>
struct is_trivially_copyable
: std::integral_constant<bool, __has_trivial_copy(T)> {};
: std::integral_constant<bool, __is_trivially_copyable(T)> {};
#else
template <class T>
using is_trivially_copyable = std::is_trivially_copyable<T>;
Expand Down

0 comments on commit 6a7472a

Please sign in to comment.