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/object/uri-references.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/object/uri-references.cpp') diff --git a/src/object/uri-references.cpp b/src/object/uri-references.cpp index 43dc996df..b4af31278 100644 --- a/src/object/uri-references.cpp +++ b/src/object/uri-references.cpp @@ -29,21 +29,21 @@ namespace Inkscape { URIReference::URIReference(SPObject *owner) : _owner(owner) - , _owner_document(NULL) - , _obj(NULL) - , _uri(NULL) + , _owner_document(nullptr) + , _obj(nullptr) + , _uri(nullptr) { - g_assert(_owner != NULL); + g_assert(_owner != nullptr); /* FIXME !!! attach to owner's destroy signal to clean up in case */ } URIReference::URIReference(SPDocument *owner_document) - : _owner(NULL) + : _owner(nullptr) , _owner_document(owner_document) - , _obj(NULL) - , _uri(NULL) + , _obj(nullptr) + , _uri(nullptr) { - g_assert(_owner_document != NULL); + g_assert(_owner_document != nullptr); } URIReference::~URIReference() { detach(); } @@ -109,7 +109,7 @@ bool URIReference::_acceptObject(SPObject *obj) const void URIReference::attach(const URI &uri) { - SPDocument *document = NULL; + SPDocument *document = nullptr; // Attempt to get the document that contains the URI if (_owner) { @@ -134,7 +134,7 @@ void URIReference::attach(const URI &uri) if (!path.empty()) { document = document->createChildDoc(path); } else { - document = NULL; + document = nullptr; } } if (!document) { @@ -153,7 +153,7 @@ void URIReference::attach(const URI &uri) /* for now this handles the minimal xpointer form that SVG 1.0 * requires of us */ - gchar *id = NULL; + gchar *id = nullptr; if (!strncmp(fragment, "xpointer(", 9)) { /* FIXME !!! this is wasteful */ /* FIXME: It looks as though this is including "))" in the id. I suggest moving @@ -189,14 +189,14 @@ void URIReference::detach() { _connection.disconnect(); delete _uri; - _uri = NULL; - _setObject(NULL); + _uri = nullptr; + _setObject(nullptr); } void URIReference::_setObject(SPObject *obj) { if (obj && !_acceptObject(obj)) { - obj = NULL; + obj = nullptr; } if (obj == _obj) @@ -224,7 +224,7 @@ void URIReference::_setObject(SPObject *obj) void URIReference::_release(SPObject *obj) { g_assert(_obj == obj); - _setObject(NULL); + _setObject(nullptr); } } /* namespace Inkscape */ @@ -233,7 +233,7 @@ void URIReference::_release(SPObject *obj) SPObject *sp_css_uri_reference_resolve(SPDocument *document, const gchar *uri) { - SPObject *ref = NULL; + SPObject *ref = nullptr; if (document && uri && (strncmp(uri, "url(", 4) == 0)) { gchar *trimmed = extract_uri(uri); @@ -248,7 +248,7 @@ SPObject *sp_css_uri_reference_resolve(SPDocument *document, const gchar *uri) SPObject *sp_uri_reference_resolve(SPDocument *document, const gchar *uri) { - SPObject *ref = NULL; + SPObject *ref = nullptr; if (uri && (*uri == '#')) { ref = document->getObjectById(uri + 1); -- cgit v1.2.3