pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/44680: Extra else in emulators/qemu/patches/patch-ej



>Number:         44680
>Category:       pkg
>Synopsis:       Extra else in emulators/qemu/patches/patch-ej
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 04 10:30:00 +0000 2011
>Originator:     Alexander Nasonov
>Release:        Linux
>Organization:
NA
>Environment:
Linux xxx 2.6.18-128.el5 #1 SMP Wed Jan 21 10:41:14 EST 2009 x86_64 x86_64 
x86_64 GNU/Linux

>Description:
This block in patch-ej doesn't look right:

@@ -1500,6 +1502,8 @@
             ret = send_jpeg_rect(vs, x, y, w, h, quality);
         } else {
             ret = send_palette_rect(vs, x, y, w, h, palette);
+        } else {
+           ret = 0;
         }
     }

Attached is a new version of patch-ej with this block removed. qemu builds fine 
after the change.
>How-To-Repeat:
cd emulators/qemu && bmake package
..

ui/vnc-enc-tight.c: In function 'send_sub_rect_jpeg':
ui/vnc-enc-tight.c:1506: error: expected '}' before 'else'
ui/vnc-enc-tight.c:1509: warning: no return statement in function returning 
non-void
ui/vnc-enc-tight.c: At top level:
ui/vnc-enc-tight.c:1510: error: expected identifier or '(' before 'return'
ui/vnc-enc-tight.c:1511: error: expected identifier or '(' before '}' token
make: *** [ui/vnc-enc-tight.o] Error 1
..
>Fix:
$ cvs diff -u distinfo
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/emulators/qemu/distinfo,v
retrieving revision 1.63
diff -u -u -r1.63 distinfo
--- distinfo    27 Dec 2010 12:33:32 -0000      1.63
+++ distinfo    4 Mar 2011 10:20:40 -0000
@@ -14,7 +14,7 @@
 SHA1 (patch-eg) = f511730d3b5640f10973d70b891e28bf140beb3c
 SHA1 (patch-eh) = 008c648dd74b273bd920521f7e01da5928c7c775
 SHA1 (patch-ei) = aee213dc347808f7aabedd7a8ce9f9477b12b9f0
-SHA1 (patch-ej) = 2276235ac35ebe7ab29eac45c087ad55cd0a726b
+SHA1 (patch-ej) = bca3d2e54758c86c85ee79eec04bd206fa6ec43c
 SHA1 (patch-ek) = a4bfeb9887c5caddaf660fecaaa59f7468eec2ed
 SHA1 (patch-el) = c8ab982a32e2c47deba9bd8a5b574d83fb80234d
 SHA1 (patch-em) = 4993ef668321e38ce63014494cb2ddb447637eb8

$ cat patches/patch-ej
$NetBSD: patch-ej,v 1.2 2010/12/27 12:33:32 adam Exp $

1) bswap_NN() variants are not available in CONFIG_MACHINE_BSWAP_H case
   (fixed in upstream master but not in stable-0.13 branch)
http://git.qemu.org/qemu.git/commit/?id=ba5e7f82169f32ab8163c707d97c799ca09f8924

2) don't use -1 against uint8_t
   (fixed in upstream master but not in stable-0.13 branch)
http://git.qemu.org/qemu.git/commit/?id=7bccf57383cca60a778d5c543ac80c9f62d89ef2
http://git.qemu.org/qemu.git/commit/?id=aee474ebc62686ae8827747b0b1aed85b8122979

3) fix uninitialized warning
   (fixed in upstream master but not in stable-0.13 branch)
http://git.qemu.org/qemu.git/commit/?id=d167f9bc06a577d6c85b8ed6991c1efe175aae7d
http://git.qemu.org/qemu.git/commit/?id=ad7ee4ad6c3a5388acf94dd532d291ea6d3a5972

--- ui/vnc-enc-tight.c.orig     2010-10-15 20:56:09.000000000 +0000
+++ ui/vnc-enc-tight.c
@@ -35,6 +35,7 @@
 #include <stdio.h>
 #include <jpeglib.h>
 #endif
+#include <sys/types.h>
 
 #include "qemu-common.h"
 
@@ -209,7 +210,7 @@ tight_detect_smooth_image24(VncState *vs
                      d < w - x - VNC_TIGHT_DETECT_SUBROW_WIDTH; d++) {  \
                 pix = ((uint##bpp##_t *)buf)[(y+d)*w+x+d];              \
                 if (endian) {                                           \
-                    pix = bswap_##bpp(pix);                             \
+                    pix = bswap##bpp(pix);                              \
                 }                                                       \
                 for (c = 0; c < 3; c++) {                               \
                     left[c] = (int)(pix >> shift[c] & max[c]);          \
@@ -218,7 +219,7 @@ tight_detect_smooth_image24(VncState *vs
                      dx++) {                                            \
                     pix = ((uint##bpp##_t *)buf)[(y+d)*w+x+d+dx];       \
                     if (endian) {                                       \
-                        pix = bswap_##bpp(pix);                         \
+                        pix = bswap##bpp(pix);                          \
                     }                                                   \
                     sum = 0;                                            \
                     for (c = 0; c < 3; c++) {                           \
@@ -281,7 +282,7 @@ tight_detect_smooth_image(VncState *vs, 
         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 +295,7 @@ tight_detect_smooth_image(VncState *vs, 
     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 +444,7 @@ static int tight_fill_palette(VncState *
              * 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) {                                          \
@@ -608,7 +609,7 @@ tight_filter_gradient24(VncState *vs, ui
             for (x = 0; x < w; x++) {                                   \
                 pix = *buf;                                             \
                 if (endian) {                                           \
-                    pix = bswap_##bpp(pix);                             \
+                    pix = bswap##bpp(pix);                              \
                 }                                                       \
                 diff = 0;                                               \
                 for (c = 0; c < 3; c++) {                               \
@@ -628,7 +629,7 @@ tight_filter_gradient24(VncState *vs, ui
                         << shift[c];                                    \
                 }                                                       \
                 if (endian) {                                           \
-                    diff = bswap_##bpp(diff);                           \
+                    diff = bswap##bpp(diff);                           \
                 }                                                       \
                 *buf++ = diff;                                          \
             }                                                           \
@@ -1469,6 +1470,8 @@ static int send_sub_rect_nojpeg(VncState
         ret = send_mono_rect(vs, x, y, w, h, bg, fg);
     } else if (colors <= 256) {
         ret = send_palette_rect(vs, x, y, w, h, palette);
+    } else {
+        ret = 0;
     }
     return ret;
 }
@@ -1522,7 +1525,7 @@ static int send_sub_rect(VncState *vs, i
     colors = tight_fill_palette(vs, x, y, w * h, &fg, &bg, &palette);
 
 #ifdef CONFIG_VNC_JPEG
-    if (vs->tight.quality != -1) {
+    if (vs->tight.quality != (uint8_t)-1) {
         ret = send_sub_rect_jpeg(vs, x, y, w, h, bg, fg, colors, palette);
     } else {
         ret = send_sub_rect_nojpeg(vs, x, y, w, h, bg, fg, colors, palette);


Home | Main Index | Thread Index | Old Index