[Spice-devel] [spice-server 06/10] Move variables to inner block in red_peer_handle_incoming()

Jonathon Jongsma jjongsma at redhat.com
Wed Feb 8 22:44:28 UTC 2017


Acked-by: Jonathon Jongsma <jjongsma at redhat.com>


On Tue, 2017-02-07 at 11:59 +0100, Christophe Fergeau wrote:
> Minor refactoring in preparation for the next commits (and regardless
> of
> the other commits, the less variables to keep track of when reading
> code, the better).
> ---
>  server/red-channel-client.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/server/red-channel-client.c b/server/red-channel-
> client.c
> index 0c43c46..e93ef4b 100644
> --- a/server/red-channel-client.c
> +++ b/server/red-channel-client.c
> @@ -1120,9 +1120,6 @@ static int red_peer_receive(RedsStream *stream,
> uint8_t *buf, uint32_t size)
>  static void red_peer_handle_incoming(RedsStream *stream,
> IncomingHandler *handler)
>  {
>      int bytes_read;
> -    uint8_t *parsed;
> -    size_t parsed_size;
> -    message_destructor_t parsed_free;
>      uint16_t msg_type;
>      uint32_t msg_size;
>  
> @@ -1183,6 +1180,10 @@ static void
> red_peer_handle_incoming(RedsStream *stream, IncomingHandler *handle
>          }
>  
>          if (handler->cb->parser) {
> +            uint8_t *parsed;
> +            size_t parsed_size;
> +            message_destructor_t parsed_free;
> +
>              parsed = handler->cb->parser(handler->msg,
>                  handler->msg + msg_size, msg_type,
>                  SPICE_VERSION_MINOR, &parsed_size, &parsed_free);


More information about the Spice-devel mailing list