diff options
author | Max Kellermann <max@duempel.org> | 2013-10-19 18:19:03 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-19 18:19:03 +0200 |
commit | 59f8144c50765189594d5932fc25869f9ea6e265 (patch) | |
tree | f460d9f46a99040dea402bcb3ad2d84a0e734285 /src/SongUpdate.cxx | |
parent | 5a7c931293b55a27c3f79c6951707a8d6e2a5f6c (diff) | |
download | mpd-59f8144c50765189594d5932fc25869f9ea6e265.tar.gz mpd-59f8144c50765189594d5932fc25869f9ea6e265.tar.xz mpd-59f8144c50765189594d5932fc25869f9ea6e265.zip |
*: use nullptr instead of NULL
Diffstat (limited to 'src/SongUpdate.cxx')
-rw-r--r-- | src/SongUpdate.cxx | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx index 362f17e8a..8d8a2d686 100644 --- a/src/SongUpdate.cxx +++ b/src/SongUpdate.cxx @@ -48,21 +48,21 @@ Song::LoadFile(const char *path_utf8, Directory *parent) Song *song; bool ret; - assert((parent == NULL) == PathTraits::IsAbsoluteUTF8(path_utf8)); + assert((parent == nullptr) == PathTraits::IsAbsoluteUTF8(path_utf8)); assert(!uri_has_scheme(path_utf8)); - assert(strchr(path_utf8, '\n') == NULL); + assert(strchr(path_utf8, '\n') == nullptr); song = NewFile(path_utf8, parent); //in archive ? - if (parent != NULL && parent->device == DEVICE_INARCHIVE) { + if (parent != nullptr && parent->device == DEVICE_INARCHIVE) { ret = song->UpdateFileInArchive(); } else { ret = song->UpdateFile(); } if (!ret) { song->Free(); - return NULL; + return nullptr; } return song; @@ -85,18 +85,18 @@ Song::UpdateFile() const char *suffix; const struct decoder_plugin *plugin; struct stat st; - struct input_stream *is = NULL; + struct input_stream *is = nullptr; assert(IsFile()); /* check if there's a suffix and a plugin */ suffix = uri_get_suffix(uri); - if (suffix == NULL) + if (suffix == nullptr) return false; - plugin = decoder_plugin_from_suffix(suffix, NULL); - if (plugin == NULL) + plugin = decoder_plugin_from_suffix(suffix, nullptr); + if (plugin == nullptr) return false; const auto path_fs = map_song_fs(this); @@ -126,16 +126,16 @@ Song::UpdateFile() tag_builder.Clear(); /* fall back to stream tag */ - if (plugin->scan_stream != NULL) { + if (plugin->scan_stream != nullptr) { /* open the input_stream (if not already open) */ - if (is == NULL) + if (is == nullptr) is = input_stream::Open(path_fs.c_str(), mutex, cond, IgnoreError()); /* now try the stream_tag() method */ - if (is != NULL) { + if (is != nullptr) { if (decoder_plugin_scan_stream(plugin, is, &full_tag_handler, &tag_builder)) @@ -148,9 +148,9 @@ Song::UpdateFile() } plugin = decoder_plugin_from_suffix(suffix, plugin); - } while (plugin != NULL); + } while (plugin != nullptr); - if (is != NULL) + if (is != nullptr) is->Close(); if (!tag_builder.IsDefined()) @@ -175,11 +175,11 @@ Song::UpdateFileInArchive() /* check if there's a suffix and a plugin */ suffix = uri_get_suffix(uri); - if (suffix == NULL) + if (suffix == nullptr) return false; - plugin = decoder_plugin_from_suffix(suffix, NULL); - if (plugin == NULL) + plugin = decoder_plugin_from_suffix(suffix, nullptr); + if (plugin == nullptr) return false; delete tag; |