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/FieldValue.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid/framing/FieldValue.cpp') 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(&v))) + FieldValue(0x23, new FixedWidthValue<4>(Endian::convertIfRequired(reinterpret_cast(&v), 4))) {} DoubleValue::DoubleValue(double v) : - FieldValue(0x33, new FixedWidthValue<8>(reinterpret_cast(&v))) + FieldValue(0x33, new FixedWidthValue<8>(Endian::convertIfRequired(reinterpret_cast(&v), 8))) {} Integer64Value::Integer64Value(int64_t v) : -- cgit v1.2.1