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

Fix compilation errors for 32bits/LITE/ios build. #5220

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion monitoring/iostats_context_imp.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ extern __thread IOStatsContext iostats_context;
#define IOSTATS(metric) 0

#define IOSTATS_TIMER_GUARD(metric)
#define IOSTATS_CPU_TIMER_GUARD(metric, env)
#define IOSTATS_CPU_TIMER_GUARD(metric, env) (void)env

#endif // ROCKSDB_SUPPORT_THREAD_LOCAL
2 changes: 1 addition & 1 deletion table/block_based_table_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ void BlockBasedTableBuilder::EnterUnbuffered() {
if (!r->data_block_and_keys_buffers.empty()) {
while (compression_dict_samples.size() < kSampleBytes) {
size_t rand_idx =
generator.Uniform(r->data_block_and_keys_buffers.size());
(size_t)generator.Uniform(r->data_block_and_keys_buffers.size());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use C++ style casting static_cast<>. Same in other places.
We are following Google C++ Style and it is the suggestion there: https://google.github.io/styleguide/cppguide.html#Casting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I have updated the coding style.

size_t copy_len =
std::min(kSampleBytes - compression_dict_samples.size(),
r->data_block_and_keys_buffers[rand_idx].first.size());
Expand Down
2 changes: 1 addition & 1 deletion table/block_based_table_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ Status BlockBasedTable::TryReadPropertiesWithGlobalSeqno(
(*table_properties)
->properties_offsets.find(
ExternalSstFilePropertyNames::kGlobalSeqno);
size_t block_size = props_block_handle.size();
size_t block_size = (size_t)props_block_handle.size();
if (seqno_pos_iter != (*table_properties)->properties_offsets.end()) {
uint64_t global_seqno_offset = seqno_pos_iter->second;
EncodeFixed64(
Expand Down
2 changes: 1 addition & 1 deletion table/meta_blocks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ Status ReadProperties(const Slice& handle_value, RandomAccessFileReader* file,
*ret_block_handle = handle;
}
if (verification_buf != nullptr) {
size_t len = handle.size() + kBlockTrailerSize;
size_t len = (size_t)(handle.size() + kBlockTrailerSize);
*verification_buf = rocksdb::AllocateBlock(len, memory_allocator);
if (verification_buf->get() != nullptr) {
memcpy(verification_buf->get(), block_contents.data.data(), len);
Expand Down