Commit 383e8966 authored by Yoni Fogel's avatar Yoni Fogel

[t:2561] Bugfix in backwards compatibility code. Enums cannot be used for CPP...

[t:2561] Bugfix in backwards compatibility code.  Enums cannot be used for CPP directives, which broke windows build

git-svn-id: file:///svn/toku/tokudb@20797 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2834d9ce
...@@ -745,14 +745,8 @@ static void ...@@ -745,14 +745,8 @@ static void
translation_deserialize_from_buffer(struct translation *t, // destination into which to deserialize translation_deserialize_from_buffer(struct translation *t, // destination into which to deserialize
DISKOFF location_on_disk, //Location of translation_buffer DISKOFF location_on_disk, //Location of translation_buffer
u_int64_t size_on_disk, u_int64_t size_on_disk,
unsigned char * translation_buffer unsigned char * translation_buffer,
#if BRT_LAYOUT_MIN_SUPPORTED_VERSION <= BRT_LAYOUT_VERSION_11 BOOL invert_checksum) { // buffer with serialized translation
, BOOL invert_checksum
#else
#error The above code block is obsolete
#endif
) { // buffer with serialized translation
assert(location_on_disk!=0); assert(location_on_disk!=0);
t->type = TRANSLATION_CHECKPOINTED; t->type = TRANSLATION_CHECKPOINTED;
{ {
...@@ -761,13 +755,9 @@ translation_deserialize_from_buffer(struct translation *t, // destination int ...@@ -761,13 +755,9 @@ translation_deserialize_from_buffer(struct translation *t, // destination int
u_int64_t offset = size_on_disk - 4; u_int64_t offset = size_on_disk - 4;
//printf("%s:%d read from %ld (x1764 offset=%ld) size=%ld\n", __FILE__, __LINE__, block_translation_address_on_disk, offset, block_translation_size_on_disk); //printf("%s:%d read from %ld (x1764 offset=%ld) size=%ld\n", __FILE__, __LINE__, block_translation_address_on_disk, offset, block_translation_size_on_disk);
u_int32_t stored_x1764 = toku_dtoh32(*(int*)(translation_buffer + offset)); u_int32_t stored_x1764 = toku_dtoh32(*(int*)(translation_buffer + offset));
#if BRT_LAYOUT_MIN_SUPPORTED_VERSION <= BRT_LAYOUT_VERSION_11
if (invert_checksum) { if (invert_checksum) {
x1764 = ~x1764; x1764 = ~x1764;
} }
#else
#error The above code block is obsolete
#endif
assert(x1764 == stored_x1764); assert(x1764 == stored_x1764);
} }
struct rbuf rt; struct rbuf rt;
......
...@@ -1601,13 +1601,9 @@ deserialize_brtheader_from_fd_into_rbuf(int fd, toku_off_t offset, struct rbuf * ...@@ -1601,13 +1601,9 @@ deserialize_brtheader_from_fd_into_rbuf(int fd, toku_off_t offset, struct rbuf *
//Verify checksum //Verify checksum
u_int32_t calculated_x1764 = x1764_memory(rb->buf, rb->size-4); u_int32_t calculated_x1764 = x1764_memory(rb->buf, rb->size-4);
u_int32_t stored_x1764 = toku_dtoh32(*(int*)(rb->buf+rb->size-4)); u_int32_t stored_x1764 = toku_dtoh32(*(int*)(rb->buf+rb->size-4));
#if BRT_LAYOUT_MIN_SUPPORTED_VERSION <= BRT_LAYOUT_VERSION_11
if (version<=BRT_LAYOUT_VERSION_11) { if (version<=BRT_LAYOUT_VERSION_11) {
calculated_x1764 = ~calculated_x1764; calculated_x1764 = ~calculated_x1764;
} }
#else
#error The above code block is obsolete
#endif
if (calculated_x1764!=stored_x1764) r = TOKUDB_DICTIONARY_NO_HEADER; //Header useless if (calculated_x1764!=stored_x1764) r = TOKUDB_DICTIONARY_NO_HEADER; //Header useless
} }
if (r==0) { if (r==0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment