From 6d89b2ba4c6e29a4e40cfb15073e92aa47955f5e Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Thu, 10 Nov 2011 16:28:07 +0200 Subject: server/main_channel: fix pointer-to-int-cast error 64 bit-ism removed. --- server/main_channel.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/main_channel.c b/server/main_channel.c index 0ce3b486..4b5b6698 100644 --- a/server/main_channel.c +++ b/server/main_channel.c @@ -213,13 +213,18 @@ static PipeItem *main_ping_item_new(MainChannelClient *mcc, int size) return &item->base; } +typedef struct MainTokensItemInfo { + uint32_t num_tokens; +} MainTokensItemInfo; + static PipeItem *main_tokens_item_new(RedChannelClient *rcc, void *data, int num) { TokensPipeItem *item = spice_malloc(sizeof(TokensPipeItem)); + MainTokensItemInfo *init = data; red_channel_pipe_item_init(rcc->channel, &item->base, SPICE_MSG_MAIN_AGENT_TOKEN); - item->tokens = (uint64_t)data; + item->tokens = init->num_tokens; return &item->base; } @@ -387,8 +392,10 @@ static void main_channel_marshall_agent_disconnected(SpiceMarshaller *m) // TODO: make this targeted (requires change to agent token accounting) void main_channel_push_tokens(MainChannel *main_chan, uint32_t num_tokens) { + MainTokensItemInfo init = {.num_tokens = num_tokens}; + red_channel_pipes_new_add_push(&main_chan->base, - main_tokens_item_new, (void*)(uint64_t)num_tokens); + main_tokens_item_new, &init); } static void main_channel_marshall_tokens(SpiceMarshaller *m, uint32_t num_tokens) -- cgit