cursor-channel-client: Use covariance to avoid some casts

CursorChannelClient knows that the channel is a CursorChannel.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Frediano Ziglio 2019-05-25 08:35:36 +01:00 committed by Frediano Ziglio
parent 0807ccea59
commit 3136a11f39
2 changed files with 6 additions and 2 deletions

View File

@ -40,6 +40,10 @@ public:
void reset_cursor_cache();
RedCacheItem* cache_find(uint64_t id);
int cache_add(uint64_t id, size_t size);
CursorChannel* get_channel()
{
return CURSOR_CHANNEL(CommonGraphicsChannelClient::get_channel());
}
protected:
virtual void on_disconnect() override;

View File

@ -119,7 +119,7 @@ static void red_marshall_cursor_init(CursorChannelClient *ccc, SpiceMarshaller *
CursorChannel *cursor_channel;
SpiceMsgCursorInit msg;
cursor_channel = CURSOR_CHANNEL(ccc->get_channel());
cursor_channel = ccc->get_channel();
ccc->init_send_data(SPICE_MSG_CURSOR_INIT);
msg.visible = cursor_channel->cursor_visible;
@ -135,7 +135,7 @@ static void red_marshall_cursor(CursorChannelClient *ccc,
SpiceMarshaller *m,
RedCursorPipeItem *cursor_pipe_item)
{
CursorChannel *cursor_channel = CURSOR_CHANNEL(ccc->get_channel());
CursorChannel *cursor_channel = ccc->get_channel();
RedCursorPipeItem *item = cursor_pipe_item;
RedCursorCmd *cmd;