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

@ -770,7 +770,7 @@ impl_node_port_use_buffers(void *object,
mb[i].buffer = &b->buffer;
mb[i].mem_id = b->memid;
mb[i].offset = SPA_PTRDIFF(baseptr, SPA_MEMBER(mem->map->ptr, mem->map->offset, void));
mb[i].offset = SPA_PTRDIFF(baseptr, SPA_PTROFF(mem->map->ptr, mem->map->offset, void));
mb[i].size = data_size;
for (j = 0; j < buffers[i]->n_metas; j++)

View file

@ -70,25 +70,25 @@ static void transport_setup_area(void *p, struct pw_client_node0_transport *tran
struct pw_client_node0_area *a;
trans->area = a = p;
p = SPA_MEMBER(p, sizeof(struct pw_client_node0_area), struct spa_io_buffers);
p = SPA_PTROFF(p, sizeof(struct pw_client_node0_area), struct spa_io_buffers);
trans->inputs = p;
p = SPA_MEMBER(p, a->max_input_ports * sizeof(struct spa_io_buffers), void);
p = SPA_PTROFF(p, a->max_input_ports * sizeof(struct spa_io_buffers), void);
trans->outputs = p;
p = SPA_MEMBER(p, a->max_output_ports * sizeof(struct spa_io_buffers), void);
p = SPA_PTROFF(p, a->max_output_ports * sizeof(struct spa_io_buffers), void);
trans->input_buffer = p;
p = SPA_MEMBER(p, sizeof(struct spa_ringbuffer), void);
p = SPA_PTROFF(p, sizeof(struct spa_ringbuffer), void);
trans->input_data = p;
p = SPA_MEMBER(p, INPUT_BUFFER_SIZE, void);
p = SPA_PTROFF(p, INPUT_BUFFER_SIZE, void);
trans->output_buffer = p;
p = SPA_MEMBER(p, sizeof(struct spa_ringbuffer), void);
p = SPA_PTROFF(p, sizeof(struct spa_ringbuffer), void);
trans->output_data = p;
p = SPA_MEMBER(p, OUTPUT_BUFFER_SIZE, void);
p = SPA_PTROFF(p, OUTPUT_BUFFER_SIZE, void);
}
static void transport_reset_area(struct pw_client_node0_transport *trans)