OSDN Git Service

Avoid compiler warning on Mac
authorEike Ziller <eike.ziller@nokia.com>
Wed, 6 Jul 2011 08:19:37 +0000 (10:19 +0200)
committerhjk <qthjk@ovi.com>
Wed, 6 Jul 2011 08:23:28 +0000 (10:23 +0200)
Change-Id: I10eab3a4b5fc4bf43ee80b1b4baf5767c72ab9c1
Reviewed-on: http://codereview.qt.nokia.com/1208
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
src/plugins/debugger/debuggersourcepathmappingwidget.cpp

index c26c690..645d4ba 100644 (file)
@@ -361,7 +361,7 @@ void DebuggerSourcePathMappingWidget::slotAddQt()
     if (qtSourcesPath.isEmpty())
         return;
     const size_t buildPathCount = sizeof(qtBuildPaths)/sizeof(qtBuildPaths[0]);
-    for (size_t i = 0; i < buildPathCount; ++i)
+    for (size_t i = 0; i != buildPathCount; ++i) // use != to avoid 0<0 which triggers warning on Mac
         m_model->addMapping(QString::fromLatin1(qtBuildPaths[i]), qtSourcesPath);
     resizeColumns();
     setCurrentRow(m_model->rowCount() - 1);
@@ -403,7 +403,7 @@ DebuggerSourcePathMappingWidget::SourcePathMap
     if (qtInstallPath.isEmpty() || buildPathCount == 0)
         return rc;
 
-    for (size_t i = 0; i < buildPathCount; i++) {
+    for (size_t i = 0; i != buildPathCount; ++i) { // use != to avoid 0<0 which triggers warning on Mac
         const QString buildPath = QString::fromLatin1(qtBuildPaths[i]);
         if (!rc.contains(buildPath)) // Do not overwrite user settings.
             rc.insert(buildPath, qtInstallPath);