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/vanishing-point.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/vanishing-point.cpp') diff --git a/src/vanishing-point.cpp b/src/vanishing-point.cpp index de4e834bd..eed4cd48e 100644 --- a/src/vanishing-point.cpp +++ b/src/vanishing-point.cpp @@ -155,7 +155,7 @@ static void vp_knot_moved_handler(SPKnot *knot, Geom::Point const &ppointer, gui drag->draggers.erase(std::remove(drag->draggers.begin(), drag->draggers.end(), dragger), drag->draggers.end()); delete dragger; - dragger = NULL; + dragger = nullptr; // ... and merge any duplicate perspectives d_new->mergePerspectives(); @@ -268,7 +268,7 @@ std::list VanishingPoint::selectedBoxes(Inkscape::Selection *sel) VPDragger::VPDragger(VPDrag *parent, Geom::Point p, VanishingPoint &vp) : parent(parent) - , knot(NULL) + , knot(nullptr) , point(p) , point_original(p) , dragging_started(false) @@ -276,7 +276,7 @@ VPDragger::VPDragger(VPDrag *parent, Geom::Point p, VanishingPoint &vp) { if (vp.is_finite()) { // create the knot - this->knot = new SPKnot(SP_ACTIVE_DESKTOP, NULL); + this->knot = new SPKnot(SP_ACTIVE_DESKTOP, nullptr); this->knot->setMode(SP_KNOT_MODE_XOR); this->knot->setFill(VP_KNOT_COLOR_NORMAL, VP_KNOT_COLOR_NORMAL, VP_KNOT_COLOR_NORMAL, VP_KNOT_COLOR_NORMAL); this->knot->setStroke(0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff); @@ -319,7 +319,7 @@ void VPDragger::updateTip() { if (this->knot && this->knot->tip) { g_free(this->knot->tip); - this->knot->tip = NULL; + this->knot->tip = nullptr; } guint num = this->numberOfBoxes(); @@ -389,7 +389,7 @@ VanishingPoint *VPDragger::findVPWithBox(SPBox3D *box) return &(*vp); } } - return NULL; + return nullptr; } std::set VPDragger::VPsOfSelectedBoxes() @@ -534,7 +534,7 @@ VPDragger *VPDrag::getDraggerFor(VanishingPoint const &vp) } } } - return NULL; + return nullptr; } void VPDrag::printDraggers() @@ -560,7 +560,7 @@ void VPDrag::updateDraggers() } this->draggers.clear(); - g_return_if_fail(this->selection != NULL); + g_return_if_fail(this->selection != nullptr); auto itemlist = this->selection->items(); for (auto i = itemlist.begin(); i != itemlist.end(); ++i) { @@ -592,7 +592,7 @@ void VPDrag::updateLines() if (this->show_lines == 0) return; - g_return_if_fail(this->selection != NULL); + g_return_if_fail(this->selection != nullptr); auto itemlist = this->selection->items(); for (auto i = itemlist.begin(); i != itemlist.end(); ++i) { @@ -621,8 +621,8 @@ void VPDrag::updateBoxHandles() } Inkscape::UI::Tools::ToolBase *ec = INKSCAPE.active_event_context(); - g_assert(ec != NULL); - if (ec->shape_editor != NULL) { + g_assert(ec != nullptr); + if (ec->shape_editor != nullptr) { ec->shape_editor->update_knotholder(); } } -- cgit v1.2.3