浏览代码

Fixed compiler (Clang) warnings.

Sascha Zelzer 13 年之前
父节点
当前提交
90c6e9c46b
共有 2 个文件被更改,包括 11 次插入3 次删除
  1. 1 1
      Libs/PluginFramework/ctkServices.cpp
  2. 10 2
      Plugins/org.commontk.log/ctkLogQDebug.cpp

+ 1 - 1
Libs/PluginFramework/ctkServices.cpp

@@ -297,7 +297,7 @@ QList<ctkServiceRegistration> ctkServices::getRegisteredByPlugin(ctkPluginPrivat
   for (QHashIterator<ctkServiceRegistration, QStringList> i(services); i.hasNext(); )
   {
     ctkServiceRegistration sr = i.next().key();
-    if ((sr.d_func()->plugin == p))
+    if (sr.d_func()->plugin == p)
     {
       res.push_back(sr);
     }

+ 10 - 2
Plugins/org.commontk.log/ctkLogQDebug.cpp

@@ -40,7 +40,11 @@ void ctkLogQDebug::log(int level, const QString& message, const std::exception*
 
   QString s = QDateTime::currentDateTime().toString(Qt::ISODate)
       .append(" - ").append(message);
-  exception ? s.append(" (").append(exception->what()).append(")") : false;
+
+  if (exception != 0)
+  {
+    s.append(" (").append(exception->what()).append(")");
+  }
 
   if (file)
   {
@@ -81,7 +85,11 @@ void ctkLogQDebug::log(const ctkServiceReference& sr, int level, const QString&
   }
 
   s.append(message);
-  exception ? s.append(" (").append(exception->what()).append(")") : false ;
+
+  if(exception != 0)
+  {
+    s.append(" (").append(exception->what()).append(")");
+  }
 
   if (file)
   {