From c505b5b9cb58500078038056c24b391656076d75 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 8 Jan 2021 17:46:31 +0100 Subject: [PATCH] Fixed non-native endian on floats --- include/lang/pattern_data.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/lang/pattern_data.hpp b/include/lang/pattern_data.hpp index 3b9faff60..281527cd0 100644 --- a/include/lang/pattern_data.hpp +++ b/include/lang/pattern_data.hpp @@ -336,17 +336,17 @@ namespace hex::lang { void createEntry(prv::Provider* &provider) override { if (this->getSize() == 4) { - float data = 0; + u32 data = 0; provider->read(this->getOffset(), &data, 4); data = hex::changeEndianess(data, 4, this->getEndian()); - this->createDefaultEntry(hex::format("%e (0x%0*lX)", data, this->getSize() * 2, *reinterpret_cast(&data))); + this->createDefaultEntry(hex::format("%e (0x%0*lX)", *reinterpret_cast(&data), this->getSize() * 2, data)); } else if (this->getSize() == 8) { - double data = 0; + u64 data = 0; provider->read(this->getOffset(), &data, 8); data = hex::changeEndianess(data, 8, this->getEndian()); - this->createDefaultEntry(hex::format("%e (0x%0*lX)", data, this->getSize() * 2, *reinterpret_cast(&data))); + this->createDefaultEntry(hex::format("%e (0x%0*lX)", *reinterpret_cast(&data), this->getSize() * 2, data)); } }