From fce1088cc34d06662b249027000ed7225bef2ccb Mon Sep 17 00:00:00 2001 From: John Date: Sun, 29 May 2022 15:25:01 +0200 Subject: [PATCH] fix for some architectures (fixes #608) --- src/lib/ebus/datatype.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/ebus/datatype.cpp b/src/lib/ebus/datatype.cpp index b68abb33..d3108f69 100755 --- a/src/lib/ebus/datatype.cpp +++ b/src/lib/ebus/datatype.cpp @@ -43,7 +43,7 @@ using std::setw; using std::endl; -float uintToFloat(unsigned int value) { +float uintToFloat(unsigned int value, bool negative) { #ifdef HAVE_DIRECT_FLOAT_FORMAT # if HAVE_DIRECT_FLOAT_FORMAT == 2 value = __builtin_bswap32(value); @@ -826,7 +826,7 @@ result_t NumberDataType::readFromRawValue(unsigned int value, } if (m_bitCount == 32) { if (hasFlag(EXP)) { // IEEE 754 binary32 - float val = uintToFloat(value); + float val = uintToFloat(value, negative); if (val != val) { // !isnan(val) if (outputFormat & OF_JSON) { *output << "null";