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/main-cmdlineact.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main-cmdlineact.cpp') diff --git a/src/main-cmdlineact.cpp b/src/main-cmdlineact.cpp index 4c4cf5f9a..6b97616dd 100644 --- a/src/main-cmdlineact.cpp +++ b/src/main-cmdlineact.cpp @@ -28,8 +28,8 @@ namespace Inkscape { std::list CmdLineAction::_list; -CmdLineAction::CmdLineAction (bool isVerb, gchar const * arg) : _isVerb(isVerb), _arg(NULL) { - if (arg != NULL) { +CmdLineAction::CmdLineAction (bool isVerb, gchar const * arg) : _isVerb(isVerb), _arg(nullptr) { + if (arg != nullptr) { _arg = g_strdup(arg); } @@ -39,7 +39,7 @@ CmdLineAction::CmdLineAction (bool isVerb, gchar const * arg) : _isVerb(isVerb), } CmdLineAction::~CmdLineAction () { - if (_arg != NULL) { + if (_arg != nullptr) { g_free(_arg); } } @@ -66,18 +66,18 @@ CmdLineAction::doIt (ActionContext const & context) { } Inkscape::Verb * verb = Inkscape::Verb::getbyid(_arg); - if (verb == NULL) { + if (verb == nullptr) { printf(_("Unable to find verb ID '%s' specified on the command line.\n"), _arg); return; } SPAction * action = verb->get_action(context); - sp_action_perform(action, NULL); + sp_action_perform(action, nullptr); } else { - if (context.getDocument() == NULL || context.getSelection() == NULL) { return; } + if (context.getDocument() == nullptr || context.getSelection() == nullptr) { return; } SPDocument * doc = context.getDocument(); SPObject * obj = doc->getObjectById(_arg); - if (obj == NULL) { + if (obj == nullptr) { printf(_("Unable to find node ID: '%s'\n"), _arg); return; } -- cgit v1.2.3