Skip to content

Commit

Permalink
Remove warning suppression from code.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhubner committed Feb 7, 2024
1 parent 89acb98 commit 2e4a811
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
10 changes: 2 additions & 8 deletions db/db_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,8 @@ Options DBTestBase::GetOptions(
"NewWritableFile:O_DIRECT");
#endif
// kMustFreeHeapAllocations -> indicates ASAN build
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4127)
#endif
if (kMustFreeHeapAllocations && !options_override.full_block_cache) {
if constexpr (kMustFreeHeapAllocations &&
!options_override.full_block_cache) {
// Detecting block cache use-after-free is normally difficult in unit
// tests, because as a cache, it tends to keep unreferenced entries in
// memory, and we normally want unit tests to take advantage of block
Expand All @@ -366,9 +363,6 @@ Options DBTestBase::GetOptions(
// added but are immediately freed on no more references.
table_options.block_cache = NewLRUCache(/* too small */ 1);
}
#if defined(_MSC_VER)
#pragma warning(pop)
#endif

bool can_allow_mmap = IsMemoryMappedAccessSupported();
switch (option_config) {
Expand Down
9 changes: 1 addition & 8 deletions table/block_based/block_based_table_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ BlockBasedTable::MaybeReadBlockAndLoadToCache(
rep_->blocks_maybe_compressed;
// This flag, if true, tells BlockFetcher to return the uncompressed
// block when ReadBlockContents() is called.
const bool do_uncompress = maybe_compressed;
bool do_uncompress = maybe_compressed;
CompressionType contents_comp_type;
// Maybe serialized or uncompressed
BlockContents tmp_contents;
Expand Down Expand Up @@ -1650,10 +1650,6 @@ BlockBasedTable::MaybeReadBlockAndLoadToCache(
}
}
if (s.ok()) {
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4127)
#endif
if (do_uncompress && contents_comp_type != kNoCompression) {
comp_contents = BlockContents(block_fetcher.GetCompressedBlock());
uncomp_contents = std::move(tmp_contents);
Expand All @@ -1664,9 +1660,6 @@ BlockBasedTable::MaybeReadBlockAndLoadToCache(
} else {
uncomp_contents = std::move(tmp_contents);
}
#if defined(_MSC_VER)
#pragma warning(pop)
#endif

// If filling cache is allowed and a cache is configured, try to put
// the block to the cache. Do this here while block_fetcher is in
Expand Down
7 changes: 0 additions & 7 deletions util/ribbon_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,6 @@ class StandardHasher {
return static_cast<ResultRow>(~ResultRow{0});
}
inline ResultRow GetResultRowFromHash(Hash h) const {
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4127)
#endif
if (TypesAndSettings::kIsFilter && !TypesAndSettings::kHomogeneous) {
// This is not so much "critical path" code because it can be done in
// parallel (instruction level) with memory lookup.
Expand All @@ -325,9 +321,6 @@ class StandardHasher {
// Must be zero
return 0;
}
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
}
// For when AddInput == Key (kIsFilter == true)
inline ResultRow GetResultRowFromInput(const Key&) const {
Expand Down

0 comments on commit 2e4a811

Please sign in to comment.