diff --git a/src/headers/macro-action-edit.hpp b/src/headers/macro-action-edit.hpp index 16046250..a606c47f 100644 --- a/src/headers/macro-action-edit.hpp +++ b/src/headers/macro-action-edit.hpp @@ -5,8 +5,8 @@ struct MacroActionInfo { using TCreateMethod = std::shared_ptr (*)(); using TCreateWidgetMethod = QWidget *(*)(QWidget *parent, std::shared_ptr); - TCreateMethod _createFunc; - TCreateWidgetMethod _createWidgetFunc; + TCreateMethod _createFunc = nullptr; + TCreateWidgetMethod _createWidgetFunc = nullptr; std::string _name; }; diff --git a/src/headers/macro-action-scene-transform.hpp b/src/headers/macro-action-scene-transform.hpp index 69db954b..77c544a5 100644 --- a/src/headers/macro-action-scene-transform.hpp +++ b/src/headers/macro-action-scene-transform.hpp @@ -21,8 +21,8 @@ public: SceneSelection _scene; OBSWeakSource _source; - struct obs_transform_info _info; - struct obs_sceneitem_crop _crop; + struct obs_transform_info _info = {}; + struct obs_sceneitem_crop _crop = {}; private: static bool _registered; diff --git a/src/headers/macro-condition-edit.hpp b/src/headers/macro-condition-edit.hpp index e1facf26..b7d5e43d 100644 --- a/src/headers/macro-condition-edit.hpp +++ b/src/headers/macro-condition-edit.hpp @@ -5,8 +5,8 @@ struct MacroConditionInfo { using TCreateMethod = std::shared_ptr (*)(); using TCreateWidgetMethod = QWidget *(*)(QWidget *parent, std::shared_ptr); - TCreateMethod _createFunc; - TCreateWidgetMethod _createWidgetFunc; + TCreateMethod _createFunc = nullptr; + TCreateWidgetMethod _createWidgetFunc = nullptr; std::string _name; bool _useDurationConstraint = true; }; diff --git a/src/headers/macro-condition-recording.hpp b/src/headers/macro-condition-recording.hpp index 70275e56..e25f2a07 100644 --- a/src/headers/macro-condition-recording.hpp +++ b/src/headers/macro-condition-recording.hpp @@ -20,7 +20,7 @@ public: return std::make_shared(); } - RecordState _recordState; + RecordState _recordState = RecordState::STOP; private: static bool _registered; diff --git a/src/headers/macro-condition-replay-buffer.hpp b/src/headers/macro-condition-replay-buffer.hpp index 1d0aa6ee..cc735ac3 100644 --- a/src/headers/macro-condition-replay-buffer.hpp +++ b/src/headers/macro-condition-replay-buffer.hpp @@ -22,7 +22,7 @@ public: return std::make_shared(); } - ReplayBufferState _state; + ReplayBufferState _state = ReplayBufferState::STOP; private: static bool _registered; diff --git a/src/headers/macro-condition-scene.hpp b/src/headers/macro-condition-scene.hpp index 8e823fca..8905f0a1 100644 --- a/src/headers/macro-condition-scene.hpp +++ b/src/headers/macro-condition-scene.hpp @@ -30,7 +30,7 @@ public: bool _waitForTransition = true; SceneSelection _scene; - SceneType _type; + SceneType _type = SceneType::CURRENT; private: std::chrono::high_resolution_clock::time_point _lastSceneChangeTime{}; diff --git a/src/headers/macro-condition-streaming.hpp b/src/headers/macro-condition-streaming.hpp index 39b8c9d8..899647db 100644 --- a/src/headers/macro-condition-streaming.hpp +++ b/src/headers/macro-condition-streaming.hpp @@ -21,7 +21,7 @@ public: return std::make_shared(); } - StreamState _streamState; + StreamState _streamState = StreamState::STOP; private: std::chrono::high_resolution_clock::time_point _lastStreamStartingTime{}; diff --git a/src/headers/macro-condition-virtual-cam.hpp b/src/headers/macro-condition-virtual-cam.hpp index 6544ab05..d440018e 100644 --- a/src/headers/macro-condition-virtual-cam.hpp +++ b/src/headers/macro-condition-virtual-cam.hpp @@ -21,7 +21,7 @@ public: return std::make_shared(); } - VCamState _state; + VCamState _state = VCamState::STOP; private: static bool _registered; diff --git a/src/headers/macro-segment.hpp b/src/headers/macro-segment.hpp index 8585d7b8..238b0e6d 100644 --- a/src/headers/macro-segment.hpp +++ b/src/headers/macro-segment.hpp @@ -14,7 +14,7 @@ public: virtual std::string GetId() = 0; protected: - int _idx; + int _idx = 0; bool _collapsed = false; }; diff --git a/src/headers/macro.hpp b/src/headers/macro.hpp index 4ac1d92d..45a49def 100644 --- a/src/headers/macro.hpp +++ b/src/headers/macro.hpp @@ -56,7 +56,7 @@ public: void SetDuration(double seconds); private: - LogicType _logic; + LogicType _logic = LogicType::ROOT_NONE; DurationConstraint _duration; }; diff --git a/src/headers/switch-audio.hpp b/src/headers/switch-audio.hpp index 681de806..1b6f2afa 100644 --- a/src/headers/switch-audio.hpp +++ b/src/headers/switch-audio.hpp @@ -44,7 +44,7 @@ struct AudioSwitch : virtual SceneSwitcherEntry { AudioSwitch(){}; AudioSwitch(const AudioSwitch &other); - AudioSwitch(AudioSwitch &&other); + AudioSwitch(AudioSwitch &&other) noexcept; ~AudioSwitch(); AudioSwitch &operator=(const AudioSwitch &other); AudioSwitch &operator=(AudioSwitch &&other) noexcept; diff --git a/src/headers/switch-media.hpp b/src/headers/switch-media.hpp index 9b4608fa..109050e1 100644 --- a/src/headers/switch-media.hpp +++ b/src/headers/switch-media.hpp @@ -52,7 +52,7 @@ struct MediaSwitch : SceneSwitcherEntry { inline MediaSwitch(){}; MediaSwitch(const MediaSwitch &other); - MediaSwitch(MediaSwitch &&other); + MediaSwitch(MediaSwitch &&other) noexcept; ~MediaSwitch(); MediaSwitch &operator=(const MediaSwitch &other); MediaSwitch &operator=(MediaSwitch &&other) noexcept; diff --git a/src/headers/switch-network.hpp b/src/headers/switch-network.hpp index 20d75552..45d5fa5b 100644 --- a/src/headers/switch-network.hpp +++ b/src/headers/switch-network.hpp @@ -70,8 +70,8 @@ private: QString getRemoteEndpoint(connection_hdl hdl); server _server; - quint16 _serverPort; - bool _lockToIPv4; + quint16 _serverPort = 55555; + bool _lockToIPv4 = false; std::set> _connections; QMutex _clMutex; QThreadPool _threadPool; diff --git a/src/headers/switcher-data-structs.hpp b/src/headers/switcher-data-structs.hpp index e5818905..c3437bd4 100644 --- a/src/headers/switcher-data-structs.hpp +++ b/src/headers/switcher-data-structs.hpp @@ -88,7 +88,7 @@ struct SwitcherData { std::chrono::high_resolution_clock::time_point lastStreamStartingTime{}; std::chrono::high_resolution_clock::time_point lastStreamStoppingTime{}; OBSWeakSource lastRandomScene; - SceneGroup *lastRandomSceneGroup; + SceneGroup *lastRandomSceneGroup = nullptr; OBSWeakSource nonMatchingScene; NoMatch switchIfNotMatching = NO_SWITCH; Duration noMatchDelay; diff --git a/src/switch-audio.cpp b/src/switch-audio.cpp index 0473346d..d2b03ad4 100644 --- a/src/switch-audio.cpp +++ b/src/switch-audio.cpp @@ -347,7 +347,7 @@ AudioSwitch::AudioSwitch(const AudioSwitch &other) volmeter = AddVolmeterToSource(this, other.audioSource); } -AudioSwitch::AudioSwitch(AudioSwitch &&other) +AudioSwitch::AudioSwitch(AudioSwitch &&other) noexcept : SceneSwitcherEntry(other.targetType, other.group, other.scene, other.transition, other.usePreviousScene), audioSource(other.audioSource), diff --git a/src/switch-media.cpp b/src/switch-media.cpp index 4849ec1b..206d8483 100644 --- a/src/switch-media.cpp +++ b/src/switch-media.cpp @@ -342,7 +342,7 @@ MediaSwitch::MediaSwitch(const MediaSwitch &other) obs_source_release(mediasource); } -MediaSwitch::MediaSwitch(MediaSwitch &&other) +MediaSwitch::MediaSwitch(MediaSwitch &&other) noexcept : SceneSwitcherEntry(other.targetType, other.group, other.scene, other.transition, other.usePreviousScene), source(other.source), diff --git a/src/utility.cpp b/src/utility.cpp index 9e4ee274..94a4cd8c 100644 --- a/src/utility.cpp +++ b/src/utility.cpp @@ -217,7 +217,7 @@ void deleteLayoutItem(QLayoutItem *item) void clearLayout(QLayout *layout, int afterIdx) { QLayoutItem *item; - while (item = layout->takeAt(afterIdx)) { + while ((item = layout->takeAt(afterIdx))) { if (item->layout()) { clearLayout(item->layout()); delete item->layout();