]> Git Repo - qemu.git/blobdiff - ui/vnc-enc-tight.c
Fix uint8_t comparisons with negative values
[qemu.git] / ui / vnc-enc-tight.c
index 86bb49a16f1db50dd066996d1c470391914b984c..71f3fa3d395cc573ae5377587bd9ad4424579c6f 100644 (file)
@@ -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) {                                          \
This page took 0.02449 seconds and 4 git commands to generate.