From: Corentin Chary Date: Fri, 4 Feb 2011 08:06:02 +0000 (+0100) Subject: vnc: fix uint8_t comparisons with negative values X-Git-Tag: TizenStudio_2.0_p2.3~3301 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=885437c19e02f822ac3117f787dd4c9d546514d9;p=sdk%2Femulator%2Fqemu.git vnc: fix uint8_t comparisons with negative values Signed-off-by: Corentin Chary Signed-off-by: Anthony Liguori --- diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index ad9a9a8..81024d5 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c @@ -1546,7 +1546,7 @@ static int send_sub_rect(VncState *vs, int x, int y, int w, int h) vnc_tight_stop(vs); #ifdef CONFIG_VNC_JPEG - if (vs->tight.quality != -1) { + if (vs->tight.quality != (uint8_t)-1) { double freq = vnc_update_freq(vs, x, y, w, h); if (freq < tight_jpeg_conf[vs->tight.quality].jpeg_freq_min) { @@ -1711,7 +1711,7 @@ static int tight_send_framebuffer_update(VncState *vs, int x, int y, vs->tight.pixel24 = false; } - if (vs->tight.quality != -1) { + if (vs->tight.quality != (uint8_t)-1) { double freq = vnc_update_freq(vs, x, y, w, h); if (freq > tight_jpeg_conf[vs->tight.quality].jpeg_freq_threshold) { diff --git a/ui/vnc-enc-zrle.c b/ui/vnc-enc-zrle.c index 016a406..917d384 100644 --- a/ui/vnc-enc-zrle.c +++ b/ui/vnc-enc-zrle.c @@ -260,7 +260,8 @@ static int zrle_send_framebuffer_update(VncState *vs, int x, int y, int zywrle_level; if (vs->zrle.type == VNC_ENCODING_ZYWRLE) { - if (!vs->vd->lossy || vs->tight.quality < 0 || vs->tight.quality == 9) { + if (!vs->vd->lossy || vs->tight.quality == (uint8_t)-1 + || vs->tight.quality == 9) { zywrle_level = 0; vs->zrle.type = VNC_ENCODING_ZRLE; } else if (vs->tight.quality < 3) {