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-cmdlinexact.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/main-cmdlinexact.cpp') diff --git a/src/main-cmdlinexact.cpp b/src/main-cmdlinexact.cpp index fe4d52220..a407d3c0e 100644 --- a/src/main-cmdlinexact.cpp +++ b/src/main-cmdlinexact.cpp @@ -143,12 +143,12 @@ void xFileOpen( const Glib::ustring &uri ) Inkscape::DocumentUndo::clearUndo(old_document); } - SPDocument *doc = NULL; - Inkscape::Extension::Extension *key = NULL; + SPDocument *doc = nullptr; + Inkscape::Extension::Extension *key = nullptr; try { doc = Inkscape::Extension::open(key, document_filename.c_str()); } catch (std::exception &e) { - doc = NULL; + doc = nullptr; std::string exeption_mgs = e.what(); printf("Error: open %s:%s\n",document_filename.c_str(), exeption_mgs.c_str() ); fflush(stdout); @@ -240,12 +240,12 @@ void xFileExportPNG( Inkscape::ActionContext const & context, const Glib::ustrin ExportResult status = sp_export_png_file(doc, document_filename.c_str(), Geom::Rect(Geom::Point(0,0), Geom::Point(width, height)), png_width, png_height, dpi, dpi, - nv->pagecolor, 0, 0, TRUE); + nv->pagecolor, nullptr, nullptr, TRUE); } void xSelectElement( Inkscape::ActionContext const & context, const Glib::ustring &element_name ) { - if (context.getDocument() == NULL || context.getSelection() == NULL) { + if (context.getDocument() == nullptr || context.getSelection() == nullptr) { return; } @@ -257,7 +257,7 @@ void xSelectElement( Inkscape::ActionContext const & context, const Glib::ustrin SPDocument * doc = context.getDocument(); SPObject * obj = doc->getObjectById(element_name); - if (obj == NULL) { + if (obj == nullptr) { printf(_("Unable to find node ID: '%s'\n"), element_name.c_str()); fflush(stdout); return; @@ -326,7 +326,7 @@ parseVerbsYAMLFile(gchar const *yaml_filename) verbs_list_t verbs_list; FILE *fh = g_fopen(yaml_filename, "r"); - if(fh == NULL) { + if(fh == nullptr) { printf("Failed to read from file %s\n", yaml_filename); fflush(stdout); @@ -555,7 +555,7 @@ CmdLineXAction::createActionsFromYAML( gchar const *yaml_filename ) ++undo_counter; new CmdLineAction(true, verb.args[0].c_str()); } - else if( Verb::getbyid(verb.args[0].c_str()) != NULL ) + else if( Verb::getbyid(verb.args[0].c_str()) != nullptr ) { ++undo_counter; new CmdLineAction(true, verb.args[0].c_str()); -- cgit v1.2.3