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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);
-- 
2.9.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]