[LV2] [PATCH 4/5] atom-API change: constant iterators

Robin Gareus robin at gareus.org
Mon Dec 9 11:41:14 PST 2013


Signed-off-by: Robin Gareus <robin at gareus.org>
---
 lv2/lv2plug.in/ns/ext/atom/util.h |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lv2/lv2plug.in/ns/ext/atom/util.h b/lv2/lv2plug.in/ns/ext/atom/util.h
index 79e3cd8..a9b3826 100644
--- a/lv2/lv2plug.in/ns/ext/atom/util.h
+++ b/lv2/lv2plug.in/ns/ext/atom/util.h
@@ -80,10 +80,10 @@ lv2_atom_sequence_begin(const LV2_Atom_Sequence_Body* body)
 }
 
 /** Get an iterator pointing to the end of a Sequence body. */
-static inline LV2_Atom_Event*
+static inline const LV2_Atom_Event*
 lv2_atom_sequence_end(const LV2_Atom_Sequence_Body* body, uint32_t size)
 {
-	return (LV2_Atom_Event*)((uint8_t*)body + lv2_atom_pad_size(size));
+	return (LV2_Atom_Event*)((const uint8_t*)body + lv2_atom_pad_size(size));
 }
 
 /** Return true iff @p i has reached the end of @p body. */
@@ -134,10 +134,10 @@ lv2_atom_sequence_next(const LV2_Atom_Event* i)
 */
 
 /** Get an iterator pointing to the first element in @p tup. */
-static inline LV2_Atom*
+static inline const LV2_Atom*
 lv2_atom_tuple_begin(const LV2_Atom_Tuple* tup)
 {
-	return (LV2_Atom*)(LV2_ATOM_BODY(tup));
+	return (const LV2_Atom*)(LV2_ATOM_BODY(tup));
 }
 
 /** Return true iff @p i has reached the end of @p body. */
@@ -148,11 +148,11 @@ lv2_atom_tuple_is_end(const void* body, uint32_t size, LV2_Atom* i)
 }
 
 /** Return an iterator to the element following @p i. */
-static inline LV2_Atom*
+static inline const LV2_Atom*
 lv2_atom_tuple_next(const LV2_Atom* i)
 {
 	return (LV2_Atom*)(
-		(uint8_t*)i + sizeof(LV2_Atom) + lv2_atom_pad_size(i->size));
+		(const uint8_t*)i + sizeof(LV2_Atom) + lv2_atom_pad_size(i->size));
 }
 
 /**
-- 
1.7.10.4




More information about the Devel mailing list