[spice v2 2/3] server: Simplify the next chunk initialization in red_replay_data_chunks()

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

 



Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
---
 server/red-replay-qxl.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/server/red-replay-qxl.c b/server/red-replay-qxl.c
index 7a146b6..58d401d 100644
--- a/server/red-replay-qxl.c
+++ b/server/red-replay-qxl.c
@@ -257,7 +257,7 @@ static size_t red_replay_data_chunks(SpiceReplay *replay, const char *prefix,
     size_t data_size;
     int count_chunks;
     size_t next_data_size;
-    QXLDataChunk *cur;
+    QXLDataChunk *cur, *next;
 
     replay_fscanf(replay, "data_chunks %d %zu\n", &count_chunks, &data_size);
     if (base_size == 0) {
@@ -277,10 +277,11 @@ static size_t red_replay_data_chunks(SpiceReplay *replay, const char *prefix,
             return 0;
         }
         data_size += next_data_size;
-        ((QXLDataChunk*)cur->next_chunk)->prev_chunk = (QXLPHYSICAL)cur;
-        cur = (QXLDataChunk*)cur->next_chunk;
-        cur->data_size = next_data_size;
-        cur->next_chunk = 0;
+        next = (QXLDataChunk*)cur->next_chunk;
+        next->prev_chunk = (QXLPHYSICAL)cur;
+        next->data_size = next_data_size;
+        next->next_chunk = 0;
+        cur = next;
     }
 
     return data_size;
-- 
2.6.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://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]