diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/AtomForge.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/AtomForge.cpp b/src/AtomForge.cpp index ed54142a..6a62a609 100644 --- a/src/AtomForge.cpp +++ b/src/AtomForge.cpp @@ -103,11 +103,12 @@ AtomForge::deref(const intptr_t ref) /* Make some assumptions and do unnecessary math to appease -Wcast-align. This is questionable at best, though the forge should only dereference references to aligned atoms. */ + LV2_Atom* const ptr = _buf.get(); assert((ref - 1) % sizeof(LV2_Atom) == 0); - return static_cast<LV2_Atom*>(_buf.get() + (ref - 1) / sizeof(LV2_Atom)); + return static_cast<LV2_Atom*>(ptr + (ref - 1) / sizeof(LV2_Atom)); // Alternatively: - // return (LV2_Atom*)((uint8_t*)_buf + ref - 1); + // return (LV2_Atom*)((uint8_t*)_buf.get() + ref - 1); } LV2_Atom_Forge_Ref |