From 652cbd7c1133fe8657a95430c9192bd51165bd4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Thu, 9 Apr 2020 10:17:30 +0200 Subject: [PATCH] Fixed Qt4 build --- src/data/fitparser.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/data/fitparser.cpp b/src/data/fitparser.cpp index bef79571..a6f53b1b 100644 --- a/src/data/fitparser.cpp +++ b/src/data/fitparser.cpp @@ -118,17 +118,12 @@ bool FITParser::readData(QFile *file, char *data, size_t size) template bool FITParser::readValue(CTX &ctx, T &val) { - T data; - - if (!readData(ctx.file, (char*)&data, sizeof(T))) + if (!readData(ctx.file, (char*)&val, sizeof(T))) return false; ctx.len -= sizeof(T); - - if (ctx.endian) - val = qFromBigEndian(data); - else - val = qFromLittleEndian(data); + if (sizeof(T) > 1) + val = (ctx.endian) ? qFromBigEndian(val) : qFromLittleEndian(val); return true; }