summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois Gouget <fgouget@codeweavers.com>2016-01-11 19:28:29 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2016-01-13 12:08:17 +0100
commit5331b7cb2b5c91b09aa23d12bd406edb41df7ae6 (patch)
treea5e7832a0eed1dfcec889957962a1dce7fcb94cd
parent5a27d06ab4b75e67d6ce80125198874c379167b7 (diff)
server: Simplify the next chunk initialization in red_replay_data_chunks()
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
-rw-r--r--server/red_replay_qxl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/server/red_replay_qxl.c b/server/red_replay_qxl.c
index 5239c068..312b87ad 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;