From 5ff861c380e2af4f45456748f9aac88e2dbb52a3 Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 29 Oct 2023 17:28:32 +0100 Subject: [PATCH] fix some deprecations --- vstgui/lib/cdrawdefs.h | 4 ++-- vstgui/lib/controls/cbuttons.h | 4 ++-- vstgui/lib/cresourcedescription.h | 3 ++- vstgui/lib/events.h | 2 ++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/vstgui/lib/cdrawdefs.h b/vstgui/lib/cdrawdefs.h index c6f9fc738..4bdb11b9e 100644 --- a/vstgui/lib/cdrawdefs.h +++ b/vstgui/lib/cdrawdefs.h @@ -28,8 +28,8 @@ struct CDrawMode { public: constexpr CDrawMode (uint32_t mode = kAliasing) : mode (mode) {} - constexpr CDrawMode (const CDrawMode& m) : mode (m.mode) {} - + constexpr CDrawMode (const CDrawMode& m) = default; + constexpr CDrawMode& operator= (const CDrawMode& m) = default; constexpr uint32_t modeIgnoringIntegralMode () const { return (mode & ~kNonIntegralMode); } constexpr bool integralMode () const { return !hasBit (mode, kNonIntegralMode); } diff --git a/vstgui/lib/controls/cbuttons.h b/vstgui/lib/controls/cbuttons.h index 393b3e777..867e81b75 100644 --- a/vstgui/lib/controls/cbuttons.h +++ b/vstgui/lib/controls/cbuttons.h @@ -249,8 +249,8 @@ class CTextButton : public CControl CMouseEventResult onMouseMoved (CPoint& where, const CButtonState& buttons) override; CMouseEventResult onMouseCancel () override; void onKeyboardEvent (KeyboardEvent& event) override; - - CLASS_METHODS(CTextButton, CControl) + + CLASS_METHODS_NOCOPY (CTextButton, CControl) protected: ~CTextButton () noexcept override = default; diff --git a/vstgui/lib/cresourcedescription.h b/vstgui/lib/cresourcedescription.h index bfb55f528..88ba16ad1 100644 --- a/vstgui/lib/cresourcedescription.h +++ b/vstgui/lib/cresourcedescription.h @@ -20,9 +20,10 @@ class CResourceDescription CResourceDescription () = default; CResourceDescription (UTF8StringPtr name) : type (kStringType) { u.name = name; } explicit CResourceDescription (int32_t id) : type (kIntegerType) { u.id = id; } + CResourceDescription (const CResourceDescription&) = default; CResourceDescription& operator= (int32_t id) { u.id = id; type = kIntegerType; return *this; } - CResourceDescription& operator= (const CResourceDescription& desc) { type = desc.type; u.id = desc.u.id; u.name = desc.u.name; return *this; } + CResourceDescription& operator= (const CResourceDescription& desc) = default; int32_t type {kUnknownType}; union { diff --git a/vstgui/lib/events.h b/vstgui/lib/events.h index 69ef4d39f..8fb020133 100644 --- a/vstgui/lib/events.h +++ b/vstgui/lib/events.h @@ -96,6 +96,7 @@ struct Modifiers Modifiers () = default; Modifiers (const Modifiers&) = default; explicit Modifiers (ModifierKey modifier) : data (cast (modifier)) {} + Modifiers& operator= (const Modifiers&) = default; /** test if no modifier key is set */ [[nodiscard]] bool empty () const { return data == 0; } @@ -202,6 +203,7 @@ struct MouseEventButtonState MouseEventButtonState () = default; MouseEventButtonState (const MouseEventButtonState&) = default; MouseEventButtonState (MouseButton pos) { set (pos); } + MouseEventButtonState& operator= (const MouseEventButtonState&) = default; [[nodiscard]] bool operator== (const MouseEventButtonState& other) const {