From 5747f3139219abd6c8670953620cee1f5584caba Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 29 Jul 2020 16:30:13 +0200 Subject: Another round of 0->nullptr cleanup Change-Id: Ic8db7dc252f8fea46eb5a4f334726d6c7f4645a6 Reviewed-by: Sona Kurazyan --- src/gui/painting/qcompositionfunctions.cpp | 18 ++++++++++-------- src/gui/painting/qpathsimplifier.cpp | 8 ++++---- src/gui/painting/qpdf.cpp | 2 +- src/gui/painting/qtriangulator.cpp | 6 +++--- src/gui/painting/webgradients.cpp | 2 +- 5 files changed, 19 insertions(+), 17 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qcompositionfunctions.cpp b/src/gui/painting/qcompositionfunctions.cpp index ced213e36d..0d1e540c7a 100644 --- a/src/gui/painting/qcompositionfunctions.cpp +++ b/src/gui/painting/qcompositionfunctions.cpp @@ -3089,11 +3089,12 @@ CompositionFunctionSolid64 qt_functionForModeSolid64_C[] = { comp_func_solid_Difference_rgb64, comp_func_solid_Exclusion_rgb64, #else - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, #endif - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; CompositionFunction qt_functionForMode_C[] = { @@ -3164,11 +3165,12 @@ CompositionFunction64 qt_functionForMode64_C[] = { comp_func_Difference_rgb64, comp_func_Exclusion_rgb64, #else - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, #endif - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; QT_END_NAMESPACE diff --git a/src/gui/painting/qpathsimplifier.cpp b/src/gui/painting/qpathsimplifier.cpp index 256a2fefe7..74313c9ca2 100644 --- a/src/gui/painting/qpathsimplifier.cpp +++ b/src/gui/painting/qpathsimplifier.cpp @@ -880,9 +880,9 @@ void PathSimplifier::connectElements() #ifndef QT_NO_DEBUG for (int i = 0; i < m_elements.size(); ++i) { const Element *element = m_elements.at(i); - Q_ASSERT(element->next == 0 || element->next->previous == element); - Q_ASSERT(element->previous == 0 || element->previous->next == element); - Q_ASSERT((element->next == 0) == (element->previous == 0)); + Q_ASSERT(element->next == nullptr || element->next->previous == element); + Q_ASSERT(element->previous == nullptr || element->previous->next == element); + Q_ASSERT((element->next == nullptr) == (element->previous == nullptr)); } #endif } @@ -1442,7 +1442,7 @@ bool PathSimplifier::elementIsLeftOf(const Element *left, const Element *right) QPair PathSimplifier::outerBounds(const QPoint &point) { RBNode *current = m_elementList.root; - QPair result(0, 0); + QPair result(nullptr, nullptr); while (current) { const Element *element = current->data; diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index 925244a5a8..d510e28c6f 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -3038,7 +3038,7 @@ void QPdfEnginePrivate::drawTextItem(const QPointF &p, const QTextItemInt &ti) noEmbed = true; } - QFontSubset *font = fonts.value(face_id, 0); + QFontSubset *font = fonts.value(face_id, nullptr); if (!font) { font = new QFontSubset(fe, requestObject()); font->noEmbed = noEmbed; diff --git a/src/gui/painting/qtriangulator.cpp b/src/gui/painting/qtriangulator.cpp index d3080aeb58..1c21706fbd 100644 --- a/src/gui/painting/qtriangulator.cpp +++ b/src/gui/painting/qtriangulator.cpp @@ -1061,7 +1061,7 @@ template QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple::bounds(const QPodPoint &point) const { QRBTree::Node *current = m_edgeList.root; - QPair::Node *, QRBTree::Node *> result(0, 0); + QPair::Node *, QRBTree::Node *> result(nullptr, nullptr); while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); @@ -1110,7 +1110,7 @@ template QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple::outerBounds(const QPodPoint &point) const { QRBTree::Node *current = m_edgeList.root; - QPair::Node *, QRBTree::Node *> result(0, 0); + QPair::Node *, QRBTree::Node *> result(nullptr, nullptr); while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); @@ -1309,7 +1309,7 @@ void QTriangulator::ComplexToSimple::calculateIntersections() int vertex = (event.type == Event::Upper ? m_edges.at(event.edge).upper() : m_edges.at(event.edge).lower()); QIntersectionPoint eventPoint = QT_PREPEND_NAMESPACE(qIntersectionPoint)(event.point); - if (range.first != 0) { + if (range.first != nullptr) { splitEdgeListRange(range.first, range.second, vertex, eventPoint); reorderEdgeListRange(range.first, range.second); } diff --git a/src/gui/painting/webgradients.cpp b/src/gui/painting/webgradients.cpp index 33bbcc4319..d837c4383c 100644 --- a/src/gui/painting/webgradients.cpp +++ b/src/gui/painting/webgradients.cpp @@ -572,7 +572,7 @@ static Q_CONSTEXPR QGradient::QGradientData qt_preset_gradient_data[] = { static void *qt_preset_gradient_dummy() { union {void *p; uint i;}; - p = 0; + p = nullptr; i |= uint(QGradient::ObjectMode); return p; } -- cgit v1.2.3