diff options
Diffstat (limited to 'cpp/src/qmf/engine/SchemaImpl.cpp')
-rw-r--r-- | cpp/src/qmf/engine/SchemaImpl.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cpp/src/qmf/engine/SchemaImpl.cpp b/cpp/src/qmf/engine/SchemaImpl.cpp index 9d363d3012..e0948a9911 100644 --- a/cpp/src/qmf/engine/SchemaImpl.cpp +++ b/cpp/src/qmf/engine/SchemaImpl.cpp @@ -35,17 +35,17 @@ using qpid::framing::Uuid; SchemaHash::SchemaHash() { for (int idx = 0; idx < 16; idx++) - hash.b[idx] = 0x5A; + hash[idx] = 0x5A; } void SchemaHash::encode(Buffer& buffer) const { - buffer.putBin128(hash.b); + buffer.putBin128(hash); } void SchemaHash::decode(Buffer& buffer) { - buffer.getBin128(hash.b); + buffer.getBin128(hash); } void SchemaHash::update(uint8_t data) @@ -55,8 +55,9 @@ void SchemaHash::update(uint8_t data) void SchemaHash::update(const char* data, uint32_t len) { - uint64_t* first = &hash.q[0]; - uint64_t* second = &hash.q[1]; + uint64_t* first = (uint64_t*) hash; + uint64_t* second = (uint64_t*) hash + 1; + for (uint32_t idx = 0; idx < len; idx++) { *first = *first ^ (uint64_t) data[idx]; *second = *second << 1; |