diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-12-15 01:05:33 +0100 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-12-15 01:57:06 +0100 |
commit | 0471998e13aada9a76e92b13ab3885c2d1c2fb84 (patch) | |
tree | 776d15ab92ef044956940bc2228b61256ca4feb9 /src/soundio | |
parent | 63b858b5d827797eec959d009ad0b970de167dc5 (diff) |
Add missing braces around single-line statements
Diffstat (limited to 'src/soundio')
-rw-r--r-- | src/soundio/sounddevicenetwork.cpp | 8 | ||||
-rw-r--r-- | src/soundio/soundmanager.cpp | 12 | ||||
-rw-r--r-- | src/soundio/soundmanagerconfig.cpp | 28 |
3 files changed, 36 insertions, 12 deletions
diff --git a/src/soundio/sounddevicenetwork.cpp b/src/soundio/sounddevicenetwork.cpp index 461e506644..0a916bcdaa 100644 --- a/src/soundio/sounddevicenetwork.cpp +++ b/src/soundio/sounddevicenetwork.cpp @@ -130,7 +130,9 @@ QString SoundDeviceNetwork::getError() const { } void SoundDeviceNetwork::readProcess() { - if (!m_inputFifo || !m_pNetworkStream || !m_iNumInputChannels) return; + if (!m_inputFifo || !m_pNetworkStream || !m_iNumInputChannels) { + return; + } int inChunkSize = m_framesPerBuffer * m_iNumInputChannels; int readAvailable = m_pNetworkStream->getReadExpected() @@ -222,7 +224,9 @@ void SoundDeviceNetwork::readProcess() { } void SoundDeviceNetwork::writeProcess() { - if (!m_outputFifo || !m_pNetworkStream) return; + if (!m_outputFifo || !m_pNetworkStream) { + return; + } int outChunkSize = m_framesPerBuffer * m_iNumOutputChannels; int writeAvailable = m_outputFifo->writeAvailable(); diff --git a/src/soundio/soundmanager.cpp b/src/soundio/soundmanager.cpp index 65993a9383..0b5d330f43 100644 --- a/src/soundio/soundmanager.cpp +++ b/src/soundio/soundmanager.cpp @@ -417,7 +417,9 @@ SoundDeviceError SoundManager::setupDevices() { AudioOutputBuffer aob(out, pBuffer); err = pDevice->addOutput(aob); - if (err != SOUNDDEVICE_ERROR_OK) goto closeAndError; + if (err != SOUNDDEVICE_ERROR_OK) { + goto closeAndError; + } if (!m_config.getForceNetworkClock()) { if (out.getType() == AudioOutput::MASTER) { @@ -465,7 +467,9 @@ SoundDeviceError SoundManager::setupDevices() { syncBuffers = 2; } err = pDevice->open(pNewMasterClockRef == pDevice, syncBuffers); - if (err != SOUNDDEVICE_ERROR_OK) goto closeAndError; + if (err != SOUNDDEVICE_ERROR_OK) { + goto closeAndError; + } devicesNotFound.remove(pDevice->getDeviceId()); if (mode.isOutput) { ++outputDevicesOpened; @@ -659,7 +663,9 @@ void SoundManager::setJACKName() const { // need to make sure it will last forever so we intentionally leak // this string. char* jackNameCopy = strdup(Version::applicationName().toLocal8Bit().constData()); - if (!func(jackNameCopy)) qDebug() << "JACK client name set"; + if (!func(jackNameCopy)) { + qDebug() << "JACK client name set"; + } } else { qWarning() << "failed to resolve JACK name method"; } diff --git a/src/soundio/soundmanagerconfig.cpp b/src/soundio/soundmanagerconfig.cpp index 1b7e7e0229..e4b67eafe3 100644 --- a/src/soundio/soundmanagerconfig.cpp +++ b/src/soundio/soundmanagerconfig.cpp @@ -96,7 +96,9 @@ bool SoundManagerConfig::readFromDisk() { for (int i = 0; i < devElements.count(); ++i) { QDomElement devElement(devElements.at(i).toElement()); - if (devElement.isNull()) continue; + if (devElement.isNull()) { + continue; + } SoundDeviceId deviceIdFromFile; deviceIdFromFile.name = devElement.attribute(xmlAttributeDeviceName); if (deviceIdFromFile.name.isEmpty()) { @@ -163,9 +165,13 @@ bool SoundManagerConfig::readFromDisk() { QDomNodeList inElements(devElement.elementsByTagName(xmlElementInput)); for (int j = 0; j < outElements.count(); ++j) { QDomElement outElement(outElements.at(j).toElement()); - if (outElement.isNull()) continue; + if (outElement.isNull()) { + continue; + } AudioOutput out(AudioOutput::fromXML(outElement)); - if (out.getType() == AudioPath::INVALID) continue; + if (out.getType() == AudioPath::INVALID) { + continue; + } bool dupe(false); for (const AudioOutput& otherOut : qAsConst(m_outputs)) { if (out == otherOut @@ -174,15 +180,21 @@ bool SoundManagerConfig::readFromDisk() { break; } } - if (dupe) continue; + if (dupe) { + continue; + } addOutput(deviceIdFromFile, out); } for (int j = 0; j < inElements.count(); ++j) { QDomElement inElement(inElements.at(j).toElement()); - if (inElement.isNull()) continue; + if (inElement.isNull()) { + continue; + } AudioInput in(AudioInput::fromXML(inElement)); - if (in.getType() == AudioPath::INVALID) continue; + if (in.getType() == AudioPath::INVALID) { + continue; + } bool dupe(false); for (const AudioInput& otherIn : qAsConst(m_inputs)) { if (in == otherIn @@ -191,7 +203,9 @@ bool SoundManagerConfig::readFromDisk() { break; } } - if (dupe) continue; + if (dupe) { + continue; + } addInput(deviceIdFromFile, in); } } |