Fix -Wdeprecated-copy

Summary:
    /home/vlad/Workspace/KDE/src/kde/workspace/kwin/scripting/scriptedeffect.cpp:408:57: warning: implicitly-declared ‘constexpr KWin::FPx2& KWin::FPx2::operator=(const KWin::FPx2&)’ is deprecated [-Wdeprecated-copy]
      408 |         fpx2 = FPx2(value1.toNumber(), value2.toNumber());
          |                                                         ^
    In file included from /home/vlad/Workspace/KDE/src/kde/workspace/kwin/scripting/scriptedeffect.h:24,
                     from /home/vlad/Workspace/KDE/src/kde/workspace/kwin/scripting/scriptedeffect.cpp:21:
    /home/vlad/Workspace/KDE/src/kde/workspace/kwin/libkwineffects/kwinanimationeffect.h:39:5: note: because ‘KWin::FPx2’ has user-provided ‘KWin::FPx2::FPx2(const KWin::FPx2&)’
       39 |     FPx2(const FPx2 &other) { f[0] = other.f[0]; f[1] = other.f[1]; valid = other.valid; }
          |     ^~~~

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22361
This commit is contained in:
Vlad Zagorodniy 2019-07-10 01:42:48 +03:00
parent cccb3456f3
commit 50c89d4858

View file

@ -53,7 +53,8 @@ public:
return ret; return ret;
} }
inline FPx2 &operator=(const FPx2 &other)
{ f[0] = other.f[0]; f[1] = other.f[1]; valid = other.valid; return *this; }
inline FPx2 &operator+=(const FPx2 &other) inline FPx2 &operator+=(const FPx2 &other)
{ f[0] += other[0]; f[1] += other[1]; return *this; } { f[0] += other[0]; f[1] += other[1]; return *this; }
inline FPx2 &operator-=(const FPx2 &other) inline FPx2 &operator-=(const FPx2 &other)