From 8c19e157e148efb59d6ea2f815783755b6075c7e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 18 Dec 2017 00:45:27 +0100 Subject: Rename Atom::get_body to Atom::body and use Atom::ptr consistently --- ingen/Atom.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ingen') 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 const T& get() const { assert(size() == sizeof(T)); - return *static_cast(get_body()); + return *static_cast(body()); } template const T* ptr() const { - return static_cast(get_body()); + return static_cast(body()); } const LV2_Atom* atom() const { -- cgit v1.2.1