mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-23 08:56:47 -05:00
Improve init functions
spa_pod_id has uint32_t value
This commit is contained in:
parent
a092b9312a
commit
2f66e17180
10 changed files with 45 additions and 43 deletions
|
|
@ -137,19 +137,19 @@ struct pw_client_node_message_port_reuse_buffer {
|
|||
|
||||
#define PW_CLIENT_NODE_MESSAGE_TYPE(message) (((struct pw_client_node_message*)(message))->body.type.value)
|
||||
|
||||
#define PW_CLIENT_NODE_MESSAGE_INIT(ev) (struct pw_client_node_message) \
|
||||
{ { { sizeof(struct pw_client_node_message_body), SPA_POD_TYPE_STRUCT } }, \
|
||||
{ SPA_POD_INT_INIT(ev) } }
|
||||
#define PW_CLIENT_NODE_MESSAGE_INIT(message) (struct pw_client_node_message) \
|
||||
{ { { sizeof(struct pw_client_node_message_body), SPA_POD_TYPE_STRUCT } }, \
|
||||
{ SPA_POD_INT_INIT(message) } }
|
||||
|
||||
#define PW_CLIENT_NODE_MESSAGE_INIT_VA(type,size,message,...) (type) \
|
||||
{ { { size, SPA_POD_TYPE_STRUCT } }, \
|
||||
{ SPA_POD_INT_INIT(message), __VA_ARGS__ } } \
|
||||
#define PW_CLIENT_NODE_MESSAGE_INIT_FULL(type,size,message,...) (type) \
|
||||
{ { { size, SPA_POD_TYPE_STRUCT } }, \
|
||||
{ SPA_POD_INT_INIT(message), ##__VA_ARGS__ } } \
|
||||
|
||||
#define PW_CLIENT_NODE_MESSAGE_PORT_REUSE_BUFFER_INIT(port_id,buffer_id) \
|
||||
PW_CLIENT_NODE_MESSAGE_INIT_VA(struct pw_client_node_message_port_reuse_buffer, \
|
||||
sizeof(struct pw_client_node_message_port_reuse_buffer_body), \
|
||||
PW_CLIENT_NODE_MESSAGE_PORT_REUSE_BUFFER, \
|
||||
SPA_POD_INT_INIT(port_id), \
|
||||
#define PW_CLIENT_NODE_MESSAGE_PORT_REUSE_BUFFER_INIT(port_id,buffer_id) \
|
||||
PW_CLIENT_NODE_MESSAGE_INIT_FULL(struct pw_client_node_message_port_reuse_buffer, \
|
||||
sizeof(struct pw_client_node_message_port_reuse_buffer_body), \
|
||||
PW_CLIENT_NODE_MESSAGE_PORT_REUSE_BUFFER, \
|
||||
SPA_POD_INT_INIT(port_id), \
|
||||
SPA_POD_INT_INIT(buffer_id))
|
||||
|
||||
/** information about a buffer */
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ struct pw_map {
|
|||
uint32_t free_list; /**< the free items */
|
||||
};
|
||||
|
||||
#define PW_MAP_INIT(extend) { PW_ARRAY_INIT(extend), 0 }
|
||||
#define PW_MAP_INIT(extend) (struct pw_map) { PW_ARRAY_INIT(extend), 0 }
|
||||
|
||||
#define pw_map_get_size(m) pw_array_get_len(&(m)->items, union pw_map_item)
|
||||
#define pw_map_get_item(m,id) pw_array_get_unchecked(&(m)->items,id,union pw_map_item)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue