*: use nullptr instead of NULL
This commit is contained in:
@@ -195,7 +195,7 @@ static snd_mixer_elem_t *
|
||||
alsa_mixer_lookup_elem(snd_mixer_t *handle, const char *name, unsigned idx)
|
||||
{
|
||||
for (snd_mixer_elem_t *elem = snd_mixer_first_elem(handle);
|
||||
elem != NULL; elem = snd_mixer_elem_next(elem)) {
|
||||
elem != nullptr; elem = snd_mixer_elem_next(elem)) {
|
||||
if (snd_mixer_elem_get_type(elem) == SND_MIXER_ELEM_SIMPLE &&
|
||||
StringEqualsCaseASCII(snd_mixer_selem_get_name(elem),
|
||||
name) &&
|
||||
@@ -203,7 +203,7 @@ alsa_mixer_lookup_elem(snd_mixer_t *handle, const char *name, unsigned idx)
|
||||
return elem;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline bool
|
||||
@@ -218,8 +218,8 @@ AlsaMixer::Setup(Error &error)
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((err = snd_mixer_selem_register(handle, NULL,
|
||||
NULL)) < 0) {
|
||||
if ((err = snd_mixer_selem_register(handle, nullptr,
|
||||
nullptr)) < 0) {
|
||||
error.Format(alsa_mixer_domain, err,
|
||||
"snd_mixer_selem_register() failed: %s",
|
||||
snd_strerror(err));
|
||||
@@ -234,7 +234,7 @@ AlsaMixer::Setup(Error &error)
|
||||
}
|
||||
|
||||
elem = alsa_mixer_lookup_elem(handle, control, index);
|
||||
if (elem == NULL) {
|
||||
if (elem == nullptr) {
|
||||
error.Format(alsa_mixer_domain, 0,
|
||||
"no such mixer control: %s", control);
|
||||
return false;
|
||||
@@ -283,11 +283,11 @@ alsa_mixer_open(Mixer *data, Error &error)
|
||||
inline void
|
||||
AlsaMixer::Close()
|
||||
{
|
||||
assert(handle != NULL);
|
||||
assert(handle != nullptr);
|
||||
|
||||
delete monitor;
|
||||
|
||||
snd_mixer_elem_set_callback(elem, NULL);
|
||||
snd_mixer_elem_set_callback(elem, nullptr);
|
||||
snd_mixer_close(handle);
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ AlsaMixer::GetVolume(Error &error)
|
||||
int ret;
|
||||
long level;
|
||||
|
||||
assert(handle != NULL);
|
||||
assert(handle != nullptr);
|
||||
|
||||
err = snd_mixer_handle_events(handle);
|
||||
if (err < 0) {
|
||||
@@ -351,7 +351,7 @@ AlsaMixer::SetVolume(unsigned volume, Error &error)
|
||||
long level;
|
||||
int err;
|
||||
|
||||
assert(handle != NULL);
|
||||
assert(handle != nullptr);
|
||||
|
||||
vol = volume;
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ pulse_mixer_volume_cb(gcc_unused pa_context *context, const pa_sink_input_info *
|
||||
if (eol)
|
||||
return;
|
||||
|
||||
if (i == NULL) {
|
||||
if (i == nullptr) {
|
||||
pulse_mixer_offline(pm);
|
||||
return;
|
||||
}
|
||||
@@ -92,14 +92,14 @@ pulse_mixer_update(PulseMixer *pm,
|
||||
{
|
||||
pa_operation *o;
|
||||
|
||||
assert(context != NULL);
|
||||
assert(stream != NULL);
|
||||
assert(context != nullptr);
|
||||
assert(stream != nullptr);
|
||||
assert(pa_stream_get_state(stream) == PA_STREAM_READY);
|
||||
|
||||
o = pa_context_get_sink_input_info(context,
|
||||
pa_stream_get_index(stream),
|
||||
pulse_mixer_volume_cb, pm);
|
||||
if (o == NULL) {
|
||||
if (o == nullptr) {
|
||||
FormatError(pulse_mixer_domain,
|
||||
"pa_context_get_sink_input_info() failed: %s",
|
||||
pa_strerror(pa_context_errno(context)));
|
||||
@@ -116,12 +116,12 @@ pulse_mixer_on_connect(gcc_unused PulseMixer *pm,
|
||||
{
|
||||
pa_operation *o;
|
||||
|
||||
assert(context != NULL);
|
||||
assert(context != nullptr);
|
||||
|
||||
o = pa_context_subscribe(context,
|
||||
(pa_subscription_mask_t)PA_SUBSCRIPTION_MASK_SINK_INPUT,
|
||||
NULL, NULL);
|
||||
if (o == NULL) {
|
||||
nullptr, nullptr);
|
||||
if (o == nullptr) {
|
||||
FormatError(pulse_mixer_domain,
|
||||
"pa_context_subscribe() failed: %s",
|
||||
pa_strerror(pa_context_errno(context)));
|
||||
@@ -150,7 +150,7 @@ pulse_mixer_init(void *ao, gcc_unused const config_param ¶m,
|
||||
{
|
||||
PulseOutput *po = (PulseOutput *)ao;
|
||||
|
||||
if (ao == NULL) {
|
||||
if (ao == nullptr) {
|
||||
error.Set(pulse_mixer_domain,
|
||||
"The pulse mixer cannot work without the audio output");
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user