diff --git a/plugins/base/utils/hotkey-helpers.hpp b/plugins/base/utils/hotkey-helpers.hpp index cd55df21..eb645017 100644 --- a/plugins/base/utils/hotkey-helpers.hpp +++ b/plugins/base/utils/hotkey-helpers.hpp @@ -10,7 +10,7 @@ namespace advss { enum class HotkeyType; bool CanSimulateKeyPresses(); -void PressKeys(const std::vector keys, int duration); +void PressKeys(const std::vector &keys, int duration); class Hotkey { public: diff --git a/plugins/base/utils/linux/linux.cpp b/plugins/base/utils/linux/linux.cpp index 11648a90..1b68fb46 100644 --- a/plugins/base/utils/linux/linux.cpp +++ b/plugins/base/utils/linux/linux.cpp @@ -188,7 +188,7 @@ static const std::unordered_map keyTable = { {HotkeyType::Key_NumpadEnter, XK_KP_Enter}, }; -void PressKeys(const std::vector keys, int duration) +void PressKeys(const std::vector &keys, int duration) { if (!canSimulateKeyPresses) { return; diff --git a/plugins/base/utils/osx/osx.mm b/plugins/base/utils/osx/osx.mm index e5d46ad4..a0e73f35 100644 --- a/plugins/base/utils/osx/osx.mm +++ b/plugins/base/utils/osx/osx.mm @@ -9,7 +9,7 @@ bool CanSimulateKeyPresses() return canSimulateKeyPresses; } -void PressKeys(const std::vector keys, int duration) +void PressKeys(const std::vector &, int) { // Not supported on MacOS return; diff --git a/plugins/base/utils/windows/windows.cpp b/plugins/base/utils/windows/windows.cpp index 5f8cb514..99333d67 100644 --- a/plugins/base/utils/windows/windows.cpp +++ b/plugins/base/utils/windows/windows.cpp @@ -138,7 +138,7 @@ static const std::unordered_map keyTable = { {HotkeyType::Key_NumpadEnter, VK_RETURN}, }; -void PressKeys(const std::vector keys, int duration) +void PressKeys(const std::vector &keys, int duration) { const int repeatInterval = 100; diff --git a/plugins/scripting/macro-script-handler.cpp b/plugins/scripting/macro-script-handler.cpp index 1a4021c2..585ade5d 100644 --- a/plugins/scripting/macro-script-handler.cpp +++ b/plugins/scripting/macro-script-handler.cpp @@ -513,7 +513,7 @@ void ScriptHandler::SetVariableValue(void *, calldata_t *data) RETURN_SUCCESS(); } -void ScriptHandler::GetRunningStatus(void *ctx, calldata_t *data) +void ScriptHandler::GetRunningStatus(void *, calldata_t *data) { calldata_set_bool(data, "is_running", PluginIsRunning()); } diff --git a/plugins/twitch/channel-selection.cpp b/plugins/twitch/channel-selection.cpp index 745cbee5..236b4b53 100644 --- a/plugins/twitch/channel-selection.cpp +++ b/plugins/twitch/channel-selection.cpp @@ -58,14 +58,16 @@ std::string TwitchChannel::GetUserID(const TwitchToken &token) const } OBSDataArrayAutoRelease array = obs_data_get_array(res.data, "data"); size_t count = obs_data_array_count(array); - for (size_t i = 0; i < count; i++) { - OBSDataAutoRelease arrayObj = obs_data_array_item(array, i); - std::string id = obs_data_get_string(arrayObj, "id"); - userIDCache[_name] = id; - return id; + + if (count == 0) { + userIDCache[_name] = "invalid"; + return "invalid"; } - userIDCache[_name] = "invalid"; - return "invalid"; + + OBSDataAutoRelease arrayObj = obs_data_array_item(array, 0); + const std::string id = obs_data_get_string(arrayObj, "id"); + userIDCache[_name] = id; + return id; } static QDate parseRFC3339Date(const std::string &rfc3339Date) diff --git a/plugins/twitch/event-sub.cpp b/plugins/twitch/event-sub.cpp index f55d038e..65aa0240 100644 --- a/plugins/twitch/event-sub.cpp +++ b/plugins/twitch/event-sub.cpp @@ -448,7 +448,7 @@ void EventSub::StartServerMigrationClient(const std::string &url) auto client = std::make_unique(); SetupClient(*client); - client->set_open_handler([this](connection_hdl hdl) { + client->set_open_handler([this](connection_hdl) { vblog(LOG_INFO, "Twitch EventSub migration client opened"); }); diff --git a/plugins/twitch/token.cpp b/plugins/twitch/token.cpp index d0ba5fc6..3fcf4dfb 100644 --- a/plugins/twitch/token.cpp +++ b/plugins/twitch/token.cpp @@ -829,7 +829,7 @@ void TokenGrabberThread::run() if (_serverThread.joinable()) { _serverThread.join(); } - _stopWaiting = {false}; + _stopWaiting = false; // Generate URI to request token auto state = generateStateString();