diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.h b/modules/juce_audio_processors/processors/juce_AudioProcessor.h index ce911f656c..8d035df467 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.h @@ -1587,19 +1587,17 @@ private: //============================================================================== struct InOutChannelPair { - int16 inChannels = 0, outChannels = 0; + InOutChannelPair() = default; - InOutChannelPair() noexcept {} - InOutChannelPair (const InOutChannelPair& o) noexcept : inChannels (o.inChannels), outChannels (o.outChannels) {} InOutChannelPair (int16 inCh, int16 outCh) noexcept : inChannels (inCh), outChannels (outCh) {} InOutChannelPair (const int16 (&config)[2]) noexcept : inChannels (config[0]), outChannels (config[1]) {} - InOutChannelPair& operator= (const InOutChannelPair& o) noexcept { inChannels = o.inChannels; outChannels = o.outChannels; return *this; } - bool operator== (const InOutChannelPair& other) const noexcept { return other.inChannels == inChannels && other.outChannels == outChannels; } + + int16 inChannels = 0, outChannels = 0; }; template diff --git a/modules/juce_core/maths/juce_Range.h b/modules/juce_core/maths/juce_Range.h index f534a53aff..4fe3d671bc 100644 --- a/modules/juce_core/maths/juce_Range.h +++ b/modules/juce_core/maths/juce_Range.h @@ -41,9 +41,7 @@ class Range public: //============================================================================== /** Constructs an empty range. */ - Range() noexcept : start(), end() - { - } + Range() = default; /** Constructs a range with given start and end values. */ Range (const ValueType startValue, const ValueType endValue) noexcept @@ -52,18 +50,10 @@ public: } /** Constructs a copy of another range. */ - Range (const Range& other) noexcept - : start (other.start), end (other.end) - { - } + Range (const Range&) = default; /** Copies another range object. */ - Range& operator= (Range other) noexcept - { - start = other.start; - end = other.end; - return *this; - } + Range& operator= (const Range&) = default; /** Returns the range that lies between two positions (in either order). */ static Range between (const ValueType position1, const ValueType position2) noexcept @@ -301,7 +291,7 @@ public: private: //============================================================================== - ValueType start, end; + ValueType start{}, end{}; }; } // namespace juce diff --git a/modules/juce_graphics/colour/juce_Colour.cpp b/modules/juce_graphics/colour/juce_Colour.cpp index a4a8630465..c9634ec9c0 100644 --- a/modules/juce_graphics/colour/juce_Colour.cpp +++ b/modules/juce_graphics/colour/juce_Colour.cpp @@ -140,22 +140,6 @@ namespace ColourHelpers } //============================================================================== -Colour::Colour() noexcept - : argb (0, 0, 0, 0) -{ -} - -Colour::Colour (const Colour& other) noexcept - : argb (other.argb) -{ -} - -Colour& Colour::operator= (const Colour& other) noexcept -{ - argb = other.argb; - return *this; -} - bool Colour::operator== (const Colour& other) const noexcept { return argb.getNativeARGB() == other.argb.getNativeARGB(); } bool Colour::operator!= (const Colour& other) const noexcept { return argb.getNativeARGB() != other.argb.getNativeARGB(); } @@ -227,11 +211,6 @@ Colour::Colour (PixelAlpha alpha) noexcept { } -Colour::~Colour() noexcept -{ -} - - //============================================================================== const PixelARGB Colour::getPixelARGB() const noexcept { diff --git a/modules/juce_graphics/colour/juce_Colour.h b/modules/juce_graphics/colour/juce_Colour.h index 570c8df248..31ab62b6c1 100644 --- a/modules/juce_graphics/colour/juce_Colour.h +++ b/modules/juce_graphics/colour/juce_Colour.h @@ -40,10 +40,10 @@ class JUCE_API Colour final public: //============================================================================== /** Creates a transparent black colour. */ - Colour() noexcept; + Colour() = default; /** Creates a copy of another Colour object. */ - Colour (const Colour& other) noexcept; + Colour (const Colour&) = default; /** Creates a colour from a 32-bit ARGB value. @@ -143,10 +143,10 @@ public: float alpha) noexcept; /** Destructor. */ - ~Colour() noexcept; + ~Colour() = default; /** Copies another Colour object. */ - Colour& operator= (const Colour& other) noexcept; + Colour& operator= (const Colour&) = default; /** Compares two colours. */ bool operator== (const Colour& other) const noexcept; @@ -363,7 +363,7 @@ public: private: //============================================================================== - PixelARGB argb; + PixelARGB argb { 0, 0, 0, 0 }; }; } // namespace juce diff --git a/modules/juce_graphics/colour/juce_PixelFormats.h b/modules/juce_graphics/colour/juce_PixelFormats.h index 4b1ba87da1..69a66e4c9c 100644 --- a/modules/juce_graphics/colour/juce_PixelFormats.h +++ b/modules/juce_graphics/colour/juce_PixelFormats.h @@ -60,8 +60,8 @@ class JUCE_API PixelARGB { public: /** Creates a pixel without defining its colour. */ - PixelARGB() noexcept {} - ~PixelARGB() noexcept {} + PixelARGB() = default; + ~PixelARGB() = default; PixelARGB (const uint8 a, const uint8 r, const uint8 g, const uint8 b) noexcept { @@ -367,8 +367,8 @@ class JUCE_API PixelRGB { public: /** Creates a pixel without defining its colour. */ - PixelRGB() noexcept {} - ~PixelRGB() noexcept {} + PixelRGB() = default; + ~PixelRGB() = default; //============================================================================== /** Returns a uint32 which represents the pixel in a platform dependent format which is compatible @@ -618,8 +618,8 @@ class JUCE_API PixelAlpha { public: /** Creates a pixel without defining its colour. */ - PixelAlpha() noexcept {} - ~PixelAlpha() noexcept {} + PixelAlpha() = default; + ~PixelAlpha() = default; //============================================================================== /** Returns a uint32 which represents the pixel in a platform dependent format which is compatible diff --git a/modules/juce_graphics/geometry/juce_Point.h b/modules/juce_graphics/geometry/juce_Point.h index 15bef89a71..3bf9c26606 100644 --- a/modules/juce_graphics/geometry/juce_Point.h +++ b/modules/juce_graphics/geometry/juce_Point.h @@ -43,17 +43,17 @@ class Point { public: /** Creates a point at the origin */ - JUCE_CONSTEXPR Point() noexcept : x(), y() {} + JUCE_CONSTEXPR Point() = default; /** Creates a copy of another point. */ - JUCE_CONSTEXPR Point (const Point& other) noexcept : x (other.x), y (other.y) {} + JUCE_CONSTEXPR Point (const Point&) = default; /** Creates a point from an (x, y) position. */ JUCE_CONSTEXPR Point (ValueType initialX, ValueType initialY) noexcept : x (initialX), y (initialY) {} //============================================================================== /** Copies this point from another one. */ - Point& operator= (const Point& other) noexcept { x = other.x; y = other.y; return *this; } + Point& operator= (const Point&) = default; JUCE_CONSTEXPR inline bool operator== (Point other) const noexcept { return x == other.x && y == other.y; } JUCE_CONSTEXPR inline bool operator!= (Point other) const noexcept { return x != other.x || y != other.y; } @@ -234,8 +234,8 @@ public: String toString() const { return String (x) + ", " + String (y); } //============================================================================== - ValueType x; /**< The point's X coordinate. */ - ValueType y; /**< The point's Y coordinate. */ + ValueType x{}; /**< The point's X coordinate. */ + ValueType y{}; /**< The point's Y coordinate. */ }; /** Multiplies the point's coordinates by a scalar value. */ diff --git a/modules/juce_graphics/geometry/juce_Rectangle.h b/modules/juce_graphics/geometry/juce_Rectangle.h index ba581757b6..df2a88f420 100644 --- a/modules/juce_graphics/geometry/juce_Rectangle.h +++ b/modules/juce_graphics/geometry/juce_Rectangle.h @@ -43,16 +43,10 @@ public: /** Creates a rectangle of zero size. The default coordinates will be (0, 0, 0, 0). */ - Rectangle() noexcept - : w(), h() - { - } + Rectangle() = default; /** Creates a copy of another rectangle. */ - Rectangle (const Rectangle& other) noexcept - : pos (other.pos), w (other.w), h (other.h) - { - } + Rectangle (const Rectangle&) = default; /** Creates a rectangle with a given position and size. */ Rectangle (ValueType initialX, ValueType initialY, @@ -89,15 +83,11 @@ public: return { left, top, right - left, bottom - top }; } - Rectangle& operator= (const Rectangle& other) noexcept - { - pos = other.pos; - w = other.w; h = other.h; - return *this; - } + /** Creates a copy of another rectangle. */ + Rectangle& operator= (const Rectangle&) = default; /** Destructor. */ - ~Rectangle() noexcept {} + ~Rectangle() = default; //============================================================================== /** Returns true if the rectangle's width or height are zero or less */ @@ -974,7 +964,7 @@ private: template friend class Rectangle; Point pos; - ValueType w, h; + ValueType w{}, h{}; static ValueType parseIntAfterSpace (StringRef s) noexcept { return static_cast (s.text.findEndOfWhitespace().getIntValue32()); } diff --git a/modules/juce_graphics/native/juce_RenderingHelpers.h b/modules/juce_graphics/native/juce_RenderingHelpers.h index 109c3348b7..2878cdd2dd 100644 --- a/modules/juce_graphics/native/juce_RenderingHelpers.h +++ b/modules/juce_graphics/native/juce_RenderingHelpers.h @@ -693,7 +693,7 @@ namespace EdgeTableFillers { if (areRGBComponentsEqual) // if all the component values are the same, we can cheat.. { - memset (dest, colour.getRed(), (size_t) width * 3); + memset ((void*) dest, colour.getRed(), (size_t) width * 3); } else { @@ -735,7 +735,7 @@ namespace EdgeTableFillers forcedinline void replaceLine (PixelAlpha* dest, const PixelARGB colour, int width) const noexcept { if ((size_t) destData.pixelStride == sizeof (*dest)) - memset (dest, colour.getAlpha(), (size_t) width); + memset ((void*) dest, colour.getAlpha(), (size_t) width); else JUCE_PERFORM_PIXEL_OP_LOOP (setAlpha (colour.getAlpha())) } @@ -965,7 +965,7 @@ namespace EdgeTableFillers && srcData.pixelFormat == Image::RGB && destData.pixelFormat == Image::RGB) { - memcpy (dest, src, (size_t) (width * srcStride)); + memcpy ((void*) dest, src, (size_t) (width * srcStride)); } else { diff --git a/modules/juce_gui_basics/keyboard/juce_KeyPress.cpp b/modules/juce_gui_basics/keyboard/juce_KeyPress.cpp index af1c4da752..ae1707d83a 100644 --- a/modules/juce_gui_basics/keyboard/juce_KeyPress.cpp +++ b/modules/juce_gui_basics/keyboard/juce_KeyPress.cpp @@ -27,10 +27,6 @@ namespace juce { -KeyPress::KeyPress() noexcept -{ -} - KeyPress::KeyPress (int code, ModifierKeys m, juce_wchar textChar) noexcept : keyCode (code), mods (m), textCharacter (textChar) { @@ -40,19 +36,6 @@ KeyPress::KeyPress (const int code) noexcept : keyCode (code) { } -KeyPress::KeyPress (const KeyPress& other) noexcept - : keyCode (other.keyCode), mods (other.mods), textCharacter (other.textCharacter) -{ -} - -KeyPress& KeyPress::operator= (const KeyPress& other) noexcept -{ - keyCode = other.keyCode; - mods = other.mods; - textCharacter = other.textCharacter; - return *this; -} - bool KeyPress::operator== (int otherKeyCode) const noexcept { return keyCode == otherKeyCode && ! mods.isAnyModifierKeyDown(); diff --git a/modules/juce_gui_basics/keyboard/juce_KeyPress.h b/modules/juce_gui_basics/keyboard/juce_KeyPress.h index 81df0af7de..387c8d8358 100644 --- a/modules/juce_gui_basics/keyboard/juce_KeyPress.h +++ b/modules/juce_gui_basics/keyboard/juce_KeyPress.h @@ -45,7 +45,10 @@ public: @see isValid */ - KeyPress() noexcept; + KeyPress() = default; + + /** Destructor. */ + ~KeyPress() = default; /** Creates a KeyPress for a key and some modifiers. @@ -74,10 +77,10 @@ public: explicit KeyPress (int keyCode) noexcept; /** Creates a copy of another KeyPress. */ - KeyPress (const KeyPress& other) noexcept; + KeyPress (const KeyPress&) = default; /** Copies this KeyPress from another one. */ - KeyPress& operator= (const KeyPress& other) noexcept; + KeyPress& operator= (const KeyPress&) = default; /** Compares two KeyPress objects. */ bool operator== (const KeyPress& other) const noexcept; diff --git a/modules/juce_gui_basics/keyboard/juce_ModifierKeys.cpp b/modules/juce_gui_basics/keyboard/juce_ModifierKeys.cpp index ec6f5d9a81..4af3471c3b 100644 --- a/modules/juce_gui_basics/keyboard/juce_ModifierKeys.cpp +++ b/modules/juce_gui_basics/keyboard/juce_ModifierKeys.cpp @@ -29,15 +29,7 @@ namespace juce ModifierKeys ModifierKeys::currentModifiers; -ModifierKeys::ModifierKeys() noexcept : flags (0) {} ModifierKeys::ModifierKeys (int rawFlags) noexcept : flags (rawFlags) {} -ModifierKeys::ModifierKeys (const ModifierKeys& other) noexcept : flags (other.flags) {} - -ModifierKeys& ModifierKeys::operator= (const ModifierKeys other) noexcept -{ - flags = other.flags; - return *this; -} int ModifierKeys::getNumMouseButtonsDown() const noexcept { diff --git a/modules/juce_gui_basics/keyboard/juce_ModifierKeys.h b/modules/juce_gui_basics/keyboard/juce_ModifierKeys.h index 4c75078ba2..ed0fff22cc 100644 --- a/modules/juce_gui_basics/keyboard/juce_ModifierKeys.h +++ b/modules/juce_gui_basics/keyboard/juce_ModifierKeys.h @@ -43,7 +43,7 @@ class JUCE_API ModifierKeys public: //============================================================================== /** Creates a ModifierKeys object with no flags set. */ - ModifierKeys() noexcept; + ModifierKeys() = default; /** Creates a ModifierKeys object from a raw set of flags. @@ -54,10 +54,10 @@ public: ModifierKeys (int flags) noexcept; /** Creates a copy of another object. */ - ModifierKeys (const ModifierKeys& other) noexcept; + ModifierKeys (const ModifierKeys&) = default; /** Copies this object from another one. */ - ModifierKeys& operator= (const ModifierKeys other) noexcept; + ModifierKeys& operator= (const ModifierKeys&) = default; //============================================================================== /** Checks whether the 'command' key flag is set (or 'ctrl' on Windows/Linux). @@ -206,7 +206,7 @@ public: static ModifierKeys getCurrentModifiersRealtime() noexcept; private: - int flags; + int flags = 0; }; } // namespace juce diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp index c00ca1b18a..dbd9c3677b 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp @@ -1152,8 +1152,6 @@ void LookAndFeel_V4::drawConcertinaPanelHeader (Graphics& g, const Rectangle (area.getY()), Colours::darkgrey.withAlpha (0.1f), static_cast (area.getBottom()))); g.fillPath (p);