From 93b372e4d8d51a3db161a95a8b1884ce6af117fd Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 24 Oct 2008 11:33:40 +0000 Subject: Fix for bug in encoding/decoding of floats and doubles. Added test to verify double/float headers set by c++ are correctly read by python [TODO: add wider range of header types, add bidirectional tests, add tests against other languages] [Also fixed one or two SSL related files missing from distribution list] git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@707604 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/FieldTable.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cpp/src/qpid/framing/FieldTable.cpp') diff --git a/cpp/src/qpid/framing/FieldTable.cpp b/cpp/src/qpid/framing/FieldTable.cpp index cf0e03180c..90acbaf6bc 100644 --- a/cpp/src/qpid/framing/FieldTable.cpp +++ b/cpp/src/qpid/framing/FieldTable.cpp @@ -21,6 +21,7 @@ #include "FieldTable.h" #include "Array.h" #include "Buffer.h" +#include "Endian.h" #include "FieldValue.h" #include "qpid/Exception.h" #include "qpid/framing/reply_exceptions.h" @@ -157,7 +158,9 @@ bool getRawFixedWidthValue(FieldTable::ValuePtr vptr, T& value) if (vptr && vptr->getType() == typecode) { FixedWidthValue* fwv = dynamic_cast< FixedWidthValue* >(&vptr->getData()); if (fwv) { - fwv->copyInto(reinterpret_cast(&value)); + uint8_t* const octets = Endian::convertIfRequired(fwv->rawOctets(), width); + uint8_t* const target = reinterpret_cast(&value); + for (uint i = 0; i < width; ++i) target[i] = octets[i]; return true; } } -- cgit v1.2.1