summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing/FieldTable.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-10-24 11:33:40 +0000
committerGordon Sim <gsim@apache.org>2008-10-24 11:33:40 +0000
commit93b372e4d8d51a3db161a95a8b1884ce6af117fd (patch)
tree4a48e33e5042ea1f3a7be46100d3d6a9c73d5c09 /cpp/src/qpid/framing/FieldTable.cpp
parent55c976dbede7ada5dbcc581945f7d5b1a038344c (diff)
downloadqpid-python-93b372e4d8d51a3db161a95a8b1884ce6af117fd.tar.gz
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
Diffstat (limited to 'cpp/src/qpid/framing/FieldTable.cpp')
-rw-r--r--cpp/src/qpid/framing/FieldTable.cpp5
1 files changed, 4 insertions, 1 deletions
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<width>* fwv = dynamic_cast< FixedWidthValue<width>* >(&vptr->getData());
if (fwv) {
- fwv->copyInto(reinterpret_cast<uint8_t*>(&value));
+ uint8_t* const octets = Endian::convertIfRequired(fwv->rawOctets(), width);
+ uint8_t* const target = reinterpret_cast<uint8_t*>(&value);
+ for (uint i = 0; i < width; ++i) target[i] = octets[i];
return true;
}
}