1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-31 09:05:14 +01:00

Some more cleanup

This commit is contained in:
Martin Tůma 2019-08-13 20:50:43 +02:00
parent f67eaa8dec
commit ab6ea84255
4 changed files with 7 additions and 19 deletions

View File

@ -87,13 +87,10 @@ template<class T> bool FITParser::readValue(CTX &ctx, T &val)
ctx.len -= sizeof(T); ctx.len -= sizeof(T);
if (sizeof(T) > 1) { if (ctx.endian)
if (ctx.endian) val = qFromBigEndian(data);
val = qFromBigEndian(data); else
else val = qFromLittleEndian(data);
val = qFromLittleEndian(data);
} else
val = data;
return true; return true;
} }

View File

@ -227,10 +227,7 @@ template<class T> bool IMG::readValue(T &val)
if (read((char*)&data, sizeof(T)) < (qint64)sizeof(T)) if (read((char*)&data, sizeof(T)) < (qint64)sizeof(T))
return false; return false;
if (sizeof(T) > 1) val = qFromLittleEndian(data);
val = qFromLittleEndian(data);
else
val = data;
return true; return true;
} }

View File

@ -34,10 +34,7 @@ template<class T> bool JNXMap::readValue(T &val)
if (_file.read((char*)&data, sizeof(T)) < (qint64)sizeof(T)) if (_file.read((char*)&data, sizeof(T)) < (qint64)sizeof(T))
return false; return false;
if (sizeof(T) > 1) val = qFromLittleEndian(data);
val = qFromLittleEndian(data);
else
val = data;
return true; return true;
} }

View File

@ -32,10 +32,7 @@ template<class T> bool OZF::readValue(T &val)
if (_decrypt) if (_decrypt)
decrypt(&data, sizeof(T), _key); decrypt(&data, sizeof(T), _key);
if (sizeof(T) > 1) val = qFromLittleEndian(data);
val = qFromLittleEndian(data);
else
val = data;
return true; return true;
} }