From 7b70b455e6199b508217b021d9a0dfc08f9a7794 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 1 Aug 2020 18:59:18 +0200 Subject: Use default member initialization --- ingen/Atom.hpp | 11 +++++------ ingen/Interface.hpp | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'ingen') diff --git a/ingen/Atom.hpp b/ingen/Atom.hpp index e92ab194..3fb8f091 100644 --- a/ingen/Atom.hpp +++ b/ingen/Atom.hpp @@ -43,7 +43,7 @@ namespace ingen { */ class INGEN_API Atom { public: - Atom() noexcept : _atom{0, 0}, _body{} {} + Atom() noexcept = default; ~Atom() { dealloc(); } @@ -53,7 +53,6 @@ public: */ Atom(uint32_t size, LV2_URID type, const void* body) : _atom{size, type} - , _body{} { if (is_reference()) { _body.ptr = static_cast(malloc(sizeof(LV2_Atom) + size)); @@ -66,7 +65,6 @@ public: Atom(const Atom& copy) : _atom{copy._atom} - , _body{} { if (is_reference()) { _body.ptr = @@ -172,11 +170,12 @@ private: return _atom.size > sizeof(_body.val); } - LV2_Atom _atom; - union { + LV2_Atom _atom = {0, 0}; + union + { intptr_t val; LV2_Atom* ptr; - } _body; + } _body = {}; }; } // namespace ingen diff --git a/ingen/Interface.hpp b/ingen/Interface.hpp index 10d7d4bf..33180364 100644 --- a/ingen/Interface.hpp +++ b/ingen/Interface.hpp @@ -49,7 +49,7 @@ class INGEN_API Interface public: using result_type = void; - Interface() : _seq(0) {} + Interface() {} virtual ~Interface() = default; @@ -141,7 +141,7 @@ public: /** @} */ private: - int32_t _seq; + int32_t _seq = 0; }; } // namespace ingen -- cgit v1.2.1