diff options
Diffstat (limited to 'include/lv2')
| -rw-r--r-- | include/lv2/atom/forge.h | 2 | ||||
| -rw-r--r-- | include/lv2/atom/util.h | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/include/lv2/atom/forge.h b/include/lv2/atom/forge.h index b9dff85..58b7512 100644 --- a/include/lv2/atom/forge.h +++ b/include/lv2/atom/forge.h @@ -492,7 +492,7 @@ lv2_atom_forge_vector(LV2_Atom_Forge* forge, const void* elems) { const LV2_Atom_Vector a = { - {(uint32_t)sizeof(LV2_Atom_Vector_Body) + n_elems * child_size, + {(uint32_t)sizeof(LV2_Atom_Vector_Body) + (n_elems * child_size), forge->Vector}, {child_size, child_type}}; const LV2_Atom_Forge_Ref out = lv2_atom_forge_write(forge, &a, sizeof(a)); diff --git a/include/lv2/atom/util.h b/include/lv2/atom/util.h index 4b9e80d..32e8b6a 100644 --- a/include/lv2/atom/util.h +++ b/include/lv2/atom/util.h @@ -38,9 +38,7 @@ extern "C" { static inline uint32_t lv2_atom_pad_size(uint32_t size) { - static const uint32_t mask = 7U; - - return (size + mask) & ~mask; + return (size + 7U) & ~(7U); } /** Return the total size of `atom`, including the header. */ @@ -251,7 +249,7 @@ static inline LV2_Atom_Property_Body* lv2_atom_object_next(const LV2_Atom_Property_Body* i) { const LV2_Atom* const value = - (const LV2_Atom*)((const uint8_t*)i + 2 * sizeof(uint32_t)); + (const LV2_Atom*)((const uint8_t*)i + (2 * sizeof(uint32_t))); return (LV2_Atom_Property_Body*)((const uint8_t*)i + lv2_atom_pad_size( (uint32_t)sizeof(LV2_Atom_Property_Body) + |