Fix build errors for windows

Summary:
- Need to use unsigned long long for 64-bit literals on windows
- Need size_t for backup meta-file length since clang doesn't let us assign size_t to int

Test Plan: backupable_db_test and options_test

Reviewers: IslamAbdelRahman, yhchiang, sdong

Reviewed By: sdong

Subscribers: andrewkr, dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D56391
This commit is contained in:
Andrew Kryczka 2016-04-08 13:09:19 -07:00
parent 0522990358
commit 114a1b8792
2 changed files with 5 additions and 5 deletions

View File

@ -104,8 +104,8 @@ ColumnFamilyOptions::ColumnFamilyOptions()
max_grandparent_overlap_factor(10),
soft_rate_limit(0.0),
hard_rate_limit(0.0),
soft_pending_compaction_bytes_limit(64 * 1073741824ul),
hard_pending_compaction_bytes_limit(256 * 1073741824ul),
soft_pending_compaction_bytes_limit(64 * 1073741824ull),
hard_pending_compaction_bytes_limit(256 * 1073741824ull),
rate_limit_delay_max_milliseconds(1000),
arena_block_size(0),
disable_auto_compactions(false),

View File

@ -1702,7 +1702,7 @@ Status BackupEngineImpl::BackupMeta::StoreToFile(bool sync) {
}
unique_ptr<char[]> buf(new char[max_backup_meta_file_size_]);
int len = 0, buf_size = max_backup_meta_file_size_;
size_t len = 0, buf_size = max_backup_meta_file_size_;
len += snprintf(buf.get(), buf_size, "%" PRId64 "\n", timestamp_);
len += snprintf(buf.get() + len, buf_size - len, "%" PRIu64 "\n",
sequence_number_);
@ -1710,7 +1710,7 @@ Status BackupEngineImpl::BackupMeta::StoreToFile(bool sync) {
std::string hex_encoded_metadata =
Slice(app_metadata_).ToString(/* hex */ true);
if (hex_encoded_metadata.size() + kMetaDataPrefix.size() + 1 >
(size_t)(buf_size - len)) {
buf_size - len) {
return Status::Corruption("Buffer too small to fit backup metadata");
}
memcpy(buf.get() + len, kMetaDataPrefix.data(), kMetaDataPrefix.size());
@ -1728,7 +1728,7 @@ Status BackupEngineImpl::BackupMeta::StoreToFile(bool sync) {
file->filename.c_str(), file->checksum_value);
}
s = backup_meta_file->Append(Slice(buf.get(), (size_t)len));
s = backup_meta_file->Append(Slice(buf.get(), len));
if (s.ok() && sync) {
s = backup_meta_file->Sync();
}