diff options
Diffstat (limited to 'include/lv2/atom/atom.h')
-rw-r--r-- | include/lv2/atom/atom.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/include/lv2/atom/atom.h b/include/lv2/atom/atom.h index a6178cf..41af21a 100644 --- a/include/lv2/atom/atom.h +++ b/include/lv2/atom/atom.h @@ -1,8 +1,8 @@ // Copyright 2008-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_ATOM_H -#define LV2_ATOM_H +#ifndef LV2_ATOM_ATOM_H +#define LV2_ATOM_ATOM_H /** @defgroup atom Atom @@ -62,25 +62,19 @@ extern "C" { #endif -/** @cond */ -/** This expression will fail to compile if double does not fit in 64 bits. */ -typedef char lv2_atom_assert_double_fits_in_64_bits - [((sizeof(double) <= sizeof(uint64_t)) * 2) - 1]; -/** @endcond */ - /** Return a pointer to the contents of an Atom. The "contents" of an atom is the data past the complete type-specific header. @param type The type of the atom, for example LV2_Atom_String. @param atom A variable-sized atom. */ -#define LV2_ATOM_CONTENTS(type, atom) ((void*)((uint8_t*)(atom) + sizeof(type))) +#define LV2_ATOM_CONTENTS(type, atom) ((void*)((type*)(atom) + 1U)) /** Const version of LV2_ATOM_CONTENTS. */ #define LV2_ATOM_CONTENTS_CONST(type, atom) \ - ((const void*)((const uint8_t*)(atom) + sizeof(type))) + ((const void*)((const type*)(atom) + 1U)) /** Return a pointer to the body of an Atom. The "body" of an atom is the @@ -221,7 +215,7 @@ typedef struct { | Event 1 (size 6) | Event 2 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - |FRAMES |TYPE |SIZE |DATADATADATAPAD|FRAMES |... + |FRAMES |SIZE |TYPE |DATADATADATAPAD|FRAMES |... </pre> */ typedef struct { @@ -244,4 +238,4 @@ typedef struct { @} */ -#endif /* LV2_ATOM_H */ +#endif // LV2_ATOM_ATOM_H |