[Spice-devel] [PATCH 01/18] server/red_worker: change hold_item sig, drop the void*

Alon Levy alevy at redhat.com
Thu Feb 10 07:16:32 PST 2011


On Tue, Feb 08, 2011 at 10:09:42PM +0100, Marc-André Lureau wrote:
> ack
> 
> Btw, I realize that in the previous patch series, we had
> 
> index e8ebb05..a778ffb 100644
> --- a/server/red_channel.h
> +++ b/server/red_channel.h
> @@ -107,6 +107,7 @@ typedef void
> (*channel_release_msg_recv_buf_proc)(RedChannel *channel,
>  typedef void (*channel_disconnect_proc)(RedChannel *channel);
>  typedef int (*channel_configure_socket_proc)(RedChannel *channel);
>  typedef void (*channel_send_pipe_item_proc)(RedChannel *channel,
> PipeItem *item);
> +typedef void (*channel_hold_pipe_item_proc)(PipeItem *item);
> 
> 
> It would be more consistent to have:
> +typedef void (*channel_hold_pipe_item_proc)(RedChannel *channel,
> PipeItem *item);
> 

Actually, I noticed this too, but currently it makes the point of
saying that function doesn't care about the channel at all, which is
ok as long as we don't need it to be.

> 
> On Mon, Feb 7, 2011 at 7:19 PM, Alon Levy <alevy at redhat.com> wrote:
> > changed to PipeItem *
> > ---
> >  server/red_worker.c |    8 ++++----
> >  1 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/server/red_worker.c b/server/red_worker.c
> > index 2acef40..df51841 100644
> > --- a/server/red_worker.c
> > +++ b/server/red_worker.c
> > @@ -347,7 +347,7 @@ typedef struct LocalCursor {
> >
> >  typedef struct RedChannel RedChannel;
> >  typedef void (*disconnect_channel_proc)(RedChannel *channel);
> > -typedef void (*hold_pipe_item_proc)(void *item);
> > +typedef void (*hold_pipe_item_proc)(PipeItem *item);
> >  typedef void (*release_item_proc)(RedChannel *channel, void *item);
> >  typedef int (*handle_message_proc)(RedChannel *channel, size_t size, uint32_t type, void *message);
> >
> > @@ -9389,10 +9389,10 @@ static void handle_channel_events(EventListener *in_listener, uint32_t events)
> >     }
> >  }
> >
> > -static void display_channel_hold_pipe_item(void *item)
> > +static void display_channel_hold_pipe_item(PipeItem *item)
> >  {
> >     ASSERT(item);
> > -    switch (((PipeItem *)item)->type) {
> > +    switch (item->type) {
> >     case PIPE_ITEM_TYPE_DRAW:
> >     case PIPE_ITEM_TYPE_STREAM_CREATE:
> >         SPICE_CONTAINEROF(item, Drawable, pipe_item)->refs++;
> > @@ -9544,7 +9544,7 @@ static void on_new_cursor_channel(RedWorker *worker)
> >     }
> >  }
> >
> > -static void cursor_channel_hold_pipe_item(void *item)
> > +static void cursor_channel_hold_pipe_item(PipeItem *item)
> >  {
> >     ASSERT(item);
> >     ((CursorItem *)item)->refs++;
> > --
> > 1.7.4
> >
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> >
> 
> 
> 
> -- 
> Marc-André Lureau


More information about the Spice-devel mailing list