[Spice-devel] [PATCH] Make some function static

Frediano Ziglio fziglio at redhat.com
Tue May 24 10:40:41 UTC 2016


> 
> On Tue, May 24, 2016 at 10:52:58AM +0100, Frediano Ziglio wrote:
> > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > ---
> >  server/dcc.c             | 2 +-
> >  server/display-channel.c | 8 +++++---
> >  server/display-channel.h | 2 --
> >  server/red-parse-qxl.c   | 2 +-
> >  server/red-parse-qxl.h   | 1 -
> >  server/stream.c          | 4 ++--
> >  server/stream.h          | 1 -
> >  7 files changed, 9 insertions(+), 11 deletions(-)
> > 
> > diff --git a/server/stream.c b/server/stream.c
> > index be92289..f59abeb 100644
> > --- a/server/stream.c
> > +++ b/server/stream.c
> > @@ -27,7 +27,7 @@
> >           item != NULL;                                  \
> >           item = ring_next(&(display)->streams, item))
> >  
> > -void stream_agent_stats_print(StreamAgent *agent)
> > +static void stream_agent_stats_print(StreamAgent *agent)
> >  {
> >  #ifdef STREAM_STATS
> >      StreamStats *stats = &agent->stats;
> > @@ -161,7 +161,7 @@ void stream_agent_unref(DisplayChannel *display,
> > StreamAgent *agent)
> >      stream_unref(display, agent->stream);
> >  }
> >  
> > -void red_stream_clip_item_free(RedPipeItem *base)
> > +static void red_stream_clip_item_free(RedPipeItem *base)
> 
> Not really related to this patch, but having a public _new method, and a
> static _free method looks odd to me.
> 

In this case all RedPipeItem have a static free function.
The reason is that the free is feed to red_pipe_item_init which will
use the registered free function to release resources. Perhaps the
"release" name would sound better.

> Acked-by: Christophe Fergeau <cfergeau at redhat.com>
> 
> (did not read this very carefully, but compilation would break if there
> were issues ;)
> 
> Christophe
> 

Frediano


More information about the Spice-devel mailing list