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

David Robillard d at drobilla.net
Sun Dec 15 13:52:01 PST 2013

On Mon, 2013-12-09 at 20:41 +0100, Robin Gareus wrote:
> Signed-off-by: Robin Gareus <robin at gareus.org>
> -static inline LV2_Atom_Event*
> +static inline const LV2_Atom_Event*
>  lv2_atom_sequence_end(const LV2_Atom_Sequence_Body* body, uint32_t size)
[and so on...]

Hm, you're right.  Somehow even my ridiculously strict hyper warning
flags enabled by configure --ultra-strict were missing -Wcast-qual.
Turning that on, the violations are much more extensive.  Patch

Kind of embarrassing for someone so infamously anal about code quality,
shame on me :)

I'd like to fix this, but it can cause problems with existing code, even
without -Werror:

../ingen/src/server/mix.cpp:75:23: error: invalid conversion from ‘const
LV2_Atom_Event*’ to ‘LV2_Atom_Event*’ [-fpermissive]

What to do? :/  I feel like at some point in the future a better set of
atom utility headers could probably be made, but this seems like too
trivial a reason to add a version 2.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lv2_fix_const_violations.diff
Type: text/x-patch
Size: 17213 bytes
Desc: not available
URL: <http://lists.lv2plug.in/pipermail/devel-lv2plug.in/attachments/20131215/18e74df3/attachment-0002.bin>

More information about the Devel mailing list