Merge branch 'CPP20_support' into 'master'

Support C++20

See merge request OpenMW/openmw!1705
ccache_for_windows
psi29a 3 years ago
commit 3afa46b25e

@ -9,7 +9,7 @@ brew update --quiet
[ -z "${TRAVIS}" ] && brew uninstall --ignore-dependencies qt@6 || true [ -z "${TRAVIS}" ] && brew uninstall --ignore-dependencies qt@6 || true
# Some of these tools can come from places other than brew, so check before installing # 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 ccache >/dev/null 2>&1 || brew install ccache
command -v cmake >/dev/null 2>&1 || brew install cmake command -v cmake >/dev/null 2>&1 || brew install cmake
command -v qmake >/dev/null 2>&1 || brew install qt@5 command -v qmake >/dev/null 2>&1 || brew install qt@5

@ -11,7 +11,7 @@ CSVWidget::ColorPickerPopup::ColorPickerPopup(QWidget *parent)
: QFrame(parent) : QFrame(parent)
{ {
setWindowFlags(Qt::Popup); setWindowFlags(Qt::Popup);
setFrameStyle(QFrame::Box | QFrame::Plain); setFrameStyle(QFrame::Box | static_cast<int>(QFrame::Plain));
hide(); hide();
mColorPicker = new QColorDialog(this); mColorPicker = new QColorDialog(this);

@ -14,7 +14,7 @@ TableHeaderMouseEventHandler::TableHeaderMouseEventHandler(DragRecordTable * par
{ {
header.setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu); header.setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
connect( connect(
&header, &QHeaderView::customContextMenuRequested, [=](const QPoint & position) { showContextMenu(position); }); &header, &QHeaderView::customContextMenuRequested, [this](const QPoint & position) { showContextMenu(position); });
header.viewport()->installEventFilter(this); header.viewport()->installEventFilter(this);
} }
@ -52,7 +52,7 @@ QMenu & TableHeaderMouseEventHandler::createContextMenu()
action->setChecked(!table.isColumnHidden(i)); action->setChecked(!table.isColumnHidden(i));
menu->addAction(action); menu->addAction(action);
connect(action, &QAction::triggered, [=]() { connect(action, &QAction::triggered, [this, &action, &i]() {
table.setColumnHidden(i, !action->isChecked()); table.setColumnHidden(i, !action->isChecked());
action->setChecked(!action->isChecked()); action->setChecked(!action->isChecked());
action->toggle(); action->toggle();

@ -40,7 +40,7 @@ namespace MWLua
touchpadEvent["finger"] = sol::readonly_property( touchpadEvent["finger"] = sol::readonly_property(
[](const SDLUtil::TouchEvent& e) -> int { return e.mFinger; }); [](const SDLUtil::TouchEvent& e) -> int { return e.mFinger; });
touchpadEvent["position"] = sol::readonly_property( 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( touchpadEvent["pressure"] = sol::readonly_property(
[](const SDLUtil::TouchEvent& e) -> float { return e.mPressure; }); [](const SDLUtil::TouchEvent& e) -> float { return e.mPressure; });
@ -177,10 +177,10 @@ namespace MWLua
{"TriggerLeft", SDL_CONTROLLER_AXIS_TRIGGERLEFT}, {"TriggerLeft", SDL_CONTROLLER_AXIS_TRIGGERLEFT},
{"TriggerRight", SDL_CONTROLLER_AXIS_TRIGGERRIGHT}, {"TriggerRight", SDL_CONTROLLER_AXIS_TRIGGERRIGHT},
{"LookUpDown", SDL_CONTROLLER_AXIS_MAX + MWInput::A_LookUpDown}, {"LookUpDown", SDL_CONTROLLER_AXIS_MAX + static_cast<int>(MWInput::A_LookUpDown)},
{"LookLeftRight", SDL_CONTROLLER_AXIS_MAX + MWInput::A_LookLeftRight}, {"LookLeftRight", SDL_CONTROLLER_AXIS_MAX + static_cast<int>(MWInput::A_LookLeftRight)},
{"MoveForwardBackward", SDL_CONTROLLER_AXIS_MAX + MWInput::A_MoveForwardBackward}, {"MoveForwardBackward", SDL_CONTROLLER_AXIS_MAX + static_cast<int>(MWInput::A_MoveForwardBackward)},
{"MoveLeftRight", SDL_CONTROLLER_AXIS_MAX + MWInput::A_MoveLeftRight} {"MoveLeftRight", SDL_CONTROLLER_AXIS_MAX + static_cast<int>(MWInput::A_MoveLeftRight)}
})); }));
api["KEY"] = LuaUtil::makeReadOnly(context.mLua->tableFromPairs<std::string_view, SDL_Scancode>({ api["KEY"] = LuaUtil::makeReadOnly(context.mLua->tableFromPairs<std::string_view, SDL_Scancode>({

@ -453,7 +453,7 @@ namespace MWRender
: mLeft(left), mTop(top), mRight(right), mBottom(bottom) : 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; return mLeft == other.mLeft && mTop == other.mTop && mRight == other.mRight && mBottom == other.mBottom;
} }

@ -22,8 +22,8 @@ namespace Misc
public: public:
iterator(WeakCache* cache, typename Map::iterator current, typename Map::iterator end); iterator(WeakCache* cache, typename Map::iterator current, typename Map::iterator end);
iterator& operator++(); iterator& operator++();
bool operator==(const iterator& other); bool operator==(const iterator& other) const;
bool operator!=(const iterator& other); bool operator!=(const iterator& other) const;
StrongPtr operator*(); StrongPtr operator*();
private: private:
WeakCache* mCache; WeakCache* mCache;
@ -74,13 +74,13 @@ namespace Misc
} }
template <typename Key, typename T> template <typename Key, typename T>
bool WeakCache<Key, T>::iterator::operator==(const iterator& other) bool WeakCache<Key, T>::iterator::operator==(const iterator& other) const
{ {
return mCurrent == other.mCurrent; return mCurrent == other.mCurrent;
} }
template <typename Key, typename T> template <typename Key, typename T>
bool WeakCache<Key, T>::iterator::operator!=(const iterator& other) bool WeakCache<Key, T>::iterator::operator!=(const iterator& other) const
{ {
return !(*this == other); return !(*this == other);
} }

Loading…
Cancel
Save