diff options
author | David Robillard <d@drobilla.net> | 2017-12-18 00:45:27 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-01-12 18:20:04 +0100 |
commit | 8c19e157e148efb59d6ea2f815783755b6075c7e (patch) | |
tree | 094a95326138dd3a46cbd52b84981e36faebc64a /ingen | |
parent | 967a8b9d6690a5ece385d07af04c322d645de23f (diff) | |
download | ingen-8c19e157e148efb59d6ea2f815783755b6075c7e.tar.gz ingen-8c19e157e148efb59d6ea2f815783755b6075c7e.tar.bz2 ingen-8c19e157e148efb59d6ea2f815783755b6075c7e.zip |
Rename Atom::get_body to Atom::body and use Atom::ptr consistently
Diffstat (limited to 'ingen')
-rw-r--r-- | ingen/Atom.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ingen/Atom.hpp b/ingen/Atom.hpp index 86528ea1..a0e30805 100644 --- a/ingen/Atom.hpp +++ b/ingen/Atom.hpp @@ -59,7 +59,7 @@ public: memcpy(_body.ptr, &_atom, sizeof(LV2_Atom)); } if (body) { - memcpy(get_body(), body, size); + memcpy(this->body(), body, size); } } @@ -132,21 +132,21 @@ public: inline LV2_URID type() const { return _atom.type; } inline bool is_valid() const { return _atom.type; } - inline const void* get_body() const { + inline const void* body() const { return is_reference() ? (void*)(_body.ptr + 1) : &_body.val; } - inline void* get_body() { + inline void* body() { return is_reference() ? (void*)(_body.ptr + 1) : &_body.val; } template <typename T> const T& get() const { assert(size() == sizeof(T)); - return *static_cast<const T*>(get_body()); + return *static_cast<const T*>(body()); } template <typename T> const T* ptr() const { - return static_cast<const T*>(get_body()); + return static_cast<const T*>(body()); } const LV2_Atom* atom() const { |