aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/ide/core.c3
-rw-r--r--ui/vnc-enc-tight.c6
2 files changed, 4 insertions, 5 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index db000831e8..56aed935c9 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2764,8 +2764,7 @@ static int ide_drive_pio_post_load(void *opaque, int version_id)
{
IDEState *s = opaque;
- if (s->end_transfer_fn_idx < 0 ||
- s->end_transfer_fn_idx > ARRAY_SIZE(transfer_end_table)) {
+ if (s->end_transfer_fn_idx > ARRAY_SIZE(transfer_end_table)) {
return -EINVAL;
}
s->end_transfer_func = transfer_end_table[s->end_transfer_fn_idx];
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) { \