From ce5730428c33c57d431bf7c59047d8e249e6a47e Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Mon, 3 Jan 2022 21:59:08 +0100 Subject: [PATCH] Remove unnecessary uses of UNUSED_PARAMETER macro --- src/general.cpp | 4 +--- src/hotkey.cpp | 22 ++++------------------ src/macro-action-audio.cpp | 1 + src/macro-action-macro.cpp | 3 +-- src/macro-condition-audio.cpp | 9 +++------ src/macro-condition-hotkey.cpp | 6 +----- src/macro-condition-macro.cpp | 3 +-- src/switch-audio.cpp | 7 ++----- src/switch-network.cpp | 13 ++++--------- 9 files changed, 18 insertions(+), 50 deletions(-) diff --git a/src/general.cpp b/src/general.cpp index 4e5be840..ba535e27 100644 --- a/src/general.cpp +++ b/src/general.cpp @@ -453,10 +453,8 @@ void AdvSceneSwitcher::on_tabMoved(int from, int to) std::swap(switcher->tabOrder[from], switcher->tabOrder[to]); } -void AdvSceneSwitcher::on_tabWidget_currentChanged(int index) +void AdvSceneSwitcher::on_tabWidget_currentChanged(int) { - UNUSED_PARAMETER(index); - switcher->showFrame = false; clearFrames(ui->screenRegionSwitches); SetShowFrames(); diff --git a/src/hotkey.cpp b/src/hotkey.cpp index 9ad554fd..d7156256 100644 --- a/src/hotkey.cpp +++ b/src/hotkey.cpp @@ -4,13 +4,8 @@ #include #include -void startHotkeyFunc(void *data, obs_hotkey_id id, obs_hotkey_t *hotkey, - bool pressed) +void startHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *, bool pressed) { - UNUSED_PARAMETER(id); - UNUSED_PARAMETER(data); - UNUSED_PARAMETER(hotkey); - if (pressed) { if (!(switcher->th && switcher->th->isRunning())) { switcher->Start(); @@ -18,13 +13,8 @@ void startHotkeyFunc(void *data, obs_hotkey_id id, obs_hotkey_t *hotkey, } } -void stopHotkeyFunc(void *data, obs_hotkey_id id, obs_hotkey_t *hotkey, - bool pressed) +void stopHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *, bool pressed) { - UNUSED_PARAMETER(id); - UNUSED_PARAMETER(data); - UNUSED_PARAMETER(hotkey); - if (pressed) { if (switcher->th && switcher->th->isRunning()) { switcher->Stop(); @@ -32,13 +22,9 @@ void stopHotkeyFunc(void *data, obs_hotkey_id id, obs_hotkey_t *hotkey, } } -void startStopToggleHotkeyFunc(void *data, obs_hotkey_id id, - obs_hotkey_t *hotkey, bool pressed) +void startStopToggleHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *, + bool pressed) { - UNUSED_PARAMETER(id); - UNUSED_PARAMETER(data); - UNUSED_PARAMETER(hotkey); - if (pressed) { if (switcher->th && switcher->th->isRunning()) { switcher->Stop(); diff --git a/src/macro-action-audio.cpp b/src/macro-action-audio.cpp index 473a6208..83778aae 100644 --- a/src/macro-action-audio.cpp +++ b/src/macro-action-audio.cpp @@ -259,6 +259,7 @@ void MacroActionAudioEdit::SetWidgetVisibility() setLayoutVisible(_fadeLayout, hasVolumeControl(_entryData->_action)); adjustSize(); } + void MacroActionAudioEdit::UpdateEntryData() { if (!_entryData) { diff --git a/src/macro-action-macro.cpp b/src/macro-action-macro.cpp index 5b5d7ea7..799d23a1 100644 --- a/src/macro-action-macro.cpp +++ b/src/macro-action-macro.cpp @@ -161,9 +161,8 @@ void MacroActionMacroEdit::ActionChanged(int value) _entryData->_action = static_cast(value); } -void MacroActionMacroEdit::MacroRemove(const QString &name) +void MacroActionMacroEdit::MacroRemove(const QString &) { - UNUSED_PARAMETER(name); if (_entryData) { _entryData->_macro.UpdateRef(); } diff --git a/src/macro-condition-audio.cpp b/src/macro-condition-audio.cpp index fdcb6016..f1df7c1c 100644 --- a/src/macro-condition-audio.cpp +++ b/src/macro-condition-audio.cpp @@ -101,13 +101,10 @@ std::string MacroConditionAudio::GetShortDesc() return ""; } -void MacroConditionAudio::SetVolumeLevel( - void *data, const float magnitude[MAX_AUDIO_CHANNELS], - const float peak[MAX_AUDIO_CHANNELS], - const float inputPeak[MAX_AUDIO_CHANNELS]) +void MacroConditionAudio::SetVolumeLevel(void *data, const float *, + const float peak[MAX_AUDIO_CHANNELS], + const float *) { - UNUSED_PARAMETER(magnitude); - UNUSED_PARAMETER(inputPeak); MacroConditionAudio *c = static_cast(data); for (int i = 0; i < MAX_AUDIO_CHANNELS; i++) { diff --git a/src/macro-condition-hotkey.cpp b/src/macro-condition-hotkey.cpp index bca33973..92a82e36 100644 --- a/src/macro-condition-hotkey.cpp +++ b/src/macro-condition-hotkey.cpp @@ -10,12 +10,8 @@ bool MacroConditionHotkey::_registered = MacroConditionFactory::Register( {MacroConditionHotkey::Create, MacroConditionHotkeyEdit::Create, "AdvSceneSwitcher.condition.hotkey", false}); -static void hotkeyCB(void *data, obs_hotkey_id id, obs_hotkey_t *hotkey, - bool pressed) +static void hotkeyCB(void *data, obs_hotkey_id, obs_hotkey_t *, bool pressed) { - UNUSED_PARAMETER(id); - UNUSED_PARAMETER(data); - UNUSED_PARAMETER(hotkey); if (pressed) { auto c = static_cast(data); c->SetPressed(); diff --git a/src/macro-condition-macro.cpp b/src/macro-condition-macro.cpp index cd86be38..a671ff17 100644 --- a/src/macro-condition-macro.cpp +++ b/src/macro-condition-macro.cpp @@ -282,9 +282,8 @@ void MacroConditionMacroEdit::ConditionChanged(int cond) _entryData->_counterCondition = static_cast(cond); } -void MacroConditionMacroEdit::MacroRemove(const QString &name) +void MacroConditionMacroEdit::MacroRemove(const QString &) { - UNUSED_PARAMETER(name); if (_entryData) { _entryData->_macro.UpdateRef(); } diff --git a/src/switch-audio.cpp b/src/switch-audio.cpp index d2b03ad4..bbb2a55a 100644 --- a/src/switch-audio.cpp +++ b/src/switch-audio.cpp @@ -238,13 +238,10 @@ void AdvSceneSwitcher::setupAudioTab() ui->audioFallback->setChecked(switcher->audioFallback.enable); } -void AudioSwitch::setVolumeLevel(void *data, - const float magnitude[MAX_AUDIO_CHANNELS], +void AudioSwitch::setVolumeLevel(void *data, const float *, const float peak[MAX_AUDIO_CHANNELS], - const float inputPeak[MAX_AUDIO_CHANNELS]) + const float *) { - UNUSED_PARAMETER(magnitude); - UNUSED_PARAMETER(inputPeak); AudioSwitch *s = static_cast(data); for (int i = 0; i < MAX_AUDIO_CHANNELS; i++) { diff --git a/src/switch-network.cpp b/src/switch-network.cpp index 232cb7ee..197c7d0d 100644 --- a/src/switch-network.cpp +++ b/src/switch-network.cpp @@ -313,10 +313,8 @@ std::string processMessage(std::string payload) return ret; } -void WSServer::onMessage(connection_hdl hdl, server::message_ptr message) +void WSServer::onMessage(connection_hdl, server::message_ptr message) { - UNUSED_PARAMETER(hdl); - auto opcode = message->get_opcode(); if (opcode != websocketpp::frame::opcode::text) { return; @@ -449,16 +447,14 @@ void WSClient::disconnect() } } -void WSClient::onOpen(connection_hdl hdl) +void WSClient::onOpen(connection_hdl) { - UNUSED_PARAMETER(hdl); blog(LOG_INFO, "connection to %s opened", _uri.c_str()); switcher->clientStatus = ClientStatus::CONNECTED; } -void WSClient::onFail(connection_hdl hdl) +void WSClient::onFail(connection_hdl) { - UNUSED_PARAMETER(hdl); blog(LOG_INFO, "connection to %s failed", _uri.c_str()); } @@ -486,9 +482,8 @@ void WSClient::onMessage(connection_hdl hdl, client::message_ptr message) } } -void WSClient::onClose(connection_hdl hdl) +void WSClient::onClose(connection_hdl) { - UNUSED_PARAMETER(hdl); blog(LOG_INFO, "client-connection to %s closed.", _uri.c_str()); switcher->clientStatus = ClientStatus::DISCONNECTED; }