*: use nullptr instead of NULL
This commit is contained in:
@@ -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,
|
||||
|
@@ -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));
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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));
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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");
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user