summaryrefslogtreecommitdiffstats
path: root/ingen
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-01 18:59:18 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 01:48:48 +0200
commit7b70b455e6199b508217b021d9a0dfc08f9a7794 (patch)
treecb005e7cd9414cc3eb4b7c1baa52de69664dcd02 /ingen
parent848bb52824657c20b1d758aebcecefb5d8c37fb9 (diff)
downloadingen-7b70b455e6199b508217b021d9a0dfc08f9a7794.tar.gz
ingen-7b70b455e6199b508217b021d9a0dfc08f9a7794.tar.bz2
ingen-7b70b455e6199b508217b021d9a0dfc08f9a7794.zip
Use default member initialization
Diffstat (limited to 'ingen')
-rw-r--r--ingen/Atom.hpp11
-rw-r--r--ingen/Interface.hpp4
2 files changed, 7 insertions, 8 deletions
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<LV2_Atom*>(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