]> Git Repo - qemu.git/commitdiff
vnc: explain why set_encodings loop is reversed
authorCorentin Chary <[email protected]>
Wed, 19 May 2010 07:24:02 +0000 (09:24 +0200)
committerAnthony Liguori <[email protected]>
Tue, 1 Jun 2010 17:53:09 +0000 (12:53 -0500)
Add a small comment to explain why we need to start from
the end of the array to set the right prefered encoding.

Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
vnc.c

diff --git a/vnc.c b/vnc.c
index 1fb46bdc761894637957ad25659ca5402495b979..774a0b315a5302ad635ead31466247cdcebdf22d 100644 (file)
--- a/vnc.c
+++ b/vnc.c
@@ -1649,6 +1649,11 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
     vs->tight_quality = 9;
     vs->absolute = -1;
 
+    /*
+     * Start from the end because the encodings are sent in order of preference.
+     * This way the prefered encoding (first encoding defined in the array)
+     * will be set at the end of the loop.
+     */
     for (i = n_encodings - 1; i >= 0; i--) {
         enc = encodings[i];
         switch (enc) {
This page took 0.028248 seconds and 4 git commands to generate.