From fccae6d1db416835dab147554d832a1726e68a5a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 10 Jan 2025 09:59:29 -0500 Subject: Make loop variable const Avoids a constVariablePointer warning from cppcheck. Unfortunately, some of the atom utilities violate const-correctness, so avoid using LV2_ATOM_SEQUENCE_BODY_FOREACH and just write the loop out manually. --- src/sratom.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sratom.c b/src/sratom.c index fe48750..cffa501 100644 --- a/src/sratom.c +++ b/src/sratom.c @@ -453,7 +453,9 @@ sratom_write(Sratom* sratom, start_object(sratom, &flags, subject, predicate, &id, type); SerdNode p = serd_node_from_string(SERD_URI, NS_RDF "value"); flags |= SERD_LIST_O_BEGIN; - LV2_ATOM_SEQUENCE_BODY_FOREACH (seq, size, ev) { + for (const LV2_Atom_Event* ev = lv2_atom_sequence_begin(seq); + !lv2_atom_sequence_is_end(seq, size, ev); + ev = lv2_atom_sequence_next(ev)) { sratom->seq_unit = seq->unit; list_append(sratom, unmap, -- cgit v1.2.1