From f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 15 Jun 2018 12:46:15 +0200 Subject: =?UTF-8?q?Run=20clang-tidy=E2=80=99s=20modernize-use-nullptr=20pa?= =?UTF-8?q?ss.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This replaces all NULL or 0 with nullptr when assigned to or returned as a pointer. --- src/ui/widget/scalar-unit.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/ui/widget/scalar-unit.cpp') diff --git a/src/ui/widget/scalar-unit.cpp b/src/ui/widget/scalar-unit.cpp index 4fa1a7584..fc8c92142 100644 --- a/src/ui/widget/scalar-unit.cpp +++ b/src/ui/widget/scalar-unit.cpp @@ -34,7 +34,7 @@ ScalarUnit::ScalarUnit(Glib::ustring const &label, Glib::ustring const &tooltip, _absolute_is_increment(false), _percentage_is_increment(false) { - if (_unit_menu == NULL) { + if (_unit_menu == nullptr) { _unit_menu = new UnitMenu(); g_assert(_unit_menu); _unit_menu->setUnitType(unit_type); @@ -70,7 +70,7 @@ ScalarUnit::ScalarUnit(Glib::ustring const &label, Glib::ustring const &tooltip, void ScalarUnit::initScalar(double min_value, double max_value) { - g_assert(_unit_menu != NULL); + g_assert(_unit_menu != nullptr); Scalar::setDigits(_unit_menu->getDefaultDigits()); Scalar::setIncrements(_unit_menu->getDefaultStep(), _unit_menu->getDefaultPage()); @@ -79,7 +79,7 @@ void ScalarUnit::initScalar(double min_value, double max_value) bool ScalarUnit::setUnit(Glib::ustring const &unit) { - g_assert(_unit_menu != NULL); + g_assert(_unit_menu != nullptr); // First set the unit if (!_unit_menu->setUnit(unit)) { return false; @@ -90,21 +90,21 @@ bool ScalarUnit::setUnit(Glib::ustring const &unit) void ScalarUnit::setUnitType(UnitType unit_type) { - g_assert(_unit_menu != NULL); + g_assert(_unit_menu != nullptr); _unit_menu->setUnitType(unit_type); lastUnits = _unit_menu->getUnitAbbr(); } void ScalarUnit::resetUnitType(UnitType unit_type) { - g_assert(_unit_menu != NULL); + g_assert(_unit_menu != nullptr); _unit_menu->resetUnitType(unit_type); lastUnits = _unit_menu->getUnitAbbr(); } Unit const * ScalarUnit::getUnit() const { - g_assert(_unit_menu != NULL); + g_assert(_unit_menu != nullptr); return _unit_menu->getUnit(); } @@ -116,14 +116,14 @@ UnitType ScalarUnit::getUnitType() const void ScalarUnit::setValue(double number, Glib::ustring const &units) { - g_assert(_unit_menu != NULL); + g_assert(_unit_menu != nullptr); _unit_menu->setUnit(units); Scalar::setValue(number); } void ScalarUnit::setValueKeepUnit(double number, Glib::ustring const &units) { - g_assert(_unit_menu != NULL); + g_assert(_unit_menu != nullptr); if (units == "") { // set the value in the default units Scalar::setValue(number); @@ -140,7 +140,7 @@ void ScalarUnit::setValue(double number) double ScalarUnit::getValue(Glib::ustring const &unit_name) const { - g_assert(_unit_menu != NULL); + g_assert(_unit_menu != nullptr); if (unit_name == "") { // Return the value in the default units return Scalar::getValue(); @@ -223,7 +223,7 @@ void ScalarUnit::setFromPercentage(double value) void ScalarUnit::on_unit_changed() { - g_assert(_unit_menu != NULL); + g_assert(_unit_menu != nullptr); Glib::ustring abbr = _unit_menu->getUnitAbbr(); _suffix->set_label(abbr); -- cgit v1.2.3