diff options
author | David Robillard <d@drobilla.net> | 2022-08-08 18:37:01 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-08-17 13:50:48 -0400 |
commit | 147d8d8ae845f0c1ae4f2ad97b6e2f48228d97b7 (patch) | |
tree | d8fba57744aadb88748b353c8a7ab77f4bf40a5c | |
parent | 73a795c17de2a8df0174cbc8a3a00353a4d60446 (diff) | |
download | jalv-147d8d8ae845f0c1ae4f2ad97b6e2f48228d97b7.tar.gz jalv-147d8d8ae845f0c1ae4f2ad97b6e2f48228d97b7.tar.bz2 jalv-147d8d8ae845f0c1ae4f2ad97b6e2f48228d97b7.zip |
Use lv2_atom_pad_size()
-rw-r--r-- | src/lv2_evbuf.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/lv2_evbuf.c b/src/lv2_evbuf.c index 4862961..47ddd3f 100644 --- a/src/lv2_evbuf.c +++ b/src/lv2_evbuf.c @@ -4,6 +4,7 @@ #include "lv2_evbuf.h" #include "lv2/atom/atom.h" +#include "lv2/atom/util.h" #include <assert.h> #include <stdlib.h> @@ -16,12 +17,6 @@ struct LV2_Evbuf_Impl { LV2_Atom_Sequence buf; }; -static inline uint32_t -lv2_evbuf_pad_size(uint32_t size) -{ - return (size + 7) & (~7); -} - LV2_Evbuf* lv2_evbuf_new(uint32_t capacity, uint32_t atom_Chunk, uint32_t atom_Sequence) { @@ -80,7 +75,7 @@ LV2_Evbuf_Iterator lv2_evbuf_end(LV2_Evbuf* evbuf) { const uint32_t size = lv2_evbuf_get_size(evbuf); - const LV2_Evbuf_Iterator iter = {evbuf, lv2_evbuf_pad_size(size)}; + const LV2_Evbuf_Iterator iter = {evbuf, lv2_atom_pad_size(size)}; return iter; } @@ -104,7 +99,7 @@ lv2_evbuf_next(LV2_Evbuf_Iterator iter) &evbuf->buf.atom) + offset)) ->body.size; - offset += lv2_evbuf_pad_size(sizeof(LV2_Atom_Event) + size); + offset += lv2_atom_pad_size(sizeof(LV2_Atom_Event) + size); LV2_Evbuf_Iterator next = {evbuf, offset}; return next; @@ -164,7 +159,7 @@ lv2_evbuf_write(LV2_Evbuf_Iterator* iter, aev->body.size = size; memcpy(LV2_ATOM_BODY(&aev->body), data, size); - size = lv2_evbuf_pad_size(sizeof(LV2_Atom_Event) + size); + size = lv2_atom_pad_size(sizeof(LV2_Atom_Event) + size); aseq->atom.size += size; iter->offset += size; |