Patchwork ui/vnc-enc-tight.c: Fix compile failure if CONFIG_VNC_JPEG not defined

login
register
mail settings
Submitter Peter Maydell
Date Feb. 24, 2011, 4:04 p.m.
Message ID <1298563462-22271-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/84408/
State New
Headers show

Comments

Peter Maydell - Feb. 24, 2011, 4:04 p.m.
Add some missing #ifdefs to fix compilation failures in the !CONFIG_VNC_JPEG
case introduced by commit ce702e93.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 ui/vnc-enc-tight.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Corentin Chary - Feb. 24, 2011, 4:27 p.m.
On Thu, Feb 24, 2011 at 4:04 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> Add some missing #ifdefs to fix compilation failures in the !CONFIG_VNC_JPEG
> case introduced by commit ce702e93.

Ooops.

Acked-By: Corentin Chary <corentin.chary@gmail.com>
Anthony Liguori - Feb. 24, 2011, 6:11 p.m.
On 02/24/2011 10:04 AM, Peter Maydell wrote:
> Add some missing #ifdefs to fix compilation failures in the !CONFIG_VNC_JPEG
> case introduced by commit ce702e93.
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
>    

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   ui/vnc-enc-tight.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
> index 5933394..2522936 100644
> --- a/ui/vnc-enc-tight.c
> +++ b/ui/vnc-enc-tight.c
> @@ -1536,8 +1536,10 @@ static int send_sub_rect(VncState *vs, int x, int y, int w, int h)
>       uint32_t bg = 0, fg = 0;
>       int colors;
>       int ret = 0;
> +#ifdef CONFIG_VNC_JPEG
>       bool force_jpeg = false;
>       bool allow_jpeg = true;
> +#endif
>
>       vnc_framebuffer_update(vs, x, y, w, h, vs->tight.type);
>
> @@ -1711,6 +1713,7 @@ static int tight_send_framebuffer_update(VncState *vs, int x, int y,
>           vs->tight.pixel24 = false;
>       }
>
> +#ifdef CONFIG_VNC_JPEG
>       if (vs->tight.quality != (uint8_t)-1) {
>           double freq = vnc_update_freq(vs, x, y, w, h);
>
> @@ -1718,6 +1721,7 @@ static int tight_send_framebuffer_update(VncState *vs, int x, int y,
>               return send_rect_simple(vs, x, y, w, h, false);
>           }
>       }
> +#endif
>
>       if (w * h<  VNC_TIGHT_MIN_SPLIT_RECT_SIZE) {
>           return send_rect_simple(vs, x, y, w, h, true);
>

Patch

diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index 5933394..2522936 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -1536,8 +1536,10 @@  static int send_sub_rect(VncState *vs, int x, int y, int w, int h)
     uint32_t bg = 0, fg = 0;
     int colors;
     int ret = 0;
+#ifdef CONFIG_VNC_JPEG
     bool force_jpeg = false;
     bool allow_jpeg = true;
+#endif
 
     vnc_framebuffer_update(vs, x, y, w, h, vs->tight.type);
 
@@ -1711,6 +1713,7 @@  static int tight_send_framebuffer_update(VncState *vs, int x, int y,
         vs->tight.pixel24 = false;
     }
 
+#ifdef CONFIG_VNC_JPEG
     if (vs->tight.quality != (uint8_t)-1) {
         double freq = vnc_update_freq(vs, x, y, w, h);
 
@@ -1718,6 +1721,7 @@  static int tight_send_framebuffer_update(VncState *vs, int x, int y,
             return send_rect_simple(vs, x, y, w, h, false);
         }
     }
+#endif
 
     if (w * h < VNC_TIGHT_MIN_SPLIT_RECT_SIZE) {
         return send_rect_simple(vs, x, y, w, h, true);