From 3ed7727c8501aaf52e807b050f96d1f9a4d262c2 Mon Sep 17 00:00:00 2001 From: ubuntu Date: Sat, 26 Mar 2022 12:06:28 -0700 Subject: [PATCH] Fix warnings --- .vscode/settings.json | 8 ++++++++ .../opencv/area-selection.cpp | 8 ++++---- .../opencv/macro-condition-video.cpp | 18 +++++++++--------- .../opencv/preview-dialog.cpp | 2 +- src/macro-action-audio.cpp | 6 +++--- src/macro-action-edit.cpp | 4 ---- src/macro-condition-media.cpp | 2 +- src/macro-list-entry-widget.cpp | 6 +++--- src/macro-segment.cpp | 8 ++++---- src/macro-tab.cpp | 8 ++++---- src/macro.cpp | 2 +- 11 files changed, 38 insertions(+), 34 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..eebf2b70 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "files.associations": { + "new": "cpp", + "*.ipp": "cpp", + "*.inc": "cpp", + "string": "cpp" + } +} \ No newline at end of file diff --git a/src/external-macro-modules/opencv/area-selection.cpp b/src/external-macro-modules/opencv/area-selection.cpp index 4d3f512f..f5a6e0f4 100644 --- a/src/external-macro-modules/opencv/area-selection.cpp +++ b/src/external-macro-modules/opencv/area-selection.cpp @@ -48,7 +48,7 @@ void advss::Area::Load(obs_data_t *obj, const char *name) } SizeSelection::SizeSelection(int min, int max, QWidget *parent) - : _x(new QSpinBox), _y(new QSpinBox), QWidget(parent) + : QWidget(parent), _x(new QSpinBox), _y(new QSpinBox) { _x->setMinimum(min); _y->setMinimum(min); @@ -88,9 +88,9 @@ void SizeSelection::YChanged(int value) } AreaSelection::AreaSelection(int min, int max, QWidget *parent) - : _x(new SizeSelection(min, max)), - _y(new SizeSelection(min, max)), - QWidget(parent) + : QWidget(parent), + _x(new SizeSelection(min, max)), + _y(new SizeSelection(min, max)) { _x->_x->setToolTip("X"); _x->_y->setToolTip("Y"); diff --git a/src/external-macro-modules/opencv/macro-condition-video.cpp b/src/external-macro-modules/opencv/macro-condition-video.cpp index fa41fa1b..e470bfbd 100644 --- a/src/external-macro-modules/opencv/macro-condition-video.cpp +++ b/src/external-macro-modules/opencv/macro-condition-video.cpp @@ -283,9 +283,9 @@ MacroConditionVideoEdit::MacroConditionVideoEdit( : QWidget(parent), _videoSelection(new QComboBox()), _condition(new QComboBox()), - _imagePath(new FileSelection()), _usePatternForChangedCheck(new QCheckBox(obs_module_text( "AdvSceneSwitcher.condition.video.usePatternForChangedCheck"))), + _imagePath(new FileSelection()), _patternThreshold(new ThresholdSlider( 0., 1., obs_module_text( @@ -295,31 +295,31 @@ MacroConditionVideoEdit::MacroConditionVideoEdit( _useAlphaAsMask(new QCheckBox(obs_module_text( "AdvSceneSwitcher.condition.video.patternThresholdUseAlphaAsMask"))), _modelDataPath(new FileSelection()), + _modelPathLayout(new QHBoxLayout), _objectScaleThreshold(new ThresholdSlider( 1.1, 5., obs_module_text( "AdvSceneSwitcher.condition.video.objectScaleThreshold"), obs_module_text( "AdvSceneSwitcher.condition.video.objectScaleThresholdDescription"))), + _neighborsControlLayout(new QHBoxLayout), _minNeighbors(new QSpinBox()), _minNeighborsDescription(new QLabel(obs_module_text( "AdvSceneSwitcher.condition.video.minNeighborDescription"))), + _sizeLayout(new QHBoxLayout()), _minSize(new SizeSelection(0, 1024)), _maxSize(new SizeSelection(0, 4096)), + _checkAreaControlLayout(new QHBoxLayout), _checkAreaEnable(new QCheckBox()), _checkArea(new AreaSelection(0, 99999)), + _selectArea(new QPushButton(obs_module_text( + "AdvSceneSwitcher.condition.video.selectArea"))), + _throttleControlLayout(new QHBoxLayout), _throttleEnable(new QCheckBox()), _throttleCount(new QSpinBox()), _showMatch(new QPushButton(obs_module_text( "AdvSceneSwitcher.condition.video.showMatch"))), - _selectArea(new QPushButton(obs_module_text( - "AdvSceneSwitcher.condition.video.selectArea"))), - _previewDialog(this, entryData.get(), &GetSwitcher()->m), - _modelPathLayout(new QHBoxLayout), - _neighborsControlLayout(new QHBoxLayout), - _checkAreaControlLayout(new QHBoxLayout), - _throttleControlLayout(new QHBoxLayout), - _sizeLayout(new QHBoxLayout()) + _previewDialog(this, entryData.get(), &GetSwitcher()->m) { _imagePath->Button()->disconnect(); _usePatternForChangedCheck->setToolTip(obs_module_text( diff --git a/src/external-macro-modules/opencv/preview-dialog.cpp b/src/external-macro-modules/opencv/preview-dialog.cpp index bd913270..10278f87 100644 --- a/src/external-macro-modules/opencv/preview-dialog.cpp +++ b/src/external-macro-modules/opencv/preview-dialog.cpp @@ -10,8 +10,8 @@ PreviewDialog::PreviewDialog(QWidget *parent, std::mutex *mutex) : QDialog(parent), _conditionData(conditionData), - _imageLabel(new QLabel(this)), _scrollArea(new QScrollArea), + _imageLabel(new QLabel(this)), _rubberBand(new QRubberBand(QRubberBand::Rectangle, this)), _mtx(mutex) { diff --git a/src/macro-action-audio.cpp b/src/macro-action-audio.cpp index 16b7ec10..e134c078 100644 --- a/src/macro-action-audio.cpp +++ b/src/macro-action-audio.cpp @@ -273,15 +273,15 @@ MacroActionAudioEdit::MacroActionAudioEdit( : QWidget(parent), _audioSources(new QComboBox), _actions(new QComboBox), + _fadeTypes(new QComboBox), _volumePercent(new QSpinBox), _fade(new QCheckBox), + _duration(new DurationSelection(parent, false)), + _rate(new QDoubleSpinBox), _wait(new QCheckBox( obs_module_text("AdvSceneSwitcher.action.audio.fade.wait"))), _abortActiveFade(new QCheckBox( obs_module_text("AdvSceneSwitcher.action.audio.fade.abort"))), - _duration(new DurationSelection(parent, false)), - _rate(new QDoubleSpinBox), - _fadeTypes(new QComboBox), _fadeTypeLayout(new QHBoxLayout), _fadeOptionsLayout(new QVBoxLayout) { diff --git a/src/macro-action-edit.cpp b/src/macro-action-edit.cpp index adc9a6a5..74f96524 100644 --- a/src/macro-action-edit.cpp +++ b/src/macro-action-edit.cpp @@ -267,10 +267,6 @@ void AdvSceneSwitcher::SwapActions(Macro *m, int pos1, int pos2) std::lock_guard lock(switcher->m); iter_swap(m->Actions().begin() + pos1, m->Actions().begin() + pos2); m->UpdateActionIndices(); - - auto a1 = m->Actions().begin() + pos1; - auto a2 = m->Actions().begin() + pos2; - auto widget1 = static_cast( actionsList->ContentLayout()->takeAt(pos1)->widget()); auto widget2 = static_cast( diff --git a/src/macro-condition-media.cpp b/src/macro-condition-media.cpp index 449b052d..f96bf647 100644 --- a/src/macro-condition-media.cpp +++ b/src/macro-condition-media.cpp @@ -371,8 +371,8 @@ static void addAnyAndAllStates(QComboBox *list) MacroConditionMediaEdit::MacroConditionMediaEdit( QWidget *parent, std::shared_ptr entryData) : QWidget(parent), - _mediaSources(new QComboBox()), _scenes(new SceneSelectionWidget(window())), + _mediaSources(new QComboBox()), _states(new QComboBox()), _timeRestrictions(new QComboBox()), _time(new DurationSelection()), diff --git a/src/macro-list-entry-widget.cpp b/src/macro-list-entry-widget.cpp index 42375980..d955b453 100644 --- a/src/macro-list-entry-widget.cpp +++ b/src/macro-list-entry-widget.cpp @@ -5,10 +5,10 @@ MacroListEntryWidget::MacroListEntryWidget(std::shared_ptr macro, bool highlight, QWidget *parent) : QWidget(parent), - _highlightExecutedMacros(highlight), - _macro(macro), _name(new QLabel(QString::fromStdString(macro->Name()))), - _running(new QCheckBox) + _running(new QCheckBox), + _macro(macro), + _highlightExecutedMacros(highlight) { _running->setChecked(!macro->Paused()); diff --git a/src/macro-segment.cpp b/src/macro-segment.cpp index f46c793d..808a67f8 100644 --- a/src/macro-segment.cpp +++ b/src/macro-segment.cpp @@ -57,15 +57,15 @@ bool MouseWheelWidgetAdjustmentGuard::eventFilter(QObject *o, QEvent *e) MacroSegmentEdit::MacroSegmentEdit(bool highlight, QWidget *parent) : QWidget(parent), - _showHighlight(highlight), _section(new Section(300)), _headerInfo(new QLabel()), - _contentLayout(new QVBoxLayout), _frame(new QWidget), - _borderFrame(new QFrame), + _contentLayout(new QVBoxLayout), _noBorderframe(new QFrame), + _borderFrame(new QFrame), _dropLineAbove(new QFrame), - _dropLineBelow(new QFrame) + _dropLineBelow(new QFrame), + _showHighlight(highlight) { _dropLineAbove->setLineWidth(3); _dropLineAbove->setFixedHeight(11); diff --git a/src/macro-tab.cpp b/src/macro-tab.cpp index 57d0fe71..7835835d 100644 --- a/src/macro-tab.cpp +++ b/src/macro-tab.cpp @@ -617,8 +617,8 @@ void AdvSceneSwitcher::UpMacroSegementHotkey() if (!macro) { return; } - size_t actionSize = macro->Actions().size(); - size_t conditionSize = macro->Conditions().size(); + int actionSize = macro->Actions().size(); + int conditionSize = macro->Conditions().size(); if (currentActionIdx == -1 && currentConditionIdx == -1) { if (lastInteracted == MacroSection::CONDITIONS) { @@ -673,8 +673,8 @@ void AdvSceneSwitcher::DownMacroSegementHotkey() if (!macro) { return; } - size_t actionSize = macro->Actions().size(); - size_t conditionSize = macro->Conditions().size(); + int actionSize = macro->Actions().size(); + int conditionSize = macro->Conditions().size(); if (currentActionIdx == -1 && currentConditionIdx == -1) { if (lastInteracted == MacroSection::CONDITIONS) { diff --git a/src/macro.cpp b/src/macro.cpp index bb8c75f9..241499a9 100644 --- a/src/macro.cpp +++ b/src/macro.cpp @@ -201,7 +201,7 @@ void Macro::SetPaused(bool pause) void Macro::AddHelperThread(std::thread &&newThread) { - for (int i = 0; i < _helperThreads.size(); i++) { + for (unsigned int i = 0; i < _helperThreads.size(); i++) { if (!_helperThreads[i].joinable()) { _helperThreads[i] = std::move(newThread); return;