Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[codemod] comment unused parameters to turn on -Wunused-parameter flag #3662

Closed
wants to merge 14 commits into from
2 changes: 1 addition & 1 deletion db/db_sst_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ TEST_F(DBSSTTest, CancellingManualCompactionsWorks) {
sfm->SetMaxAllowedSpaceUsage(0);
int completed_compactions = 0;
rocksdb::SyncPoint::GetInstance()->SetCallBack(
"CompactFilesImpl:End", [&](void* arg) { completed_compactions++; });
"CompactFilesImpl:End", [&](void* /*arg*/) { completed_compactions++; });

rocksdb::SyncPoint::GetInstance()->EnableProcessing();
dbfull()->CompactFiles(rocksdb::CompactionOptions(), l0_files, 0);
Expand Down
1 change: 1 addition & 0 deletions env/env_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ class PosixEnv : public Env {
return false;
}
#else
(void)path;
return false;
#endif
}
Expand Down
16 changes: 16 additions & 0 deletions env/io_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ int Fadvise(int fd, off_t offset, size_t len, int advice) {
#ifdef OS_LINUX
return posix_fadvise(fd, offset, len, advice);
#else
(void)fd;
(void)offset;
(void)len;
(void)advice;
return 0; // simply do nothing.
#endif
}
Expand Down Expand Up @@ -227,6 +231,8 @@ Status PosixSequentialFile::Skip(uint64_t n) {

Status PosixSequentialFile::InvalidateCache(size_t offset, size_t length) {
#ifndef OS_LINUX
(void)offset;
(void)length;
return Status::OK();
#else
if (!use_direct_io()) {
Expand Down Expand Up @@ -410,6 +416,8 @@ Status PosixRandomAccessFile::InvalidateCache(size_t offset, size_t length) {
return Status::OK();
}
#ifndef OS_LINUX
(void)offset;
(void)length;
return Status::OK();
#else
// free OS pages
Expand Down Expand Up @@ -464,6 +472,8 @@ Status PosixMmapReadableFile::Read(uint64_t offset, size_t n, Slice* result,

Status PosixMmapReadableFile::InvalidateCache(size_t offset, size_t length) {
#ifndef OS_LINUX
(void)offset;
(void)length;
return Status::OK();
#else
// free OS pages
Expand Down Expand Up @@ -672,6 +682,8 @@ uint64_t PosixMmapFile::GetFileSize() {

Status PosixMmapFile::InvalidateCache(size_t offset, size_t length) {
#ifndef OS_LINUX
(void)offset;
(void)length;
return Status::OK();
#else
// free OS pages
Expand Down Expand Up @@ -874,6 +886,8 @@ void PosixWritableFile::SetWriteLifeTimeHint(Env::WriteLifeTimeHint hint) {
write_hint_ = hint;
}
#endif
#else
(void)hint;
#endif
}

Expand All @@ -882,6 +896,8 @@ Status PosixWritableFile::InvalidateCache(size_t offset, size_t length) {
return Status::OK();
}
#ifndef OS_LINUX
(void)offset;
(void)length;
return Status::OK();
#else
// free OS pages
Expand Down
6 changes: 6 additions & 0 deletions util/arena.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Arena::Arena(size_t block_size, AllocTracker* tracker, size_t huge_page_size)
if (hugetlb_size_ && kBlockSize > hugetlb_size_) {
hugetlb_size_ = ((kBlockSize - 1U) / hugetlb_size_ + 1U) * hugetlb_size_;
}
#else
(void)huge_page_size;
#endif
if (tracker_ != nullptr) {
tracker_->Allocate(kInlineSize);
Expand Down Expand Up @@ -152,6 +154,7 @@ char* Arena::AllocateFromHugePage(size_t bytes) {
}
return reinterpret_cast<char*>(addr);
#else
(void)bytes;
return nullptr;
#endif
}
Expand Down Expand Up @@ -179,6 +182,9 @@ char* Arena::AllocateAligned(size_t bytes, size_t huge_page_size,
return addr;
}
}
#else
(void)huge_page_size;
(void)logger;
#endif

size_t current_mod =
Expand Down