diff options
| author | Gordon Sim <gsim@apache.org> | 2008-10-24 11:33:40 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-10-24 11:33:40 +0000 |
| commit | 93b372e4d8d51a3db161a95a8b1884ce6af117fd (patch) | |
| tree | 4a48e33e5042ea1f3a7be46100d3d6a9c73d5c09 /cpp/src/qpid/framing/FieldValue.cpp | |
| parent | 55c976dbede7ada5dbcc581945f7d5b1a038344c (diff) | |
| download | qpid-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/FieldValue.cpp')
| -rw-r--r-- | cpp/src/qpid/framing/FieldValue.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cpp/src/qpid/framing/FieldValue.cpp b/cpp/src/qpid/framing/FieldValue.cpp index 5fbfe7d0c1..9107ceeeea 100644 --- a/cpp/src/qpid/framing/FieldValue.cpp +++ b/cpp/src/qpid/framing/FieldValue.cpp @@ -21,6 +21,7 @@ #include "FieldValue.h" #include "Array.h" #include "Buffer.h" +#include "Endian.h" #include "qpid/framing/reply_exceptions.h" namespace qpid { @@ -138,11 +139,11 @@ IntegerValue::IntegerValue(int v) : {} FloatValue::FloatValue(float v) : - FieldValue(0x23, new FixedWidthValue<4>(reinterpret_cast<uint8_t*>(&v))) + FieldValue(0x23, new FixedWidthValue<4>(Endian::convertIfRequired(reinterpret_cast<uint8_t*>(&v), 4))) {} DoubleValue::DoubleValue(double v) : - FieldValue(0x33, new FixedWidthValue<8>(reinterpret_cast<uint8_t*>(&v))) + FieldValue(0x33, new FixedWidthValue<8>(Endian::convertIfRequired(reinterpret_cast<uint8_t*>(&v), 8))) {} Integer64Value::Integer64Value(int64_t v) : |
