Skip to content

Commit

Permalink
Fix modernize-redundant-void-arg warning reported by clang-tidy (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximSmolskiy authored Nov 14, 2022
1 parent 6393cf6 commit 428f6e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# refer to https://clang.llvm.org/extra/clang-tidy/checks/list.html
Checks: -*, clang-analyzer-core.*, clang-analyzer-cplusplus.*, clang-analyzer-deadcode.*, clang-analyzer-nullability.*, clang-analyzer-security.*, clang-analyzer-unix.*, clang-analyzer-valist.*, cppcoreguidelines-init-variables, cppcoreguidelines-macro-usage, cppcoreguidelines-interfaces-global-init, cppcoreguidelines-narrowing-conversions, cppcoreguidelines-no-malloc, cppcoreguidelines-prefer-member-initializer, cppcoreguidelines-special-member-functions, cppcoreguidelines-slicing, google-build-explicit-make-pair, google-default-arguments, google-explicit-constructor, modernize-avoid-bind, modernize-loop-convert, modernize-macro-to-enum, modernize-make-shared, modernize-make-unique, modernize-pass-by-value, modernize-redundant-void-arg, modernize-return-braced-init-list, modernize-use-auto, modernize-use-bool-literals, modernize-use-emplace, modernize-use-equals-default, modernize-use-equals-delete, modernize-use-nullptr, modernize-use-override, modernize-use-using, performance-faster-string-find, performance-for-range-copy, performance-implicit-conversion-in-loop, performance-inefficient-algorithm, performance-inefficient-vector-operation, performance-move-const-arg, performance-move-constructor-init, performance-no-automatic-move, performance-trivially-destructible, performance-type-promotion-in-math-fn, performance-unnecessary-copy-initialization, performance-unnecessary-value-param

WarningsAsErrors: clang-analyzer-*, -clang-analyzer-security.insecureAPI.rand, cppcoreguidelines-interfaces-global-init, cppcoreguidelines-no-malloc, cppcoreguidelines-slicing, google-*, modernize-use-emplace, modernize-use-equals-default, modernize-use-equals-delete, performance-implicit-conversion-in-loop, performance-inefficient-algorithm, performance-move-constructor-init, performance-no-automatic-move, performance-trivially-destructible, performance-type-promotion-in-math-fn, performance-unnecessary-copy-initialization, modernize-use-bool-literals, performance-unnecessary-value-param, modernize-make-unique, performance-for-range-copy, performance-faster-string-find
WarningsAsErrors: clang-analyzer-*, -clang-analyzer-security.insecureAPI.rand, cppcoreguidelines-interfaces-global-init, cppcoreguidelines-no-malloc, cppcoreguidelines-slicing, google-*, modernize-use-emplace, modernize-use-equals-default, modernize-use-equals-delete, performance-implicit-conversion-in-loop, performance-inefficient-algorithm, performance-move-constructor-init, performance-no-automatic-move, performance-trivially-destructible, performance-type-promotion-in-math-fn, performance-unnecessary-copy-initialization, modernize-use-bool-literals, performance-unnecessary-value-param, modernize-make-unique, performance-for-range-copy, performance-faster-string-find, modernize-redundant-void-arg

CheckOptions:
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
Expand Down
10 changes: 5 additions & 5 deletions src/storage/storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ Status Storage::WriteToPropagateCF(const std::string &key, const std::string &va
return Status::OK();
}

bool Storage::ShiftReplId(void) {
bool Storage::ShiftReplId() {
const char *charset = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int charset_len = strlen(charset);

Expand Down Expand Up @@ -695,7 +695,7 @@ std::string Storage::GetReplIdFromWalBySeq(rocksdb::SequenceNumber seq) {
}
}
};
std::string GetReplId(void) { return replid_in_wal_; }
std::string GetReplId() { return replid_in_wal_; }

private:
std::string replid_in_wal_;
Expand All @@ -708,7 +708,7 @@ std::string Storage::GetReplIdFromWalBySeq(rocksdb::SequenceNumber seq) {
return write_batch_handler.GetReplId();
}

std::string Storage::GetReplIdFromDbEngine(void) {
std::string Storage::GetReplIdFromDbEngine() {
std::string replid_in_db;
auto cf = GetCFHandle(kPropagateColumnFamilyName);
auto s = db_->Get(rocksdb::ReadOptions(), cf, kReplicationIdKey, &replid_in_db);
Expand Down Expand Up @@ -775,12 +775,12 @@ Status Storage::ReplDataManager::GetFullReplDataInfo(Storage *storage, std::stri
return Status::OK();
}

bool Storage::ExistCheckpoint(void) {
bool Storage::ExistCheckpoint() {
std::lock_guard<std::mutex> lg(checkpoint_mu_);
return env_->FileExists(config_->checkpoint_dir).ok();
}

bool Storage::ExistSyncCheckpoint(void) { return env_->FileExists(config_->sync_checkpoint_dir).ok(); }
bool Storage::ExistSyncCheckpoint() { return env_->FileExists(config_->sync_checkpoint_dir).ok(); }

Status Storage::ReplDataManager::CleanInvalidFiles(Storage *storage, const std::string &dir,
std::vector<std::string> valid_files) {
Expand Down
8 changes: 4 additions & 4 deletions src/storage/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,18 @@ class Storage {
static bool FileExists(Storage *storage, const std::string &dir, const std::string &repl_file, uint32_t crc);
};

bool ExistCheckpoint(void);
bool ExistSyncCheckpoint(void);
bool ExistCheckpoint();
bool ExistSyncCheckpoint();
void SetCheckpointCreateTime(time_t t) { checkpoint_info_.create_time = t; }
time_t GetCheckpointCreateTime() { return checkpoint_info_.create_time; }
void SetCheckpointAccessTime(time_t t) { checkpoint_info_.access_time = t; }
time_t GetCheckpointAccessTime() { return checkpoint_info_.access_time; }
void SetDBInRetryableIOError(bool yes_or_no) { db_in_retryable_io_error_ = yes_or_no; }
bool IsDBInRetryableIOError() { return db_in_retryable_io_error_; }

bool ShiftReplId(void);
bool ShiftReplId();
std::string GetReplIdFromWalBySeq(rocksdb::SequenceNumber seq);
std::string GetReplIdFromDbEngine(void);
std::string GetReplIdFromDbEngine();

private:
rocksdb::DB *db_ = nullptr;
Expand Down

0 comments on commit 428f6e6

Please sign in to comment.