aboutsummaryrefslogtreecommitdiffstats
path: root/include/lv2/atom/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lv2/atom/util.h')
-rw-r--r--include/lv2/atom/util.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/include/lv2/atom/util.h b/include/lv2/atom/util.h
index b1a1e93..9a3d8a3 100644
--- a/include/lv2/atom/util.h
+++ b/include/lv2/atom/util.h
@@ -1,4 +1,4 @@
-// Copyright 2008-2015 David Robillard <d@drobilla.net>
+// Copyright 2008-2024 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
#ifndef LV2_ATOM_UTIL_H
@@ -13,7 +13,7 @@
*/
/**
- @defgroup util Utilities
+ @defgroup atom_util Utilities
@ingroup atom
Utilities for working with atoms.
@@ -21,7 +21,7 @@
@{
*/
-#include "lv2/atom/atom.h"
+#include <lv2/atom/atom.h>
#include <stdarg.h>
#include <stdbool.h>
@@ -61,8 +61,7 @@ lv2_atom_is_null(const LV2_Atom* atom)
static inline bool
lv2_atom_equals(const LV2_Atom* a, const LV2_Atom* b)
{
- return (a == b) || ((a->type == b->type) && (a->size == b->size) &&
- !memcmp(a + 1, b + 1, a->size));
+ return (a == b) || !memcmp(a, b, sizeof(LV2_Atom) + a->size);
}
/**
@@ -182,7 +181,7 @@ lv2_atom_sequence_append_event(LV2_Atom_Sequence* seq,
static inline LV2_Atom*
lv2_atom_tuple_begin(const LV2_Atom_Tuple* tup)
{
- return (LV2_Atom*)(LV2_ATOM_BODY(tup));
+ return (LV2_Atom*)tup + 1U;
}
/** Return true iff `i` has reached the end of `body`. */
@@ -252,7 +251,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) +