mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
make red_pipe_item_ref more typesafe
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
8d764488ca
commit
f75b69fdc8
@ -20,10 +20,8 @@
|
||||
#include "red-channel.h"
|
||||
#include "red-pipe-item.h"
|
||||
|
||||
RedPipeItem *red_pipe_item_ref(gpointer object)
|
||||
RedPipeItem *red_pipe_item_ref(RedPipeItem *item)
|
||||
{
|
||||
RedPipeItem *item = object;
|
||||
|
||||
g_return_val_if_fail(item->refcount > 0, NULL);
|
||||
|
||||
g_atomic_int_inc(&item->refcount);
|
||||
|
||||
@ -36,7 +36,7 @@ typedef struct RedPipeItem {
|
||||
} RedPipeItem;
|
||||
|
||||
void red_pipe_item_init_full(RedPipeItem *item, int type, red_pipe_item_free_t free_func);
|
||||
RedPipeItem *red_pipe_item_ref(gpointer item);
|
||||
RedPipeItem *red_pipe_item_ref(RedPipeItem *item);
|
||||
void red_pipe_item_unref(gpointer item);
|
||||
|
||||
static inline int red_pipe_item_is_linked(RedPipeItem *item)
|
||||
|
||||
@ -910,7 +910,7 @@ static void vdi_port_send_msg_to_client(RedPipeItem *msg,
|
||||
{
|
||||
RedVDIReadBuf *agent_data_buf = (RedVDIReadBuf *)msg;
|
||||
|
||||
red_pipe_item_ref(agent_data_buf);
|
||||
red_pipe_item_ref(msg);
|
||||
main_channel_client_push_agent_data(red_client_get_main(client),
|
||||
agent_data_buf->data,
|
||||
agent_data_buf->len,
|
||||
|
||||
@ -145,10 +145,10 @@ static void spicevmc_chardev_send_msg_to_client(RedPipeItem *msg,
|
||||
void *opaque)
|
||||
{
|
||||
SpiceVmcState *state = opaque;
|
||||
RedVmcPipeItem *vmc_msg = (RedVmcPipeItem *)msg;
|
||||
RedVmcPipeItem *vmc_msg = SPICE_CONTAINEROF(msg, RedVmcPipeItem, base);
|
||||
|
||||
spice_assert(state->rcc->client == client);
|
||||
red_pipe_item_ref(vmc_msg);
|
||||
red_pipe_item_ref(msg);
|
||||
red_channel_client_pipe_add_push(state->rcc, (RedPipeItem *)vmc_msg);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user