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

@ -401,15 +401,15 @@ struct spa_pod_prop_body0 {
/* v2 iterates object as containing spa_pod */
#define SPA_POD_OBJECT_BODY_FOREACH0(body, size, iter) \
for ((iter) = SPA_MEMBER((body), sizeof(struct spa_pod_object_body), struct spa_pod); \
for ((iter) = SPA_PTROFF((body), sizeof(struct spa_pod_object_body), struct spa_pod); \
spa_pod_is_inside(body, size, iter); \
(iter) = spa_pod_next(iter))
#define SPA_POD_PROP_ALTERNATIVE_FOREACH0(body, _size, iter) \
for ((iter) = SPA_MEMBER((body), (body)->value.size + \
for ((iter) = SPA_PTROFF((body), (body)->value.size + \
sizeof(struct spa_pod_prop_body0), __typeof__(*iter)); \
(iter) <= SPA_MEMBER((body), (_size)-(body)->value.size, __typeof__(*iter)); \
(iter) = SPA_MEMBER((iter), (body)->value.size, __typeof__(*iter)))
(iter) <= SPA_PTROFF((body), (_size)-(body)->value.size, __typeof__(*iter)); \
(iter) = SPA_PTROFF((iter), (body)->value.size, __typeof__(*iter)))
#define SPA0_POD_PROP_N_VALUES(b,size) ((size - sizeof(struct spa_pod_prop_body0)) / (b)->value.size)