diff base/PropertyContainer.cpp @ 1582:70e172e6cc59 fix-static-analysis

Use nullptr throughout
author Chris Cannam
date Mon, 26 Nov 2018 14:33:41 +0000
parents 48e9f538e6e9
children
line wrap: on
line diff
--- a/base/PropertyContainer.cpp	Mon Nov 26 13:51:36 2018 +0000
+++ b/base/PropertyContainer.cpp	Mon Nov 26 14:33:41 2018 +0000
@@ -68,7 +68,7 @@
 RangeMapper *
 PropertyContainer::getNewPropertyRangeMapper(const PropertyName &) const
 {
-    return 0;
+    return nullptr;
 }
 
 void
@@ -80,8 +80,8 @@
 Command *
 PropertyContainer::getSetPropertyCommand(const PropertyName &name, int value)
 {
-    int currentValue = getPropertyRangeAndValue(name, 0, 0, 0);
-    if (value == currentValue) return 0;
+    int currentValue = getPropertyRangeAndValue(name, nullptr, nullptr, nullptr);
+    if (value == currentValue) return nullptr;
     return new SetPropertyCommand(this, name, value);
 }
  
@@ -110,7 +110,7 @@
                   << nameString << "\", \""
                   << valueString
                   << "\"): Name and value conversion failed" << endl;
-        return 0;
+        return nullptr;
     }
     return getSetPropertyCommand(name, value);
 }
@@ -181,7 +181,7 @@
     case ColourMapProperty:
     {
         int min, max;
-        getPropertyRangeAndValue(name, &min, &max, 0);
+        getPropertyRangeAndValue(name, &min, &max, nullptr);
         for (int i = min; i <= max; ++i) {
             if (valueString == getPropertyValueLabel(name, i)) {
                 value = i;
@@ -206,7 +206,7 @@
     if (success) return true;
 
     int min, max;
-    getPropertyRangeAndValue(name, &min, &max, 0);
+    getPropertyRangeAndValue(name, &min, &max, nullptr);
     
     bool ok = false;
     int i = valueString.toInt(&ok);
@@ -235,7 +235,7 @@
 void
 PropertyContainer::SetPropertyCommand::execute()
 {
-    m_oldValue = m_pc->getPropertyRangeAndValue(m_pn, 0, 0, 0);
+    m_oldValue = m_pc->getPropertyRangeAndValue(m_pn, nullptr, nullptr, nullptr);
     m_pc->setProperty(m_pn, m_value);
 }