aboutsummaryrefslogtreecommitdiff
path: root/ui/vnc-enc-tight.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-07-27 15:32:39 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-07-27 15:32:39 +0000
commit7bccf57383cca60a778d5c543ac80c9f62d89ef2 (patch)
tree72fbace13f3abd6b3a5a8d525924064dbd4a9022 /ui/vnc-enc-tight.c
parentfd2f659ee3f6f991f4f194f3fde5c9f957fd663d (diff)
Fix uint8_t comparisons with negative values
Fix the following warnings: /src/qemu/hw/ide/core.c: In function `ide_drive_pio_post_load': /src/qemu/hw/ide/core.c:2767: warning: comparison is always false due to limited range of data type /src/qemu/ui/vnc-enc-tight.c: In function `tight_detect_smooth_image': /src/qemu/ui/vnc-enc-tight.c:284: warning: comparison is always true due to limited range of data type /src/qemu/ui/vnc-enc-tight.c:297: warning: comparison is always true due to limited range of data type /src/qemu/ui/vnc-enc-tight.c: In function `tight_encode_indexed_rect16': /src/qemu/ui/vnc-enc-tight.c:456: warning: comparison is always false due to limited range of data type /src/qemu/ui/vnc-enc-tight.c: In function `tight_encode_indexed_rect32': /src/qemu/ui/vnc-enc-tight.c:457: warning: comparison is always false due to limited range of data type Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'ui/vnc-enc-tight.c')
-rw-r--r--ui/vnc-enc-tight.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index 86bb49a16f..71f3fa3d39 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -281,7 +281,7 @@ tight_detect_smooth_image(VncState *vs, int w, int h)
return 0;
}
- if (vs->tight.quality != -1) {
+ if (vs->tight.quality != (uint8_t)-1) {
if (w * h < VNC_TIGHT_JPEG_MIN_RECT_SIZE) {
return 0;
}
@@ -294,7 +294,7 @@ tight_detect_smooth_image(VncState *vs, int w, int h)
if (vs->clientds.pf.bytes_per_pixel == 4) {
if (vs->tight.pixel24) {
errors = tight_detect_smooth_image24(vs, w, h);
- if (vs->tight.quality != -1) {
+ if (vs->tight.quality != (uint8_t)-1) {
return (errors < tight_conf[quality].jpeg_threshold24);
}
return (errors < tight_conf[compression].gradient_threshold24);
@@ -443,7 +443,7 @@ static int tight_fill_palette(VncState *vs, int x, int y,
* Should never happen, but don't break everything \
* if it does, use the first color instead \
*/ \
- if (idx == -1) { \
+ if (idx == (uint8_t)-1) { \
idx = 0; \
} \
while (rep >= 0) { \