[Spice-devel] [PATCH v2] Remove duplicate typedef from headers

Christophe Fergeau cfergeau at redhat.com
Fri Apr 1 15:16:52 UTC 2016


On Fri, Apr 01, 2016 at 09:52:42AM -0400, Frediano Ziglio wrote:
> > 
> > Hey,
> > 
> > On Thu, Mar 31, 2016 at 08:24:00AM +0100, Frediano Ziglio wrote:
> > > diff --git a/server/reds-stream.h b/server/reds-stream.h
> > > index 1123048..b31bc34 100644
> > > --- a/server/reds-stream.h
> > > +++ b/server/reds-stream.h
> > > @@ -28,7 +28,6 @@
> > >  typedef void (*AsyncReadDone)(void *opaque);
> > >  typedef void (*AsyncReadError)(void *opaque, int err);
> > >  
> > > -typedef struct RedsState RedsState;
> > >  typedef struct RedsStream RedsStream;
> > >  typedef struct RedsStreamPrivate RedsStreamPrivate;
> > >  
> > > @@ -68,7 +67,7 @@ void reds_stream_push_channel_event(RedsStream *s, int
> > > event);
> > >  void reds_stream_remove_watch(RedsStream* s);
> > >  void reds_stream_set_channel(RedsStream *stream, int connection_id,
> > >                               int channel_type, int channel_id);
> > > -RedsStream *reds_stream_new(RedsState *reds, int socket);
> > > +RedsStream *reds_stream_new(struct RedsState *reds, int socket);
> > >  bool reds_stream_is_ssl(RedsStream *stream);
> > >  RedsStreamSslStatus reds_stream_ssl_accept(RedsStream *stream);
> > 
> > Not a big fan either of having reds-stream.h using struct RedsState
> > while everywhere else RedsState is used. I still prefer my initial
> > version, or alternatively, a red-types.h header where the RedsState
> > typedef could go.
> > 
> > Christophe
> > 
> 
> Why not including reds.h in reds-stream.h ?

Everything seems a bit tangled, adding #include "reds.h" in
reds-stream.h means the typedef struct Reds Reds needs to go before the
#include in reds.h as some of these will include reds-stream.h. Then I
got to some more entanglement when trying to compile main-dispatcher.c
which I did not look too much into.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160401/f777a2d0/attachment-0001.sig>


More information about the Spice-devel mailing list