*: use nullptr instead of NULL

This commit is contained in:
Max Kellermann
2020-02-01 13:49:19 +01:00
parent 398281cd76
commit 540919f256
17 changed files with 32 additions and 32 deletions

View File

@@ -112,7 +112,7 @@ try {
const char *const plugin_name = argv[2];
const DatabasePlugin *plugin = GetDatabasePluginByName(plugin_name);
if (plugin == NULL) {
if (plugin == nullptr) {
cerr << "No such database plugin: " << plugin_name << endl;
return EXIT_FAILURE;
}

View File

@@ -75,7 +75,7 @@ try {
InputStreamPtr is;
auto playlist = playlist_list_open_uri(uri, mutex);
if (playlist == NULL) {
if (playlist == nullptr) {
/* open the stream and wait until it becomes ready */
is = InputStream::OpenReady(uri, mutex);
@@ -83,7 +83,7 @@ try {
/* open the playlist */
playlist = playlist_list_open_stream(std::move(is), uri);
if (playlist == NULL) {
if (playlist == nullptr) {
fprintf(stderr, "Failed to open playlist\n");
return 2;
}
@@ -92,7 +92,7 @@ try {
/* dump the playlist */
std::unique_ptr<DetachedSong> song;
while ((song = playlist->NextSong()) != NULL) {
while ((song = playlist->NextSong()) != nullptr) {
printf("%s\n", song->GetURI());
const unsigned start_ms = song->GetStartTime().ToMS();

View File

@@ -70,7 +70,7 @@ try {
auto is = OpenLocalInputStream(path, mutex);
const auto tag = tag_id3_load(*is);
if (tag == NULL) {
if (tag == nullptr) {
fprintf(stderr, "No ID3 tag found\n");
return EXIT_FAILURE;
}

View File

@@ -36,7 +36,7 @@ const FilterPlugin *
filter_plugin_by_name(gcc_unused const char *name) noexcept
{
assert(false);
return NULL;
return nullptr;
}
int main(int argc, gcc_unused char **argv)

View File

@@ -100,7 +100,7 @@ try {
const ScopeDecoderPluginsInit decoder_plugins_init({});
plugin = decoder_plugin_from_name(decoder_name);
if (plugin == NULL) {
if (plugin == nullptr) {
fprintf(stderr, "No such decoder: %s\n", decoder_name);
return EXIT_FAILURE;
}
@@ -117,7 +117,7 @@ try {
Mutex mutex;
InputStreamPtr is;
if (!success && plugin->scan_stream != NULL) {
if (!success && plugin->scan_stream != nullptr) {
is = InputStream::OpenReady(path, mutex);
success = plugin->ScanStream(*is, h);
}

View File

@@ -55,7 +55,7 @@ try {
/* create the encoder */
const auto plugin = encoder_plugin_get(encoder_name);
if (plugin == NULL) {
if (plugin == nullptr) {
fprintf(stderr, "No such encoder: %s\n", encoder_name);
return EXIT_FAILURE;
}

View File

@@ -53,7 +53,7 @@ LoadFilter(const ConfigData &config, const char *name)
{
const auto *param = config.FindBlock(ConfigBlockOption::AUDIO_FILTER,
"name", name);
if (param == NULL)
if (param == nullptr)
throw FormatRuntimeError("No such configured filter: %s",
name);

View File

@@ -41,7 +41,7 @@ try {
/* create the encoder */
const auto plugin = encoder_plugin_get("vorbis");
assert(plugin != NULL);
assert(plugin != nullptr);
ConfigBlock block;
block.AddBlockParam("quality", "5.0", -1);