spa/buffer: rename SPA_MEMBER to SPA_PTROFF

SPA_MEMBER is misleading, all we're doing here is pointer+offset and a
type-casting the result. Rename to SPA_PTROFF which is more expressive (and
has the same number of characters so we don't need to re-indent).
This commit is contained in:
Peter Hutterer 2021-05-06 13:41:44 +10:00 committed by Wim Taymans
parent e598d0a422
commit 2405f0942b
92 changed files with 248 additions and 227 deletions

View file

@ -100,9 +100,9 @@ spa_ringbuffer_read_data(struct spa_ringbuffer *rbuf,
uint32_t offset, void *data, uint32_t len)
{
uint32_t l0 = SPA_MIN(len, size - offset), l1 = len - l0;
spa_memcpy(data, SPA_MEMBER(buffer, offset, void), l0);
spa_memcpy(data, SPA_PTROFF(buffer, offset, void), l0);
if (SPA_UNLIKELY(l1 > 0))
spa_memcpy(SPA_MEMBER(data, l0, void), buffer, l1);
spa_memcpy(SPA_PTROFF(data, l0, void), buffer, l1);
}
/**
@ -150,9 +150,9 @@ spa_ringbuffer_write_data(struct spa_ringbuffer *rbuf,
uint32_t offset, const void *data, uint32_t len)
{
uint32_t l0 = SPA_MIN(len, size - offset), l1 = len - l0;
spa_memcpy(SPA_MEMBER(buffer, offset, void), data, l0);
spa_memcpy(SPA_PTROFF(buffer, offset, void), data, l0);
if (SPA_UNLIKELY(l1 > 0))
spa_memcpy(buffer, SPA_MEMBER(data, l0, void), l1);
spa_memcpy(buffer, SPA_PTROFF(data, l0, void), l1);
}
/**