summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-02-01 13:49:19 +0100
committerMax Kellermann <max@musicpd.org>2020-09-07 20:08:27 +0200
commit540919f256c761a3e5ce5cfa3d5c343ef09ed673 (patch)
tree6cd6f0648a4fc50ea7b973ad910c12b3ac476216
parent398281cd76f398b6db1a5f7bc8bed9d11374a465 (diff)
*: use nullptr instead of NULL
-rw-r--r--src/Permission.cxx2
-rw-r--r--src/db/plugins/upnp/ContentDirectoryService.cxx6
-rw-r--r--src/input/plugins/AlsaInputPlugin.cxx12
-rw-r--r--src/lib/alsa/HwSetup.cxx12
-rw-r--r--src/lib/upnp/ContentDirectoryService.cxx2
-rw-r--r--src/mixer/MixerType.cxx2
-rw-r--r--src/output/State.cxx2
-rw-r--r--src/unix/SignalHandlers.cxx2
-rw-r--r--src/util/FormatString.cxx2
-rw-r--r--test/DumpDatabase.cxx2
-rw-r--r--test/dump_playlist.cxx6
-rw-r--r--test/dump_rva2.cxx2
-rw-r--r--test/read_mixer.cxx2
-rw-r--r--test/read_tags.cxx4
-rw-r--r--test/run_encoder.cxx2
-rw-r--r--test/run_filter.cxx2
-rw-r--r--test/test_vorbis_encoder.cxx2
17 files changed, 32 insertions, 32 deletions
diff --git a/src/Permission.cxx b/src/Permission.cxx
index a31c3a48e..b350da581 100644
--- a/src/Permission.cxx
+++ b/src/Permission.cxx
@@ -101,7 +101,7 @@ initPermissions(const ConfigData &config)
const char *separator = strchr(param.value.c_str(),
PERMISSION_PASSWORD_CHAR);
- if (separator == NULL)
+ if (separator == nullptr)
throw FormatRuntimeError("\"%c\" not found in password string "
"\"%s\", line %i",
PERMISSION_PASSWORD_CHAR,
diff --git a/src/db/plugins/upnp/ContentDirectoryService.cxx b/src/db/plugins/upnp/ContentDirectoryService.cxx
index 4e99a0187..99893d89d 100644
--- a/src/db/plugins/upnp/ContentDirectoryService.cxx
+++ b/src/db/plugins/upnp/ContentDirectoryService.cxx
@@ -65,7 +65,7 @@ ContentDirectoryService::readDirSlice(UpnpClient_Handle hdl,
IXML_Document *response;
int code = UpnpSendAction(hdl, m_actionURL.c_str(), m_serviceType.c_str(),
- 0 /*devUDN*/, request, &response);
+ nullptr /*devUDN*/, request, &response);
if (code != UPNP_E_SUCCESS)
throw FormatRuntimeError("UpnpSendAction() failed: %s",
UpnpGetErrorMessage(code));
@@ -124,7 +124,7 @@ ContentDirectoryService::search(UpnpClient_Handle hdl,
IXML_Document *_response;
auto code = UpnpSendAction(hdl, m_actionURL.c_str(),
m_serviceType.c_str(),
- 0 /*devUDN*/,
+ nullptr /*devUDN*/,
request.get(), &_response);
if (code != UPNP_E_SUCCESS)
throw FormatRuntimeError("UpnpSendAction() failed: %s",
@@ -170,7 +170,7 @@ ContentDirectoryService::getMetadata(UpnpClient_Handle hdl,
IXML_Document *_response;
auto code = UpnpSendAction(hdl, m_actionURL.c_str(),
m_serviceType.c_str(),
- 0 /*devUDN*/, request.get(), &_response);
+ nullptr /*devUDN*/, request.get(), &_response);
if (code != UPNP_E_SUCCESS)
throw FormatRuntimeError("UpnpSendAction() failed: %s",
UpnpGetErrorMessage(code));
diff --git a/src/input/plugins/AlsaInputPlugin.cxx b/src/input/plugins/AlsaInputPlugin.cxx
index 4cdfdbbaf..3cec5724c 100644
--- a/src/input/plugins/AlsaInputPlugin.cxx
+++ b/src/input/plugins/AlsaInputPlugin.cxx
@@ -305,18 +305,18 @@ ConfigureCapture(snd_pcm_t *capture_handle,
snd_pcm_hw_params_get_buffer_size_min(hw_params, &buffer_size_min);
snd_pcm_hw_params_get_buffer_size_max(hw_params, &buffer_size_max);
unsigned buffer_time_min, buffer_time_max;
- snd_pcm_hw_params_get_buffer_time_min(hw_params, &buffer_time_min, 0);
- snd_pcm_hw_params_get_buffer_time_max(hw_params, &buffer_time_max, 0);
+ snd_pcm_hw_params_get_buffer_time_min(hw_params, &buffer_time_min, nullptr);
+ snd_pcm_hw_params_get_buffer_time_max(hw_params, &buffer_time_max, nullptr);
FormatDebug(alsa_input_domain, "buffer: size=%u..%u time=%u..%u",
(unsigned)buffer_size_min, (unsigned)buffer_size_max,
buffer_time_min, buffer_time_max);
snd_pcm_uframes_t period_size_min, period_size_max;
- snd_pcm_hw_params_get_period_size_min(hw_params, &period_size_min, 0);
- snd_pcm_hw_params_get_period_size_max(hw_params, &period_size_max, 0);
+ snd_pcm_hw_params_get_period_size_min(hw_params, &period_size_min, nullptr);
+ snd_pcm_hw_params_get_period_size_max(hw_params, &period_size_max, nullptr);
unsigned period_time_min, period_time_max;
- snd_pcm_hw_params_get_period_time_min(hw_params, &period_time_min, 0);
- snd_pcm_hw_params_get_period_time_max(hw_params, &period_time_max, 0);
+ snd_pcm_hw_params_get_period_time_min(hw_params, &period_time_min, nullptr);
+ snd_pcm_hw_params_get_period_time_max(hw_params, &period_time_max, nullptr);
FormatDebug(alsa_input_domain, "period: size=%u..%u time=%u..%u",
(unsigned)period_size_min, (unsigned)period_size_max,
period_time_min, period_time_max);
diff --git a/src/lib/alsa/HwSetup.cxx b/src/lib/alsa/HwSetup.cxx
index abdaf983f..15fd95b67 100644
--- a/src/lib/alsa/HwSetup.cxx
+++ b/src/lib/alsa/HwSetup.cxx
@@ -238,18 +238,18 @@ SetupHw(snd_pcm_t *pcm,
snd_pcm_hw_params_get_buffer_size_min(hwparams, &buffer_size_min);
snd_pcm_hw_params_get_buffer_size_max(hwparams, &buffer_size_max);
unsigned buffer_time_min, buffer_time_max;
- snd_pcm_hw_params_get_buffer_time_min(hwparams, &buffer_time_min, 0);
- snd_pcm_hw_params_get_buffer_time_max(hwparams, &buffer_time_max, 0);
+ snd_pcm_hw_params_get_buffer_time_min(hwparams, &buffer_time_min, nullptr);
+ snd_pcm_hw_params_get_buffer_time_max(hwparams, &buffer_time_max, nullptr);
FormatDebug(alsa_output_domain, "buffer: size=%u..%u time=%u..%u",
(unsigned)buffer_size_min, (unsigned)buffer_size_max,
buffer_time_min, buffer_time_max);
snd_pcm_uframes_t period_size_min, period_size_max;
- snd_pcm_hw_params_get_period_size_min(hwparams, &period_size_min, 0);
- snd_pcm_hw_params_get_period_size_max(hwparams, &period_size_max, 0);
+ snd_pcm_hw_params_get_period_size_min(hwparams, &period_size_min, nullptr);
+ snd_pcm_hw_params_get_period_size_max(hwparams, &period_size_max, nullptr);
unsigned period_time_min, period_time_max;
- snd_pcm_hw_params_get_period_time_min(hwparams, &period_time_min, 0);
- snd_pcm_hw_params_get_period_time_max(hwparams, &period_time_max, 0);
+ snd_pcm_hw_params_get_period_time_min(hwparams, &period_time_min, nullptr);
+ snd_pcm_hw_params_get_period_time_max(hwparams, &period_time_max, nullptr);
FormatDebug(alsa_output_domain, "period: size=%u..%u time=%u..%u",
(unsigned)period_size_min, (unsigned)period_size_max,
period_time_min, period_time_max);
diff --git a/src/lib/upnp/ContentDirectoryService.cxx b/src/lib/upnp/ContentDirectoryService.cxx
index 12b67e6a3..ae514c717 100644
--- a/src/lib/upnp/ContentDirectoryService.cxx
+++ b/src/lib/upnp/ContentDirectoryService.cxx
@@ -60,7 +60,7 @@ ContentDirectoryService::getSearchCapabilities(UpnpClient_Handle hdl) const
IXML_Document *_response;
auto code = UpnpSendAction(hdl, m_actionURL.c_str(),
m_serviceType.c_str(),
- 0 /*devUDN*/, request.get(), &_response);
+ nullptr /*devUDN*/, request.get(), &_response);
if (code != UPNP_E_SUCCESS)
throw FormatRuntimeError("UpnpSendAction() failed: %s",
UpnpGetErrorMessage(code));
diff --git a/src/mixer/MixerType.cxx b/src/mixer/MixerType.cxx
index 8f835835f..46e67d5b6 100644
--- a/src/mixer/MixerType.cxx
+++ b/src/mixer/MixerType.cxx
@@ -27,7 +27,7 @@
MixerType
mixer_type_parse(const char *input)
{
- assert(input != NULL);
+ assert(input != nullptr);
if (strcmp(input, "none") == 0 || strcmp(input, "disabled") == 0)
return MixerType::NONE;
diff --git a/src/output/State.cxx b/src/output/State.cxx
index ada2353c9..e393d8b92 100644
--- a/src/output/State.cxx
+++ b/src/output/State.cxx
@@ -70,7 +70,7 @@ audio_output_state_read(const char *line, MultipleOutputs &outputs)
name = endptr + 1;
auto *ao = outputs.FindByName(name);
- if (ao == NULL) {
+ if (ao == nullptr) {
FormatDebug(output_domain,
"Ignoring device state for '%s'", name);
return true;
diff --git a/src/unix/SignalHandlers.cxx b/src/unix/SignalHandlers.cxx
index 5a0131929..b32edd5e4 100644
--- a/src/unix/SignalHandlers.cxx
+++ b/src/unix/SignalHandlers.cxx
@@ -42,7 +42,7 @@ HandleShutdownSignal(void *ctx) noexcept
static void
x_sigaction(int signum, const struct sigaction *act)
{
- if (sigaction(signum, act, NULL) < 0)
+ if (sigaction(signum, act, nullptr) < 0)
throw MakeErrno("sigaction() failed");
}
diff --git a/src/util/FormatString.cxx b/src/util/FormatString.cxx
index 5128a93e9..8d76cf742 100644
--- a/src/util/FormatString.cxx
+++ b/src/util/FormatString.cxx
@@ -28,7 +28,7 @@ FormatStringV(const char *fmt, va_list args) noexcept
{
va_list tmp;
va_copy(tmp, args);
- const int length = vsnprintf(NULL, 0, fmt, tmp);
+ const int length = vsnprintf(nullptr, 0, fmt, tmp);
va_end(tmp);
if (length <= 0)
diff --git a/test/DumpDatabase.cxx b/test/DumpDatabase.cxx
index 39801baf2..81fa14418 100644
--- a/test/DumpDatabase.cxx
+++ b/test/DumpDatabase.cxx
@@ -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;
}
diff --git a/test/dump_playlist.cxx b/test/dump_playlist.cxx
index ba973703b..a7416bf5d 100644
--- a/test/dump_playlist.cxx
+++ b/test/dump_playlist.cxx
@@ -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();
diff --git a/test/dump_rva2.cxx b/test/dump_rva2.cxx
index 3f454606d..ebeb9e582 100644
--- a/test/dump_rva2.cxx
+++ b/test/dump_rva2.cxx
@@ -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;
}
diff --git a/test/read_mixer.cxx b/test/read_mixer.cxx
index ad50b8bb4..008ab29e6 100644
--- a/test/read_mixer.cxx
+++ b/test/read_mixer.cxx
@@ -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)
diff --git a/test/read_tags.cxx b/test/read_tags.cxx
index 7c392dc2b..aafc58a3b 100644
--- a/test/read_tags.cxx
+++ b/test/read_tags.cxx
@@ -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);
}
diff --git a/test/run_encoder.cxx b/test/run_encoder.cxx
index 9096d9e5b..97f9d90b5 100644
--- a/test/run_encoder.cxx
+++ b/test/run_encoder.cxx
@@ -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;
}
diff --git a/test/run_filter.cxx b/test/run_filter.cxx
index 40dce22c2..5113a7250 100644
--- a/test/run_filter.cxx
+++ b/test/run_filter.cxx
@@ -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);
diff --git a/test/test_vorbis_encoder.cxx b/test/test_vorbis_encoder.cxx
index 2524d4564..26c8a8784 100644
--- a/test/test_vorbis_encoder.cxx
+++ b/test/test_vorbis_encoder.cxx
@@ -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);