diff --git a/source/includes/lv2/atom-util.h b/source/includes/lv2/atom-util.h index c32127782..28b919a5c 100644 --- a/source/includes/lv2/atom-util.h +++ b/source/includes/lv2/atom-util.h @@ -1,5 +1,5 @@ /* - Copyright 2008-2012 David Robillard + Copyright 2008-2013 David Robillard Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -143,7 +143,7 @@ lv2_atom_tuple_begin(const LV2_Atom_Tuple* tup) /** Return true iff @p i has reached the end of @p body. */ static inline bool -lv2_atom_tuple_is_end(const void* body, uint32_t size, LV2_Atom* i) +lv2_atom_tuple_is_end(const void* body, uint32_t size, const LV2_Atom* i) { return (const uint8_t*)i >= ((const uint8_t*)body + size); } @@ -169,13 +169,13 @@ lv2_atom_tuple_next(const LV2_Atom* i) @endcode */ #define LV2_ATOM_TUPLE_FOREACH(tuple, iter) \ - for (LV2_Atom* (iter) = lv2_atom_tuple_begin(tuple); \ - !lv2_atom_tuple_is_end(LV2_ATOM_BODY(tuple), (tuple)->size, (iter)); \ + for (const LV2_Atom* (iter) = lv2_atom_tuple_begin(tuple); \ + !lv2_atom_tuple_is_end(LV2_ATOM_BODY_CONST(tuple), (tuple)->size, (iter)); \ (iter) = lv2_atom_tuple_next(iter)) /** Like LV2_ATOM_TUPLE_FOREACH but for a headerless tuple body. */ #define LV2_ATOM_TUPLE_BODY_FOREACH(body, size, iter) \ - for (LV2_Atom* (iter) = (LV2_Atom*)body; \ + for (const LV2_Atom* (iter) = (const LV2_Atom*)body; \ !lv2_atom_tuple_is_end(body, size, (iter)); \ (iter) = lv2_atom_tuple_next(iter))