Avoid naming conflict of EntryType
Summary: Fix build break on travis build: $ OPT=-DTRAVIS V=1 make unity && make clean && OPT=-DTRAVIS V=1 make db_test && ./db_test ...... In file included from unity.cc:65:0: ./table/plain_table_key_coding.cc: In member function ‘rocksdb::Status rocksdb::PlainTableKeyDecoder::NextPrefixEncodingKey(const char*, const char*, rocksdb::ParsedInternalKey*, rocksdb::Slice*, size_t*, bool*)’: ./table/plain_table_key_coding.cc:224:3: error: reference to ‘EntryType’ is ambiguous EntryType entry_type; ^ In file included from ./db/table_properties_collector.h:9:0, from ./db/builder.h:11, from ./db/builder.cc:10, from unity.cc:1: ./include/rocksdb/table_properties.h:81:6: note: candidates are: enum rocksdb::EntryType enum EntryType { ^ In file included from unity.cc:65:0: ./table/plain_table_key_coding.cc:16:6: note: enum rocksdb::{anonymous}::EntryType enum EntryType : unsigned char { ^ ./table/plain_table_key_coding.cc:231:51: error: ‘entry_type’ was not declared in this scope const char* pos = DecodeSize(key_ptr, limit, &entry_type, &size); ^ make: *** [unity.o] Error 1 Test Plan: OPT=-DTRAVIS V=1 make unity And make sure it doesn't break anymore. Reviewers: yhchiang, kradhakrishnan, igor Reviewed By: igor Subscribers: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D36549
This commit is contained in:
parent
3be82bc894
commit
a45e7581b7
@ -13,7 +13,7 @@ namespace rocksdb {
|
||||
|
||||
namespace {
|
||||
|
||||
enum EntryType : unsigned char {
|
||||
enum PlainTableEntryType : unsigned char {
|
||||
kFullKey = 0,
|
||||
kPrefixFromPreviousKey = 1,
|
||||
kKeySuffix = 2,
|
||||
@ -27,7 +27,8 @@ enum EntryType : unsigned char {
|
||||
const unsigned char kSizeInlineLimit = 0x3F;
|
||||
|
||||
// Return 0 for error
|
||||
size_t EncodeSize(EntryType type, uint32_t key_size, char* out_buffer) {
|
||||
size_t EncodeSize(PlainTableEntryType type, uint32_t key_size,
|
||||
char* out_buffer) {
|
||||
out_buffer[0] = type << 6;
|
||||
|
||||
if (key_size < static_cast<uint32_t>(kSizeInlineLimit)) {
|
||||
@ -43,9 +44,9 @@ size_t EncodeSize(EntryType type, uint32_t key_size, char* out_buffer) {
|
||||
|
||||
// Return position after the size byte(s). nullptr means error
|
||||
const char* DecodeSize(const char* offset, const char* limit,
|
||||
EntryType* entry_type, uint32_t* key_size) {
|
||||
PlainTableEntryType* entry_type, uint32_t* key_size) {
|
||||
assert(offset < limit);
|
||||
*entry_type = static_cast<EntryType>(
|
||||
*entry_type = static_cast<PlainTableEntryType>(
|
||||
(static_cast<unsigned char>(offset[0]) & ~kSizeInlineLimit) >> 6);
|
||||
char inline_key_size = offset[0] & kSizeInlineLimit;
|
||||
if (inline_key_size < kSizeInlineLimit) {
|
||||
@ -221,7 +222,7 @@ Status PlainTableKeyDecoder::NextPrefixEncodingKey(
|
||||
const char* start, const char* limit, ParsedInternalKey* parsed_key,
|
||||
Slice* internal_key, size_t* bytes_read, bool* seekable) {
|
||||
const char* key_ptr = start;
|
||||
EntryType entry_type;
|
||||
PlainTableEntryType entry_type;
|
||||
|
||||
bool expect_suffix = false;
|
||||
do {
|
||||
|
Loading…
Reference in New Issue
Block a user