mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-03 09:48:32 +00:00
clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
This commit is contained in:
parent
f28116b7da
commit
d802d39281
292 changed files with 1526 additions and 1526 deletions
|
@ -47,7 +47,7 @@ void PulseAudio::SoundLoop()
|
|||
if (PulseInit())
|
||||
{
|
||||
while (m_run_thread.load() && m_pa_connected == 1 && m_pa_error >= 0)
|
||||
m_pa_error = pa_mainloop_iterate(m_pa_ml, 1, NULL);
|
||||
m_pa_error = pa_mainloop_iterate(m_pa_ml, 1, nullptr);
|
||||
|
||||
if(m_pa_error < 0)
|
||||
ERROR_LOG(AUDIO, "PulseAudio error: %s", pa_strerror(m_pa_error));
|
||||
|
@ -66,12 +66,12 @@ bool PulseAudio::PulseInit()
|
|||
m_pa_ml = pa_mainloop_new();
|
||||
m_pa_mlapi = pa_mainloop_get_api(m_pa_ml);
|
||||
m_pa_ctx = pa_context_new(m_pa_mlapi, "dolphin-emu");
|
||||
m_pa_error = pa_context_connect(m_pa_ctx, NULL, PA_CONTEXT_NOFLAGS, NULL);
|
||||
m_pa_error = pa_context_connect(m_pa_ctx, nullptr, PA_CONTEXT_NOFLAGS, nullptr);
|
||||
pa_context_set_state_callback(m_pa_ctx, StateCallback, this);
|
||||
|
||||
// wait until we're connected to the pulseaudio server
|
||||
while (m_pa_connected == 0 && m_pa_error >= 0)
|
||||
m_pa_error = pa_mainloop_iterate(m_pa_ml, 1, NULL);
|
||||
m_pa_error = pa_mainloop_iterate(m_pa_ml, 1, nullptr);
|
||||
|
||||
if (m_pa_connected == 2 || m_pa_error < 0)
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ bool PulseAudio::PulseInit()
|
|||
ss.format = PA_SAMPLE_S16LE;
|
||||
ss.channels = 2;
|
||||
ss.rate = m_mixer->GetSampleRate();
|
||||
m_pa_s = pa_stream_new(m_pa_ctx, "Playback", &ss, NULL);
|
||||
m_pa_s = pa_stream_new(m_pa_ctx, "Playback", &ss, nullptr);
|
||||
pa_stream_set_write_callback(m_pa_s, WriteCallback, this);
|
||||
pa_stream_set_underflow_callback(m_pa_s, UnderflowCallback, this);
|
||||
|
||||
|
@ -97,7 +97,7 @@ bool PulseAudio::PulseInit()
|
|||
m_pa_ba.prebuf = -1; // start as early as possible
|
||||
m_pa_ba.tlength = BUFFER_SIZE; // designed latency, only change this flag for low latency output
|
||||
pa_stream_flags flags = pa_stream_flags(PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_ADJUST_LATENCY | PA_STREAM_AUTO_TIMING_UPDATE);
|
||||
m_pa_error = pa_stream_connect_playback(m_pa_s, NULL, &m_pa_ba, flags, NULL, NULL);
|
||||
m_pa_error = pa_stream_connect_playback(m_pa_s, nullptr, &m_pa_ba, flags, nullptr, nullptr);
|
||||
if (m_pa_error < 0)
|
||||
{
|
||||
ERROR_LOG(AUDIO, "PulseAudio failed to initialize: %s", pa_strerror(m_pa_error));
|
||||
|
@ -135,7 +135,7 @@ void PulseAudio::StateCallback(pa_context* c)
|
|||
void PulseAudio::UnderflowCallback(pa_stream* s)
|
||||
{
|
||||
m_pa_ba.tlength += BUFFER_SIZE;
|
||||
pa_stream_set_buffer_attr(s, &m_pa_ba, NULL, NULL);
|
||||
pa_stream_set_buffer_attr(s, &m_pa_ba, nullptr, nullptr);
|
||||
|
||||
WARN_LOG(AUDIO, "pulseaudio underflow, new latency: %d bytes", m_pa_ba.tlength);
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ void PulseAudio::WriteCallback(pa_stream* s, size_t length)
|
|||
return; // error will be printed from main loop
|
||||
|
||||
m_mixer->Mix((s16*) buffer, length / sizeof(s16) / CHANNEL_COUNT);
|
||||
m_pa_error = pa_stream_write(s, buffer, length, NULL, 0, PA_SEEK_RELATIVE);
|
||||
m_pa_error = pa_stream_write(s, buffer, length, nullptr, 0, PA_SEEK_RELATIVE);
|
||||
}
|
||||
|
||||
// Callbacks that forward to internal methods (required because PulseAudio is a C API).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue