From 4b742dd461842db623c0d4edc04e4c29c45facf3 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Thu, 24 Feb 2022 16:01:40 +0100 Subject: [PATCH 1/5] explicit capture for lamda --- apps/opencs/view/world/tableheadermouseeventhandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/opencs/view/world/tableheadermouseeventhandler.cpp b/apps/opencs/view/world/tableheadermouseeventhandler.cpp index 866c6149db..a9d34ce7ab 100644 --- a/apps/opencs/view/world/tableheadermouseeventhandler.cpp +++ b/apps/opencs/view/world/tableheadermouseeventhandler.cpp @@ -14,7 +14,7 @@ TableHeaderMouseEventHandler::TableHeaderMouseEventHandler(DragRecordTable * par { header.setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu); connect( - &header, &QHeaderView::customContextMenuRequested, [=](const QPoint & position) { showContextMenu(position); }); + &header, &QHeaderView::customContextMenuRequested, [this](const QPoint & position) { showContextMenu(position); }); header.viewport()->installEventFilter(this); } @@ -52,7 +52,7 @@ QMenu & TableHeaderMouseEventHandler::createContextMenu() action->setChecked(!table.isColumnHidden(i)); menu->addAction(action); - connect(action, &QAction::triggered, [=]() { + connect(action, &QAction::triggered, [this, &action, &i]() { table.setColumnHidden(i, !action->isChecked()); action->setChecked(!action->isChecked()); action->toggle(); From ad11cc8d8a62991654e4c7865dfd75c6dd46acaf Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Fri, 25 Feb 2022 15:47:11 +0100 Subject: [PATCH 2/5] reinstall fontconfig as needed; const an imbigious == operator --- CI/before_install.osx.sh | 2 +- apps/openmw/mwrender/globalmap.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index ec4ece6343..b3463aa9b8 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -9,7 +9,7 @@ brew update --quiet [ -z "${TRAVIS}" ] && brew uninstall --ignore-dependencies qt@6 || true # Some of these tools can come from places other than brew, so check before installing -[ -z "${TRAVIS}" ] && brew install fontconfig +[ -z "${TRAVIS}" ] && brew reinstall fontconfig command -v ccache >/dev/null 2>&1 || brew install ccache command -v cmake >/dev/null 2>&1 || brew install cmake command -v qmake >/dev/null 2>&1 || brew install qt@5 diff --git a/apps/openmw/mwrender/globalmap.cpp b/apps/openmw/mwrender/globalmap.cpp index acd566ff18..dca26a220f 100644 --- a/apps/openmw/mwrender/globalmap.cpp +++ b/apps/openmw/mwrender/globalmap.cpp @@ -453,7 +453,7 @@ namespace MWRender : mLeft(left), mTop(top), mRight(right), mBottom(bottom) { } - bool operator == (const Box& other) + bool operator == (const Box& other) const { return mLeft == other.mLeft && mTop == other.mTop && mRight == other.mRight && mBottom == other.mBottom; } From 1927b1c6d9b0e60ff0ad202900155c0e2e3b35ae Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Fri, 25 Feb 2022 16:27:43 +0100 Subject: [PATCH 3/5] use static cast to handle: deprecated between enumerations of different types --- apps/openmw/mwlua/inputbindings.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwlua/inputbindings.cpp b/apps/openmw/mwlua/inputbindings.cpp index a8487557ba..1be6e086fa 100644 --- a/apps/openmw/mwlua/inputbindings.cpp +++ b/apps/openmw/mwlua/inputbindings.cpp @@ -40,7 +40,7 @@ namespace MWLua touchpadEvent["finger"] = sol::readonly_property( [](const SDLUtil::TouchEvent& e) -> int { return e.mFinger; }); touchpadEvent["position"] = sol::readonly_property( - [](const SDLUtil::TouchEvent& e) -> osg::Vec2f { return osg::Vec2f(e.mX, e.mY);}); + [](const SDLUtil::TouchEvent& e) -> osg::Vec2f { return {e.mX, e.mY};}); touchpadEvent["pressure"] = sol::readonly_property( [](const SDLUtil::TouchEvent& e) -> float { return e.mPressure; }); @@ -177,10 +177,10 @@ namespace MWLua {"TriggerLeft", SDL_CONTROLLER_AXIS_TRIGGERLEFT}, {"TriggerRight", SDL_CONTROLLER_AXIS_TRIGGERRIGHT}, - {"LookUpDown", SDL_CONTROLLER_AXIS_MAX + MWInput::A_LookUpDown}, - {"LookLeftRight", SDL_CONTROLLER_AXIS_MAX + MWInput::A_LookLeftRight}, - {"MoveForwardBackward", SDL_CONTROLLER_AXIS_MAX + MWInput::A_MoveForwardBackward}, - {"MoveLeftRight", SDL_CONTROLLER_AXIS_MAX + MWInput::A_MoveLeftRight} + {"LookUpDown", SDL_CONTROLLER_AXIS_MAX + static_cast(MWInput::A_LookUpDown)}, + {"LookLeftRight", SDL_CONTROLLER_AXIS_MAX + static_cast(MWInput::A_LookLeftRight)}, + {"MoveForwardBackward", SDL_CONTROLLER_AXIS_MAX + static_cast(MWInput::A_MoveForwardBackward)}, + {"MoveLeftRight", SDL_CONTROLLER_AXIS_MAX + static_cast(MWInput::A_MoveLeftRight)} })); api["KEY"] = LuaUtil::makeReadOnly(context.mLua->tableFromPairs({ From 6601274992fdb8671532fe97d420e171d8a536f0 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Fri, 25 Feb 2022 18:09:12 +0100 Subject: [PATCH 4/5] constify weakcache overloaded operators --- components/misc/weakcache.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/misc/weakcache.hpp b/components/misc/weakcache.hpp index 022a722dba..3bbb0812cd 100644 --- a/components/misc/weakcache.hpp +++ b/components/misc/weakcache.hpp @@ -22,8 +22,8 @@ namespace Misc public: iterator(WeakCache* cache, typename Map::iterator current, typename Map::iterator end); iterator& operator++(); - bool operator==(const iterator& other); - bool operator!=(const iterator& other); + bool operator==(const iterator& other) const; + bool operator!=(const iterator& other) const; StrongPtr operator*(); private: WeakCache* mCache; @@ -74,13 +74,13 @@ namespace Misc } template - bool WeakCache::iterator::operator==(const iterator& other) + bool WeakCache::iterator::operator==(const iterator& other) const { return mCurrent == other.mCurrent; } template - bool WeakCache::iterator::operator!=(const iterator& other) + bool WeakCache::iterator::operator!=(const iterator& other) const { return !(*this == other); } From 32fd6f297a0e7efbdbd246355398ab1b94280fcb Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Fri, 25 Feb 2022 21:53:45 +0100 Subject: [PATCH 5/5] static_cast bitwise operation between different enumeration types --- apps/opencs/view/widget/colorpickerpopup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/opencs/view/widget/colorpickerpopup.cpp b/apps/opencs/view/widget/colorpickerpopup.cpp index 206a667276..3d69523924 100644 --- a/apps/opencs/view/widget/colorpickerpopup.cpp +++ b/apps/opencs/view/widget/colorpickerpopup.cpp @@ -11,7 +11,7 @@ CSVWidget::ColorPickerPopup::ColorPickerPopup(QWidget *parent) : QFrame(parent) { setWindowFlags(Qt::Popup); - setFrameStyle(QFrame::Box | QFrame::Plain); + setFrameStyle(QFrame::Box | static_cast(QFrame::Plain)); hide(); mColorPicker = new QColorDialog(this);