aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-12-15 21:30:09 +0000
committerDavid Robillard <d@drobilla.net>2013-12-15 21:30:09 +0000
commit964c152c9d93f75dc790bcb200d6a117c7c08651 (patch)
tree994ff96558541db7056215bf3c2d1a45f61641f2
parentba015861ba1fdde7dfee02404ab095e7293eba56 (diff)
downloadlv2-964c152c9d93f75dc790bcb200d6a117c7c08651.tar.xz
Fix casting away of const (patch from Robin Gareus).
-rw-r--r--lv2/lv2plug.in/ns/ext/atom/util.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/lv2/lv2plug.in/ns/ext/atom/util.h b/lv2/lv2plug.in/ns/ext/atom/util.h
index d247ad8..79e3cd8 100644
--- a/lv2/lv2plug.in/ns/ext/atom/util.h
+++ b/lv2/lv2plug.in/ns/ext/atom/util.h
@@ -92,14 +92,14 @@ lv2_atom_sequence_is_end(const LV2_Atom_Sequence_Body* body,
uint32_t size,
LV2_Atom_Event* i)
{
- return (uint8_t*)i >= ((uint8_t*)body + size);
+ return (uint8_t*)i >= ((const uint8_t*)body + size);
}
/** Return an iterator to the element following @p i. */
static inline LV2_Atom_Event*
lv2_atom_sequence_next(const LV2_Atom_Event* i)
{
- return (LV2_Atom_Event*)((uint8_t*)i
+ return (LV2_Atom_Event*)((const uint8_t*)i
+ sizeof(LV2_Atom_Event)
+ lv2_atom_pad_size(i->body.size));
}
@@ -144,7 +144,7 @@ lv2_atom_tuple_begin(const LV2_Atom_Tuple* tup)
static inline bool
lv2_atom_tuple_is_end(const void* body, uint32_t size, LV2_Atom* i)
{
- return (uint8_t*)i >= ((uint8_t*)body + size);
+ return (uint8_t*)i >= ((const uint8_t*)body + size);
}
/** Return an iterator to the element following @p i. */
@@ -197,7 +197,7 @@ lv2_atom_object_is_end(const LV2_Atom_Object_Body* body,
uint32_t size,
LV2_Atom_Property_Body* i)
{
- return (uint8_t*)i >= ((uint8_t*)body + size);
+ return (uint8_t*)i >= ((const uint8_t*)body + size);
}
/** Return an iterator to the property following @p i. */
@@ -207,7 +207,7 @@ lv2_atom_object_next(const LV2_Atom_Property_Body* i)
const LV2_Atom* const value = (LV2_Atom*)(
(uint8_t*)i + 2 * sizeof(uint32_t));
return (LV2_Atom_Property_Body*)(
- (uint8_t*)i + lv2_atom_pad_size(sizeof(LV2_Atom_Property_Body)
+ (const uint8_t*)i + lv2_atom_pad_size(sizeof(LV2_Atom_Property_Body)
+ value->size));
}