c++ compiler fixes

This commit is contained in:
Wim Taymans 2018-02-08 11:24:20 +01:00
parent f049d3dc7f
commit 21e3b4cec7
5 changed files with 26 additions and 16 deletions

View file

@ -97,9 +97,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;
memcpy(data, buffer + offset, l0);
memcpy(data, SPA_MEMBER(buffer, offset, void), l0);
if (SPA_UNLIKELY(l1 > 0))
memcpy(data + l0, buffer, l1);
memcpy(SPA_MEMBER(data, l0, void), buffer, l1);
}
/**
@ -147,9 +147,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;
memcpy(buffer + offset, data, l0);
memcpy(SPA_MEMBER(buffer, offset, void), data, l0);
if (SPA_UNLIKELY(l1 > 0))
memcpy(buffer, data + l0, l1);
memcpy(buffer, SPA_MEMBER(data, l0, void), l1);
}
/**