[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 10/16] vnc: fix uint8_t comparisons with negative
From: |
Corentin Chary |
Subject: |
[Qemu-devel] [PATCH v3 10/16] vnc: fix uint8_t comparisons with negative values |
Date: |
Fri, 4 Feb 2011 09:06:02 +0100 |
Signed-off-by: Corentin Chary <address@hidden>
---
ui/vnc-enc-tight.c | 4 ++--
ui/vnc-enc-zrle.c | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
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) {
--
1.7.3.4
- Re: [Qemu-devel] [PATCH v3 01/16] vnc: qemu can die if the client is disconnected while updating screen, (continued)
- [Qemu-devel] [PATCH v3 02/16] vnc: don't set the quality if lossy encoding are disabled, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 03/16] vnc: add a way to get the update frequency for a given region, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 04/16] vnc: refresh lossy rect after a given timeout, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 05/16] vnc: tight: use the update frequency to choose between lossy and lossless, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 06/16] vnc: palette: use a pool to reduce memory allocations, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 07/16] vnc: palette: add palette_init calls, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 08/16] vnc: palette: and fill and color calls., Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 10/16] vnc: fix uint8_t comparisons with negative values,
Corentin Chary <=
- [Qemu-devel] [PATCH v3 09/16] vnc: Add ZRLE and ZYWRLE encodings., Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 11/16] vnc: fix lossy rect refreshing, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 12/16] bitmap: add a generic bitmap and bitops library, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 13/16] vnc: use the new generic bitmap functions, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 14/16] vnc: don't try to send bigger updates that client height, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 15/16] vnc: tight: tweak adaptive tight settings, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 16/16] vnc: add a non-adaptive option, Corentin Chary, 2011/02/04
- Re: [Qemu-devel] [PATCH v3 00/16] vnc: adapative tight, zrle, zywrle, and bitmap module, Stefan Weil, 2011/02/24
- Re: [Qemu-devel] [PATCH v3 00/16] vnc: adapative tight, zrle, zywrle, and bitmap module, Stefan Weil, 2011/02/24
- Re: [Qemu-devel] [PATCH v3 00/16] vnc: adapative tight, zrle, zywrle, and bitmap module, Corentin Chary, 2011/02/24