-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Support pragma once in all header files and cleanup some warnings #4339
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ajkr has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, few minor comments before we merge
db/version_set.cc
Outdated
file->largest.user_key().ToString(), | ||
file->stats.num_reads_sampled.load(std::memory_order_relaxed), | ||
file->being_compacted); | ||
file->being_compacted }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops extra space
port/dirent.h
Outdated
#endif // OS_WIN | ||
|
||
#endif // STORAGE_LEVELDB_PORT_DIRENT_H_ | ||
#endif // OS_WIN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: the newline before EOF is missing
third-party/fbson/FbsonUtil.h
Outdated
} // namespace fbson | ||
|
||
#endif // FBSON_FBSONUTIL_H | ||
} // namespace fbson |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: newline before EOf
util/crc32c_ppc.h
Outdated
#endif | ||
|
||
#endif | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again
util/file_reader_writer.cc
Outdated
@@ -694,11 +694,11 @@ Status FilePrefetchBuffer::Prefetch(RandomAccessFileReader* reader, | |||
buffer_.Alignment(alignment); | |||
buffer_.AllocateNewBuffer(static_cast<size_t>(roundup_len), | |||
copy_data_to_new_buffer, chunk_offset_in_buffer, | |||
chunk_len); | |||
static_cast<size_t>(chunk_len)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: convert tabs to spaces
util/transaction_test_util.cc
Outdated
@@ -258,7 +259,7 @@ Status RandomTransactionInserter::Verify(DB* db, uint16_t num_sets, | |||
std::vector<uint16_t> set_vec(num_sets); | |||
std::iota(set_vec.begin(), set_vec.end(), static_cast<uint16_t>(0)); | |||
if (rand) { | |||
std::random_shuffle(set_vec.begin(), set_vec.end(), | |||
std::random_shuffle(set_vec.begin(), set_vec.end(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tabs again
utilities/blob_db/blob_db_impl.cc
Outdated
@@ -1041,7 +1041,7 @@ Status BlobDBImpl::GetBlobValue(const Slice& key, const Slice& index_entry, | |||
} | |||
Slice crc_slice(blob_record.data(), sizeof(uint32_t)); | |||
Slice blob_value(blob_record.data() + sizeof(uint32_t) + key.size(), | |||
blob_index.size()); | |||
static_cast<size_t>(blob_index.size())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tabs
0547a33
to
70f4c1f
Compare
@cngzhnp has updated the pull request. Re-import the pull request |
I tried to fix the minor issues, hope that everythıng seems OK now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ajkr has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
…cebook#4339) Summary: As you know, almost all compilers support "pragma once" keyword instead of using include guards. To be keep consistency between header files, all header files are edited. Besides this, try to fix some warnings about loss of data. Pull Request resolved: facebook#4339 Differential Revision: D9654990 Pulled By: ajkr fbshipit-source-id: c2cf3d2d03a599847684bed81378c401920ca848
As you know, almost all compilers support "pragma once" keyword instead of using include guards. To be keep consistency between header files, all header files are edited.
Besides this, try to fix some warnings about loss of data.