summaryrefslogtreecommitdiffstats
path: root/src/extension/dependency.cpp
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-15 10:46:15 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2018-06-18 12:27:01 +0000
commitf4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 (patch)
tree7c6044fd3a17a2665841959dac9b3b2110b27924 /src/extension/dependency.cpp
parentRun clang-tidy’s modernize-use-override pass. (diff)
downloadinkscape-f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43.tar.gz
inkscape-f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43.zip
Run clang-tidy’s modernize-use-nullptr pass.
This replaces all NULL or 0 with nullptr when assigned to or returned as a pointer.
Diffstat (limited to 'src/extension/dependency.cpp')
-rw-r--r--src/extension/dependency.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/extension/dependency.cpp b/src/extension/dependency.cpp
index 5e843ee11..07462e5e7 100644
--- a/src/extension/dependency.cpp
+++ b/src/extension/dependency.cpp
@@ -51,20 +51,20 @@ Dependency::Dependency (Inkscape::XML::Node * in_repr)
_type = TYPE_FILE;
_location = LOCATION_PATH;
_repr = in_repr;
- _string = NULL;
- _description = NULL;
+ _string = nullptr;
+ _description = nullptr;
Inkscape::GC::anchor(_repr);
if (const gchar * location = _repr->attribute("location")) {
- for (int i = 0; i < LOCATION_CNT && location != NULL; i++) {
+ for (int i = 0; i < LOCATION_CNT && location != nullptr; i++) {
if (!strcmp(location, _location_str[i])) {
_location = (location_t)i;
break;
}
}
} else if (const gchar * location = _repr->attribute("reldir")) {
- for (int i = 0; i < LOCATION_CNT && location != NULL; i++) {
+ for (int i = 0; i < LOCATION_CNT && location != nullptr; i++) {
if (!strcmp(location, _location_str[i])) {
_location = (location_t)i;
break;
@@ -73,7 +73,7 @@ Dependency::Dependency (Inkscape::XML::Node * in_repr)
}
const gchar * type = _repr->attribute("type");
- for (int i = 0; i < TYPE_CNT && type != NULL; i++) {
+ for (int i = 0; i < TYPE_CNT && type != nullptr; i++) {
if (!strcmp(type, _type_str[i])) {
_type = (type_t)i;
break;
@@ -83,7 +83,7 @@ Dependency::Dependency (Inkscape::XML::Node * in_repr)
_string = _repr->firstChild()->content();
_description = _repr->attribute("description");
- if (_description == NULL)
+ if (_description == nullptr)
_description = _repr->attribute("_description");
return;
@@ -133,12 +133,12 @@ bool Dependency::check (void) const
{
// std::cout << "Checking: " << *this << std::endl;
- if (_string == NULL) return FALSE;
+ if (_string == nullptr) return FALSE;
switch (_type) {
case TYPE_EXTENSION: {
Extension * myext = db.get(_string);
- if (myext == NULL) return FALSE;
+ if (myext == nullptr) return FALSE;
if (myext->deactivated()) return FALSE;
break;
}
@@ -171,7 +171,7 @@ bool Dependency::check (void) const
default: {
gchar * path = g_strdup(g_getenv("PATH"));
- if (path == NULL) {
+ if (path == nullptr) {
/* There is no `PATH' in the environment.
The default search path is the current directory */
path = g_strdup(G_SEARCHPATH_SEPARATOR_S);
@@ -179,7 +179,7 @@ bool Dependency::check (void) const
gchar * orig_path = path;
- for (; path != NULL;) {
+ for (; path != nullptr;) {
gchar * local_path; // to have the path after detection of the separator
Glib::ustring final_name;
@@ -188,7 +188,7 @@ bool Dependency::check (void) const
/* Not sure whether this is UTF8 happy, but it would seem
like it considering that I'm searching (and finding)
the ':' character */
- if (path != NULL) {
+ if (path != nullptr) {
path[0] = '\0';
path++;
}
@@ -255,7 +255,7 @@ operator<< (std::ostream &out_file, const Dependency & in_dep)
out_file << _(" location: ") << _(in_dep._location_str[in_dep._location]) << '\n';
out_file << _(" string: ") << in_dep._string << '\n';
- if (in_dep._description != NULL) {
+ if (in_dep._description != nullptr) {
out_file << _(" description: ") << _(in_dep._description) << '\n';
}