From 43bd1f3c69eb2ae4ef6f8ffe38fdd55a98facb04 Mon Sep 17 00:00:00 2001 From: m_thread Date: Thu, 27 Feb 2014 09:16:33 +0100 Subject: [PATCH] OP-1170 Got rid of all compiler warnings in utils library. --- ground/openpilotgcs/src/libs/utils/logfile.cpp | 4 ++-- ground/openpilotgcs/src/libs/utils/xmlconfig.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ground/openpilotgcs/src/libs/utils/logfile.cpp b/ground/openpilotgcs/src/libs/utils/logfile.cpp index 4c20b413f..4dad41bf3 100644 --- a/ground/openpilotgcs/src/libs/utils/logfile.cpp +++ b/ground/openpilotgcs/src/libs/utils/logfile.cpp @@ -105,7 +105,7 @@ void LogFile::timerFired() // TODO: going back in time will be a problem while ((m_lastPlayed + ((time - m_timeOffset) * m_playbackSpeed) > m_lastTimeStamp)) { m_lastPlayed += ((time - m_timeOffset) * m_playbackSpeed); - if (m_file.bytesAvailable() < sizeof(dataSize)) { + if (m_file.bytesAvailable() < (qint64)sizeof(dataSize)) { stopReplay(); return; } @@ -129,7 +129,7 @@ void LogFile::timerFired() emit readyRead(); - if (m_file.bytesAvailable() < sizeof(m_lastTimeStamp)) { + if (m_file.bytesAvailable() < (qint64)sizeof(m_lastTimeStamp)) { stopReplay(); return; } diff --git a/ground/openpilotgcs/src/libs/utils/xmlconfig.cpp b/ground/openpilotgcs/src/libs/utils/xmlconfig.cpp index dc349e726..4a61369da 100644 --- a/ground/openpilotgcs/src/libs/utils/xmlconfig.cpp +++ b/ground/openpilotgcs/src/libs/utils/xmlconfig.cpp @@ -63,7 +63,7 @@ bool XmlConfig::readXmlFile(QIODevice &device, QSettings::SettingsMap &map) .arg(errorLine) .arg(errorColumn) .arg(errorStr); - qFatal(err.toLatin1().data()); + qFatal("%s", err.toLatin1().data()); return false; } root = domDoc.documentElement(); @@ -99,7 +99,7 @@ void XmlConfig::handleNode(QDomElement *node, QSettings::SettingsMap &map, QStri } // qDebug() << "Node: " << ": " << path << " Children: " << node->childNodes().length(); - for (uint i = 0; i < node->childNodes().length(); ++i) { + for (int i = 0; i < node->childNodes().length(); ++i) { QDomNode child = node->childNodes().item(i); if (child.isElement()) { handleNode(static_cast(&child), map, path);