From 3f2868e1e5299f8f9258a9a82907b75a93a666bf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 8 Sep 2012 17:21:50 +0000 Subject: Remove asserts from event-helper.h. --- lv2/lv2plug.in/ns/ext/event/event-helpers.h | 9 ++++++--- lv2/lv2plug.in/ns/ext/event/lv2-event.doap.ttl | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lv2/lv2plug.in/ns/ext/event/event-helpers.h b/lv2/lv2plug.in/ns/ext/event/event-helpers.h index fcd13fe..0fe2d79 100644 --- a/lv2/lv2plug.in/ns/ext/event/event-helpers.h +++ b/lv2/lv2plug.in/ns/ext/event/event-helpers.h @@ -22,7 +22,6 @@ #ifndef LV2_EVENT_HELPERS_H #define LV2_EVENT_HELPERS_H -#include #include #include #include @@ -124,7 +123,9 @@ lv2_event_is_valid(LV2_Event_Iterator* iter) static inline bool lv2_event_increment(LV2_Event_Iterator* iter) { - assert(lv2_event_is_valid(iter)); + if (!lv2_event_is_valid(iter)) { + return false; + } LV2_Event* const ev = (LV2_Event*)( (uint8_t*)iter->buf->data + iter->offset); @@ -146,7 +147,9 @@ static inline LV2_Event* lv2_event_get(LV2_Event_Iterator* iter, uint8_t** data) { - assert(lv2_event_is_valid(iter)); + if (!lv2_event_is_valid(iter)) { + return false; + } LV2_Event* const ev = (LV2_Event*)( (uint8_t*)iter->buf->data + iter->offset); diff --git a/lv2/lv2plug.in/ns/ext/event/lv2-event.doap.ttl b/lv2/lv2plug.in/ns/ext/event/lv2-event.doap.ttl index 6dd546f..f811514 100644 --- a/lv2/lv2plug.in/ns/ext/event/lv2-event.doap.ttl +++ b/lv2/lv2plug.in/ns/ext/event/lv2-event.doap.ttl @@ -19,6 +19,8 @@ dcs:changeset [ dcs:item [ rdfs:label "Make event iterator gracefully handle optional ports." + ] , [ + rdfs:label "Remove asserts from event-helper.h." ] , [ rdfs:label "Use more precise domain and range for EventPort properties." ] , [ -- cgit v1.2.1