aboutsummaryrefslogtreecommitdiffstats
path: root/src/UpdateWalk.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-19 18:19:03 +0200
committerMax Kellermann <max@duempel.org>2013-10-19 18:19:03 +0200
commit59f8144c50765189594d5932fc25869f9ea6e265 (patch)
treef460d9f46a99040dea402bcb3ad2d84a0e734285 /src/UpdateWalk.cxx
parent5a7c931293b55a27c3f79c6951707a8d6e2a5f6c (diff)
downloadmpd-59f8144c50765189594d5932fc25869f9ea6e265.tar.gz
mpd-59f8144c50765189594d5932fc25869f9ea6e265.tar.xz
mpd-59f8144c50765189594d5932fc25869f9ea6e265.zip
*: use nullptr instead of NULL
Diffstat (limited to 'src/UpdateWalk.cxx')
-rw-r--r--src/UpdateWalk.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/UpdateWalk.cxx b/src/UpdateWalk.cxx
index 1df41e4e1..acd58f9be 100644
--- a/src/UpdateWalk.cxx
+++ b/src/UpdateWalk.cxx
@@ -222,7 +222,7 @@ update_regular_file(Directory *directory,
const char *name, const struct stat *st)
{
const char *suffix = uri_get_suffix(name);
- if (suffix == NULL)
+ if (suffix == nullptr)
return false;
return update_song_file(directory, name, suffix, st) ||
@@ -237,7 +237,7 @@ static void
update_directory_child(Directory *directory,
const char *name, const struct stat *st)
{
- assert(strchr(name, '/') == NULL);
+ assert(strchr(name, '/') == nullptr);
if (S_ISREG(st->st_mode)) {
update_regular_file(directory, name, st);
@@ -269,7 +269,7 @@ static bool skip_path(Path path_fs)
const char *path = path_fs.c_str();
return (path[0] == '.' && path[1] == 0) ||
(path[0] == '.' && path[1] == '.' && path[2] == 0) ||
- strchr(path, '\n') != NULL;
+ strchr(path, '\n') != nullptr;
}
gcc_pure
@@ -310,7 +310,7 @@ skip_symlink(const Directory *directory, const char *utf8_name)
if (p[1] == '.' && PathTraits::IsSeparatorFS(p[2])) {
/* "../" moves to parent directory */
directory = directory->parent;
- if (directory == NULL) {
+ if (directory == nullptr) {
/* we have moved outside the music
directory - skip this symlink
if such symlinks are not allowed */
@@ -403,16 +403,16 @@ directory_make_child_checked(Directory *parent, const char *name_utf8)
Directory *directory = parent->FindChild(name_utf8);
db_unlock();
- if (directory != NULL)
+ if (directory != nullptr)
return directory;
struct stat st;
if (stat_directory_child(parent, name_utf8, &st) < 0 ||
find_inode_ancestor(parent, st.st_ino, st.st_dev))
- return NULL;
+ return nullptr;
if (skip_symlink(parent, name_utf8))
- return NULL;
+ return nullptr;
/* if we're adding directory paths, make sure to delete filenames
with potentially the same name */
@@ -435,14 +435,14 @@ directory_make_uri_parent_checked(const char *uri)
char *duplicated = g_strdup(uri);
char *name_utf8 = duplicated, *slash;
- while ((slash = strchr(name_utf8, '/')) != NULL) {
+ while ((slash = strchr(name_utf8, '/')) != nullptr) {
*slash = 0;
if (*name_utf8 == 0)
continue;
directory = directory_make_child_checked(directory, name_utf8);
- if (directory == NULL)
+ if (directory == nullptr)
break;
name_utf8 = slash + 1;
@@ -456,7 +456,7 @@ static void
update_uri(const char *uri)
{
Directory *parent = directory_make_uri_parent_checked(uri);
- if (parent == NULL)
+ if (parent == nullptr)
return;
char *name = g_path_get_basename(uri);
@@ -477,7 +477,7 @@ update_walk(const char *path, bool discard)
walk_discard = discard;
modified = false;
- if (path != NULL && !isRootDirectory(path)) {
+ if (path != nullptr && !isRootDirectory(path)) {
update_uri(path);
} else {
Directory *directory = db_get_root();