diff options
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-15 10:46:15 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2018-06-18 12:27:01 +0000 |
| commit | f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 (patch) | |
| tree | 7c6044fd3a17a2665841959dac9b3b2110b27924 /src/io/resource.cpp | |
| parent | Run clang-tidy’s modernize-use-override pass. (diff) | |
| download | inkscape-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/io/resource.cpp')
| -rw-r--r-- | src/io/resource.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/io/resource.cpp b/src/io/resource.cpp index 0b242cc31..f8cf9fce4 100644 --- a/src/io/resource.cpp +++ b/src/io/resource.cpp @@ -44,10 +44,10 @@ namespace Resource { gchar *_get_path(Domain domain, Type type, char const *filename) { - gchar *path=NULL; + gchar *path=nullptr; switch (domain) { case SYSTEM: { - gchar const* temp = 0; + gchar const* temp = nullptr; switch (type) { case APPICONS: temp = INKSCAPE_APPICONDIR; break; case EXTENSIONS: temp = INKSCAPE_EXTENSIONDIR; break; @@ -71,7 +71,7 @@ gchar *_get_path(Domain domain, Type type, char const *filename) path = g_strdup(temp); } break; case CREATE: { - gchar const* temp = 0; + gchar const* temp = nullptr; switch (type) { case GRADIENTS: temp = CREATE_GRADIENTSDIR; break; case PALETTES: temp = CREATE_PALETTESDIR; break; @@ -84,7 +84,7 @@ gchar *_get_path(Domain domain, Type type, char const *filename) path = g_build_filename(g_get_user_cache_dir(), "inkscape", NULL); } break; case USER: { - char const *name=NULL; + char const *name=nullptr; switch (type) { case EXTENSIONS: name = "extensions"; break; case FILTERS: name = "filters"; break; @@ -145,7 +145,7 @@ Glib::ustring get_filename(Type type, char const *filename, char const *locale) { Glib::ustring result; - if(locale != NULL) { + if(locale != nullptr) { char *user_locale = _get_path(USER, type, filename); char *sys_locale = _get_path(SYSTEM, type, filename); @@ -288,7 +288,7 @@ void get_filenames_from_path(std::vector<Glib::ustring> &files, Glib::ustring pa */ char *profile_path(const char *filename) { - static const gchar *prefdir = NULL; + static const gchar *prefdir = nullptr; if (!prefdir) { @@ -356,7 +356,7 @@ char *profile_path(const char *filename) int problem = errno; g_warning("Unable to create profile directory (%s) (%d)", g_strerror(problem), problem); } else { - gchar const *userDirs[] = {"keys", "templates", "icons", "extensions", "palettes", NULL}; + gchar const *userDirs[] = {"keys", "templates", "icons", "extensions", "palettes", nullptr}; for (gchar const** name = userDirs; *name; ++name) { gchar *dir = g_build_filename(prefdir, *name, NULL); g_mkdir_with_parents(dir, mode); @@ -379,7 +379,7 @@ char *log_path(const char *filename) char *homedir_path(const char *filename) { - static const gchar *homedir = NULL; + static const gchar *homedir = nullptr; homedir = g_get_home_dir(); // I suspect this is for handling inkscape app packages |
