Enable MS compiler warning c4244.

Mostly due to the fact that there are differences in sizes of int,long
  on 64 bit systems vs GNU.
main
Dmitri Smirnov 10 years ago
parent 236fe21c92
commit 3fa68af316
  1. 2
      CMakeLists.txt
  2. 5
      db/compaction_job_stats_test.cc
  3. 10
      db/version_set.cc

@ -59,8 +59,8 @@ add_custom_command(OUTPUT ${BUILD_VERSION_CC}
add_custom_target(GenerateBuildVersion DEPENDS ${BUILD_VERSION_CC}) add_custom_target(GenerateBuildVersion DEPENDS ${BUILD_VERSION_CC})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi /nologo /EHsc /GS /Gd /GR /GF /fp:precise /Zc:wchar_t /Zc:forScope /errorReport:queue") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi /nologo /EHsc /GS /Gd /GR /GF /fp:precise /Zc:wchar_t /Zc:forScope /errorReport:queue")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FC /d2Zi+ /W3 /WX /wd4127 /wd4267 /wd4800 /wd4996")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FC /d2Zi+ /W3 /WX /wd4127 /wd4800 /wd4996")
# Used to run CI build and tests so we can run faster # Used to run CI build and tests so we can run faster
set(OPTIMIZE_DEBUG_DEFAULT 0) # Debug build is unoptimized by default use -DOPTDBG=1 to optimize set(OPTIMIZE_DEBUG_DEFAULT 0) # Debug build is unoptimized by default use -DOPTDBG=1 to optimize

@ -551,8 +551,9 @@ uint64_t EstimatedFileSize(
const size_t kFooterSize = 512; const size_t kFooterSize = 512;
uint64_t data_size = uint64_t data_size =
static_cast<uint64_t>(num_records * (key_size + static_cast<uint64_t>(
value_size * compression_ratio + kPerKeyOverhead)); num_records * (key_size + value_size * compression_ratio +
kPerKeyOverhead));
return data_size + kFooterSize return data_size + kFooterSize
+ num_records * bloom_bits_per_key / 8 // filter block + num_records * bloom_bits_per_key / 8 // filter block

@ -738,22 +738,22 @@ uint64_t VersionStorageInfo::GetEstimatedActiveKeys() const {
// (2) keys are directly overwritten // (2) keys are directly overwritten
// (3) deletion on non-existing keys // (3) deletion on non-existing keys
// (4) low number of samples // (4) low number of samples
if (num_samples_ == 0) { if (current_num_samples_ == 0) {
return 0; return 0;
} }
if (accumulated_num_non_deletions_ <= accumulated_num_deletions_) { if (current_num_non_deletions_ <= current_num_deletions_) {
return 0; return 0;
} }
uint64_t est = accumulated_num_non_deletions_ - accumulated_num_deletions_; uint64_t est = current_num_non_deletions_ - current_num_deletions_;
uint64_t file_count = 0; uint64_t file_count = 0;
for (int level = 0; level < num_levels_; ++level) { for (int level = 0; level < num_levels_; ++level) {
file_count += files_[level].size(); file_count += files_[level].size();
} }
if (num_samples_ < file_count) { if (current_num_samples_ < file_count) {
// casting to avoid overflowing // casting to avoid overflowing
return return
static_cast<uint64_t>( static_cast<uint64_t>(
@ -888,7 +888,7 @@ void Version::Get(const ReadOptions& read_options, const LookupKey& k,
GetContext get_context( GetContext get_context(
user_comparator(), merge_operator_, info_log_, db_statistics_, user_comparator(), merge_operator_, info_log_, db_statistics_,
status->ok() ? GetContext::kNotFound : GetContext::kMerge, user_key, status->ok() ? GetContext::kNotFound : GetContext::kMerge, user_key,
value, value_found, merge_context, this->env_, seq); value, value_found, merge_context, this->env_);
FilePicker fp( FilePicker fp(
storage_info_.files_, user_key, ikey, &storage_info_.level_files_brief_, storage_info_.files_, user_key, ikey, &storage_info_.level_files_brief_,

Loading…
Cancel
Save