mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-15 07:00:05 -05:00
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:
parent
e598d0a422
commit
2405f0942b
92 changed files with 248 additions and 227 deletions
|
|
@ -104,10 +104,10 @@ static void on_notify_events(void *data, int fd, uint32_t mask)
|
|||
if (len <= 0)
|
||||
break;
|
||||
|
||||
e = SPA_MEMBER(&buf, len, void);
|
||||
e = SPA_PTROFF(&buf, len, void);
|
||||
|
||||
for (p = &buf; p < e;
|
||||
p = SPA_MEMBER(p, sizeof(struct inotify_event) + event->len, void)) {
|
||||
p = SPA_PTROFF(p, sizeof(struct inotify_event) + event->len, void)) {
|
||||
event = (const struct inotify_event *) p;
|
||||
|
||||
if ((event->mask & IN_ATTRIB)) {
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ void *sm_object_add_data(struct sm_object *obj, const char *id, size_t size)
|
|||
|
||||
spa_list_append(&obj->data, &d->link);
|
||||
done:
|
||||
return SPA_MEMBER(d, sizeof(struct data), void);
|
||||
return SPA_PTROFF(d, sizeof(struct data), void);
|
||||
}
|
||||
|
||||
void *sm_object_get_data(struct sm_object *obj, const char *id)
|
||||
|
|
@ -280,7 +280,7 @@ void *sm_object_get_data(struct sm_object *obj, const char *id)
|
|||
d = object_find_data(obj, id);
|
||||
if (d == NULL)
|
||||
return NULL;
|
||||
return SPA_MEMBER(d, sizeof(struct data), void);
|
||||
return SPA_PTROFF(d, sizeof(struct data), void);
|
||||
}
|
||||
|
||||
int sm_object_remove_data(struct sm_object *obj, const char *id)
|
||||
|
|
@ -390,7 +390,7 @@ static struct param *add_param(struct spa_list *param_list,
|
|||
return NULL;
|
||||
|
||||
p->this.id = id;
|
||||
p->this.param = SPA_MEMBER(p, sizeof(struct param), struct spa_pod);
|
||||
p->this.param = SPA_PTROFF(p, sizeof(struct param), struct spa_pod);
|
||||
memcpy(p->this.param, param, SPA_POD_SIZE(param));
|
||||
|
||||
spa_list_append(param_list, &p->this.link);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue