diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-11-17 20:02:14 +0100 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-11-19 19:46:54 +0100 |
commit | 4e1bebf0f5e06ecdd99c41771e7b4ee19c0cdcf3 (patch) | |
tree | d0e98cee9eef416282049092ea93b0b2b6eb417d /src/vinylcontrol | |
parent | 133ea1e3d6547964f014144eee15590ea449c7af (diff) |
Pass non-trivial/large function args by reference
Fixes a bunch of `-Wclazy-function-args-by-ref` warnings. See
https://github.com/KDE/clazy/blob/master/docs/checks/README-function-args-by-ref.md
for details.
Most of these changes are automated, using the clazy fixit by setting
the `CLAZY_EXPORT_FIXES` before compilation and then running:
$ mkdir /tmp/patch
$ find ../src -iname "*.yaml" -exec mv {} /tmp/patch \;
$ clang-apply-replacements /tmp/patch
Diffstat (limited to 'src/vinylcontrol')
-rw-r--r-- | src/vinylcontrol/vinylcontrol.cpp | 5 | ||||
-rw-r--r-- | src/vinylcontrol/vinylcontrol.h | 2 | ||||
-rw-r--r-- | src/vinylcontrol/vinylcontrolprocessor.cpp | 10 | ||||
-rw-r--r-- | src/vinylcontrol/vinylcontrolprocessor.h | 7 | ||||
-rw-r--r-- | src/vinylcontrol/vinylcontrolxwax.cpp | 2 | ||||
-rw-r--r-- | src/vinylcontrol/vinylcontrolxwax.h | 2 |
6 files changed, 14 insertions, 14 deletions
diff --git a/src/vinylcontrol/vinylcontrol.cpp b/src/vinylcontrol/vinylcontrol.cpp index bf8552e3cd..9f89c12281 100644 --- a/src/vinylcontrol/vinylcontrol.cpp +++ b/src/vinylcontrol/vinylcontrol.cpp @@ -2,11 +2,12 @@ #include "control/controlproxy.h" #include "control/controlobject.h" -VinylControl::VinylControl(UserSettingsPointer pConfig, QString group) +VinylControl::VinylControl(UserSettingsPointer pConfig, const QString& group) : m_pConfig(pConfig), m_group(group), m_iLeadInTime(m_pConfig->getValueString( - ConfigKey(group, "vinylcontrol_lead_in_time")).toInt()), + ConfigKey(group, "vinylcontrol_lead_in_time")) + .toInt()), m_dVinylPosition(0.0), m_fTimecodeQuality(0.0f) { // Get Control objects diff --git a/src/vinylcontrol/vinylcontrol.h b/src/vinylcontrol/vinylcontrol.h index 805cc8dbdf..cdc142fc0a 100644 --- a/src/vinylcontrol/vinylcontrol.h +++ b/src/vinylcontrol/vinylcontrol.h @@ -11,7 +11,7 @@ class ControlProxy; class VinylControl : public QObject { public: - VinylControl(UserSettingsPointer pConfig, QString group); + VinylControl(UserSettingsPointer pConfig, const QString& group); virtual ~VinylControl(); virtual void toggleVinylControl(bool enable); diff --git a/src/vinylcontrol/vinylcontrolprocessor.cpp b/src/vinylcontrol/vinylcontrolprocessor.cpp index 1fd8e6a202..a7b5379d28 100644 --- a/src/vinylcontrol/vinylcontrolprocessor.cpp +++ b/src/vinylcontrol/vinylcontrolprocessor.cpp @@ -153,7 +153,7 @@ void VinylControlProcessor::reloadConfig() { } } -void VinylControlProcessor::onInputConfigured(AudioInput input) { +void VinylControlProcessor::onInputConfigured(const AudioInput& input) { if (input.getType() != AudioInput::VINYLCONTROL) { qDebug() << "WARNING: AudioInput type is not VINYLCONTROL. Ignoring."; return; @@ -177,7 +177,7 @@ void VinylControlProcessor::onInputConfigured(AudioInput input) { delete pCurrent; } -void VinylControlProcessor::onInputUnconfigured(AudioInput input) { +void VinylControlProcessor::onInputUnconfigured(const AudioInput& input) { if (input.getType() != AudioInput::VINYLCONTROL) { qDebug() << "WARNING: AudioInput type is not VINYLCONTROL. Ignoring."; return; @@ -203,9 +203,9 @@ bool VinylControlProcessor::deckConfigured(int index) const { return m_processors[index] != NULL; } -void VinylControlProcessor::receiveBuffer(AudioInput input, - const CSAMPLE* pBuffer, - unsigned int nFrames) { +void VinylControlProcessor::receiveBuffer(const AudioInput& input, + const CSAMPLE* pBuffer, + unsigned int nFrames) { ScopedTimer t("VinylControlProcessor::receiveBuffer"); if (input.getType() != AudioInput::VINYLCONTROL) { qDebug() << "WARNING: AudioInput type is not VINYLCONTROL. Ignoring incoming buffer."; diff --git a/src/vinylcontrol/vinylcontrolprocessor.h b/src/vinylcontrol/vinylcontrolprocessor.h index 1ab825d829..0ea9d3fa92 100644 --- a/src/vinylcontrol/vinylcontrolprocessor.h +++ b/src/vinylcontrol/vinylcontrolprocessor.h @@ -41,8 +41,8 @@ class VinylControlProcessor : public QThread, public AudioDestination { } public slots: - virtual void onInputConfigured(AudioInput input); - virtual void onInputUnconfigured(AudioInput input); + virtual void onInputConfigured(const AudioInput& input); + virtual void onInputUnconfigured(const AudioInput& input); // Called by the engine callback. Must not touch any state in // VinylControlProcessor except for m_samplePipes. NOTE: @@ -53,8 +53,7 @@ class VinylControlProcessor : public QThread, public AudioDestination { // method is re-entrant since the VinylControlProcessor is registered for // multiple AudioDestinations, however it is not re-entrant for a given // AudioInput index. - void receiveBuffer(AudioInput input, const CSAMPLE* pBuffer, - unsigned int iNumFrames); + void receiveBuffer(const AudioInput& input, const CSAMPLE* pBuffer, unsigned int iNumFrames); protected: void run(); diff --git a/src/vinylcontrol/vinylcontrolxwax.cpp b/src/vinylcontrol/vinylcontrolxwax.cpp index c115fea263..f4f134eb39 100644 --- a/src/vinylcontrol/vinylcontrolxwax.cpp +++ b/src/vinylcontrol/vinylcontrolxwax.cpp @@ -48,7 +48,7 @@ const double kMinSignal = 75.0 / SAMPLE_MAX; bool VinylControlXwax::s_bLUTInitialized = false; QMutex VinylControlXwax::s_xwaxLUTMutex; -VinylControlXwax::VinylControlXwax(UserSettingsPointer pConfig, QString group) +VinylControlXwax::VinylControlXwax(UserSettingsPointer pConfig, const QString& group) : VinylControl(pConfig, group), m_dVinylPositionOld(0.0), m_pWorkBuffer(new short[MAX_BUFFER_LEN]), diff --git a/src/vinylcontrol/vinylcontrolxwax.h b/src/vinylcontrol/vinylcontrolxwax.h index f0b3be6907..45567003f1 100644 --- a/src/vinylcontrol/vinylcontrolxwax.h +++ b/src/vinylcontrol/vinylcontrolxwax.h @@ -22,7 +22,7 @@ extern "C" { class VinylControlXwax : public VinylControl { public: - VinylControlXwax(UserSettingsPointer pConfig, QString group); + VinylControlXwax(UserSettingsPointer pConfig, const QString& group); virtual ~VinylControlXwax(); static void freeLUTs(); |