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/extension/param/float.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/extension/param/float.cpp') diff --git a/src/extension/param/float.cpp b/src/extension/param/float.cpp index 1dd3f073b..aaf871068 100644 --- a/src/extension/param/float.cpp +++ b/src/extension/param/float.cpp @@ -40,27 +40,27 @@ ParamFloat::ParamFloat(const gchar * name, , _min(0.0) , _max(10.0) { - const gchar * defaultval = NULL; - if (xml->firstChild() != NULL) { + const gchar * defaultval = nullptr; + if (xml->firstChild() != nullptr) { defaultval = xml->firstChild()->content(); } - if (defaultval != NULL) { - _value = g_ascii_strtod (defaultval,NULL); + if (defaultval != nullptr) { + _value = g_ascii_strtod (defaultval,nullptr); } const char * maxval = xml->attribute("max"); - if (maxval != NULL) { - _max = g_ascii_strtod (maxval,NULL); + if (maxval != nullptr) { + _max = g_ascii_strtod (maxval,nullptr); } const char * minval = xml->attribute("min"); - if (minval != NULL) { - _min = g_ascii_strtod (minval,NULL); + if (minval != nullptr) { + _min = g_ascii_strtod (minval,nullptr); } _precision = 1; const char * precision = xml->attribute("precision"); - if (precision != NULL) { + if (precision != nullptr) { _precision = atoi(precision); } @@ -136,7 +136,7 @@ public: describing the parameter. */ ParamFloatAdjustment (ParamFloat * param, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::Adjustment(0.0, param->min(), param->max(), 0.1, 1.0, 0), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) { - this->set_value(_pref->get(NULL, NULL) /* \todo fix */); + this->set_value(_pref->get(nullptr, nullptr) /* \todo fix */); this->signal_value_changed().connect(sigc::mem_fun(this, &ParamFloatAdjustment::val_changed)); return; }; @@ -154,7 +154,7 @@ void ParamFloatAdjustment::val_changed(void) { //std::cout << "Value Changed to: " << this->get_value() << std::endl; _pref->set(this->get_value(), _doc, _node); - if (_changeSignal != NULL) { + if (_changeSignal != nullptr) { _changeSignal->emit(); } return; @@ -168,7 +168,7 @@ void ParamFloatAdjustment::val_changed(void) Gtk::Widget * ParamFloat::get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_hidden) { - return NULL; + return nullptr; } Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, Parameter::GUI_PARAM_WIDGETS_SPACING)); @@ -179,7 +179,7 @@ Gtk::Widget * ParamFloat::get_widget(SPDocument * doc, Inkscape::XML::Node * nod if (_mode == FULL) { Glib::ustring text; - if (_text != NULL) + if (_text != nullptr) text = _text; UI::Widget::SpinScale *scale = new UI::Widget::SpinScale(text, fadjust, _precision); scale->set_size_request(400, -1); -- cgit v1.2.3