[Spice-devel] [spice-server 3/6] Use enum rather than int in RedChannelClient{Latency, Connectivity}Monitor

Christophe Fergeau cfergeau at redhat.com
Mon Apr 10 09:43:08 UTC 2017


On Fri, Apr 07, 2017 at 03:38:05PM -0500, Jonathon Jongsma wrote:
> On Fri, 2017-04-07 at 16:31 +0200, Christophe Fergeau wrote:
> > ---
> >  server/red-channel-client.c | 32 ++++++++++++++++----------------
> >  1 file changed, 16 insertions(+), 16 deletions(-)
> > 
> > diff --git a/server/red-channel-client.c b/server/red-channel-
> > client.c
> > index c988170..eae5794 100644
> > --- a/server/red-channel-client.c
> > +++ b/server/red-channel-client.c
> > @@ -67,8 +67,15 @@ struct SpiceDataHeaderOpaque {
> >      get_msg_size_proc get_msg_size;
> >  };
> >  
> > +enum QosPingState {
> > +    PING_STATE_NONE,
> > +    PING_STATE_TIMER,
> > +    PING_STATE_WARMUP,
> > +    PING_STATE_LATENCY,
> > +};
> > +
> 
> Any particular reason that you didn't typedef this enum?
> 
> e.g.
> 
> typedef enum {
> ...
> } QosPingState;
> 
> Looking through the rest of the code, I can't find any other
> occurrences of something like the following:
> 
> enum enumName var_name;
> 
> So for consistency, I'd prefer to typedef the enum.

Oh, for sure, I considered doing it, and lazily went for simple code
movement with no other change. I'll definitely change it to a typedef.

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


More information about the Spice-devel mailing list