mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
Removed surplus conversions
This commit is contained in:
parent
51e38bf4d8
commit
cd571f4662
@ -23,7 +23,7 @@ static bool readFloat(const char *data, int len, qreal &f)
|
|||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
f = QString(QByteArray::fromRawData(data, len)).toFloat(&ok);
|
f = QByteArray::fromRawData(data, len).toFloat(&ok);
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ bool NMEAParser::readLat(const char *data, int len, qreal &lat)
|
|||||||
|
|
||||||
d = Util::str2int(data, 2);
|
d = Util::str2int(data, 2);
|
||||||
mi = Util::str2int(data + 2, 2);
|
mi = Util::str2int(data + 2, 2);
|
||||||
mf = QString(QByteArray::fromRawData(data + 4, len - 4)).toFloat(&ok);
|
mf = QByteArray::fromRawData(data + 4, len - 4).toFloat(&ok);
|
||||||
if (d < 0 || mi < 0 || !ok)
|
if (d < 0 || mi < 0 || !ok)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ bool NMEAParser::readLon(const char *data, int len, qreal &lon)
|
|||||||
|
|
||||||
d = Util::str2int(data, 3);
|
d = Util::str2int(data, 3);
|
||||||
mi = Util::str2int(data + 3, 2);
|
mi = Util::str2int(data + 3, 2);
|
||||||
mf = QString(QByteArray::fromRawData(data + 5, len - 5)).toFloat(&ok);
|
mf = QByteArray::fromRawData(data + 5, len - 5).toFloat(&ok);
|
||||||
if (d < 0 || mi < 0 || !ok)
|
if (d < 0 || mi < 0 || !ok)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user