[Spice-devel] [PATCH spice-server 1/3] reds: Use proper enumeration for read_state field

Christophe Fergeau cfergeau at redhat.com
Thu Feb 14 12:28:26 UTC 2019


Acked-by: Christophe Fergeau <cfergeau at redhat.com>

On Wed, Feb 13, 2019 at 02:53:14PM +0000, Frediano Ziglio wrote:
> Allows the compiler to catch some additional errors.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/reds.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/server/reds.c b/server/reds.c
> index 306bb7c6e..f27e28b9d 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -224,11 +224,11 @@ typedef struct RedVDIReadBuf {
>      uint8_t data[SPICE_AGENT_MAX_DATA_SIZE];
>  } RedVDIReadBuf;
>  
> -enum {
> +typedef enum {
>      VDI_PORT_READ_STATE_READ_HEADER,
>      VDI_PORT_READ_STATE_GET_BUFF,
>      VDI_PORT_READ_STATE_READ_DATA,
> -};
> +} VDIPortReadStates;
>  
>  struct RedCharDeviceVDIPortPrivate {
>      gboolean agent_attached;
> @@ -242,7 +242,7 @@ struct RedCharDeviceVDIPortPrivate {
>  
>      /* read from agent */
>      uint32_t num_read_buf;
> -    uint32_t read_state;
> +    VDIPortReadStates read_state;
>      uint32_t message_receive_len;
>      uint8_t *receive_pos;
>      uint32_t receive_len;
> -- 
> 2.20.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190214/9c5a7a50/attachment.sig>


More information about the Spice-devel mailing list