Commit 5348808b authored by Max Kellermann's avatar Max Kellermann

PlaylistPlugin, ConfigGlobal: use nullptr instead of NULL

parent fccba1af
......@@ -92,7 +92,7 @@ config_get_string(ConfigOption option, const char *default_value)
{
const struct config_param *param = config_get_param(option);
if (param == NULL)
if (param == nullptr)
return default_value;
return param->value;
......@@ -102,7 +102,7 @@ Path
config_get_path(ConfigOption option, Error &error)
{
const struct config_param *param = config_get_param(option);
if (param == NULL)
if (param == nullptr)
return Path::Null();
Path path = ParsePath(param->value, error);
......@@ -120,7 +120,7 @@ config_get_unsigned(ConfigOption option, unsigned default_value)
long value;
char *endptr;
if (param == NULL)
if (param == nullptr)
return default_value;
value = strtol(param->value, &endptr, 0);
......@@ -138,7 +138,7 @@ config_get_positive(ConfigOption option, unsigned default_value)
long value;
char *endptr;
if (param == NULL)
if (param == nullptr)
return default_value;
value = strtol(param->value, &endptr, 0);
......@@ -157,7 +157,7 @@ config_get_bool(ConfigOption option, bool default_value)
const struct config_param *param = config_get_param(option);
bool success, value;
if (param == NULL)
if (param == nullptr)
return default_value;
success = get_bool(param->value, &value);
......
......@@ -23,8 +23,6 @@
#include "ConfigOption.hxx"
#include "gcc.h"
#include <stddef.h>
class Error;
class Path;
......@@ -41,7 +39,7 @@ bool
ReadConfigFile(const Path &path, Error &error);
/* don't free the returned value
set _last_ to NULL to get first entry */
set _last_ to nullptr to get first entry */
gcc_pure
const struct config_param *
config_get_next_param(enum ConfigOption option,
......@@ -51,7 +49,7 @@ gcc_pure
static inline const struct config_param *
config_get_param(enum ConfigOption option)
{
return config_get_next_param(option, NULL);
return config_get_next_param(option, nullptr);
}
/* Note on gcc_pure: Some of the functions declared pure are not
......
......@@ -23,8 +23,6 @@
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include <stddef.h>
struct config_param;
struct input_stream;
struct Tag;
......@@ -50,7 +48,7 @@ struct playlist_plugin {
/**
* Initialize the plugin. Optional method.
*
* @param param a configuration block for this plugin, or NULL
* @param param a configuration block for this plugin, or nullptr
* if none is configured
* @return true if the plugin was initialized successfully,
* false if the plugin is not available
......@@ -89,7 +87,7 @@ struct playlist_plugin {
/**
* Initialize a plugin.
*
* @param param a configuration block for this plugin, or NULL if none
* @param param a configuration block for this plugin, or nullptr if none
* is configured
* @return true if the plugin was initialized successfully, false if
* the plugin is not available
......@@ -98,7 +96,7 @@ static inline bool
playlist_plugin_init(const struct playlist_plugin *plugin,
const config_param &param)
{
return plugin->init != NULL
return plugin->init != nullptr
? plugin->init(param)
: true;
}
......@@ -109,7 +107,7 @@ playlist_plugin_init(const struct playlist_plugin *plugin,
static inline void
playlist_plugin_finish(const struct playlist_plugin *plugin)
{
if (plugin->finish != NULL)
if (plugin->finish != nullptr)
plugin->finish();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment