diff options
-rw-r--r-- | .suppress.cppcheck | 1 | ||||
-rw-r--r-- | src/AtomForge.cpp | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/.suppress.cppcheck b/.suppress.cppcheck index 798a9c7c..4ba574b1 100644 --- a/.suppress.cppcheck +++ b/.suppress.cppcheck @@ -1,4 +1,3 @@ -arithOperationsOnVoidPointer constParameterPointer constParameterReference constVariablePointer 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 |