pulse-server: message: use union to store event data

Store subscription event data in a union instead of
just an array for better readability.
This commit is contained in:
Barnabás Pőcze 2024-05-14 16:32:19 +02:00 committed by Wim Taymans
parent d467f6fdc6
commit 46e4a33f27
3 changed files with 21 additions and 9 deletions

View file

@ -13,15 +13,27 @@
struct impl;
enum message_type {
MESSAGE_TYPE_UNSPECIFIED,
MESSAGE_TYPE_SUBSCRIPTION_EVENT,
};
struct message {
struct spa_list link;
struct impl *impl;
uint32_t extra[4];
uint32_t channel;
uint32_t allocated;
uint32_t length;
uint32_t offset;
uint8_t *data;
enum message_type type;
union {
struct {
uint32_t event;
uint32_t index;
} subscription_event;
} u;
};
enum {