diff options
author | David Robillard <d@drobilla.net> | 2011-11-06 19:56:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-11-06 19:56:38 +0000 |
commit | ad2bddcbee17a637a73d24ede3ecffde8d499b62 (patch) | |
tree | dc84f6404ba74cd3d9805e9b3ebcb495c573268a /ext/event.lv2/event-helpers.h | |
parent | ee319f2c45766164eab47e0b5949c80e0c464ada (diff) | |
download | lv2-ad2bddcbee17a637a73d24ede3ecffde8d499b62.tar.xz |
Lint.
Diffstat (limited to 'ext/event.lv2/event-helpers.h')
-rw-r--r-- | ext/event.lv2/event-helpers.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/event.lv2/event-helpers.h b/ext/event.lv2/event-helpers.h index d97ae73..75ba14b 100644 --- a/ext/event.lv2/event-helpers.h +++ b/ext/event.lv2/event-helpers.h @@ -51,7 +51,9 @@ lv2_event_pad_size(uint16_t size) * The contents of buf are ignored entirely and overwritten, except capacity * which is unmodified. */ static inline void -lv2_event_buffer_reset(LV2_Event_Buffer* buf, uint16_t stamp_type, uint8_t *data) +lv2_event_buffer_reset(LV2_Event_Buffer* buf, + uint16_t stamp_type, + uint8_t *data) { buf->data = data; buf->header_size = sizeof(LV2_Event_Buffer); @@ -65,7 +67,8 @@ lv2_event_buffer_reset(LV2_Event_Buffer* buf, uint16_t stamp_type, uint8_t *data static inline LV2_Event_Buffer* lv2_event_buffer_new(uint32_t capacity, uint16_t stamp_type) { - LV2_Event_Buffer* buf = (LV2_Event_Buffer*)malloc(sizeof(LV2_Event_Buffer) + capacity); + const size_t size = sizeof(LV2_Event_Buffer) + capacity; + LV2_Event_Buffer* buf = (LV2_Event_Buffer*)malloc(size); if (buf != NULL) { buf->capacity = capacity; lv2_event_buffer_reset(buf, stamp_type, (uint8_t *)(buf + 1)); |