From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R25um-00075U-Kh for qemu-devel@nongnu.org; Fri, 09 Sep 2011 14:35:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R25uk-0002wS-Ok for qemu-devel@nongnu.org; Fri, 09 Sep 2011 14:35:00 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:34994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R25uk-0002rV-JZ for qemu-devel@nongnu.org; Fri, 09 Sep 2011 14:34:58 -0400 Received: by mail-gy0-f173.google.com with SMTP id 5so2169528gye.4 for ; Fri, 09 Sep 2011 11:34:58 -0700 (PDT) Message-ID: <4E6A5C50.1030909@codemonkey.ws> Date: Fri, 09 Sep 2011 13:34:56 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1315424676-11172-1-git-send-email-djpohly+launchpad@gmail.com> In-Reply-To: <1315424676-11172-1-git-send-email-djpohly+launchpad@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] curses: fix garbling when chtype != long List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Devin J. Pohly" Cc: qemu-devel@nongnu.org On 09/07/2011 02:44 PM, Devin J. Pohly wrote: > From: "Devin J. Pohly" > > Qemu currently assumes that chtype is typedef'd to unsigned long, but > this is not necessarily the case (ncurses, for instance, can configure > this at build-time). This patch uses the predefined chtype if qemu is > configured for curses support and falls back to unsigned long otherwise. > > Fixes bug 568614. > > Signed-off-by: Devin J. Pohly Applied. Thanks. Regards, Anthony Liguori > --- > console.c | 2 ++ > console.h | 5 +++++ > 2 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/console.c b/console.c > index 500b3fb..5c7a93b 100644 > --- a/console.c > +++ b/console.c > @@ -343,6 +343,7 @@ static const uint32_t dmask4[4] = { > > static uint32_t color_table[2][8]; > > +#ifndef CONFIG_CURSES > enum color_names { > COLOR_BLACK = 0, > COLOR_RED = 1, > @@ -353,6 +354,7 @@ enum color_names { > COLOR_CYAN = 6, > COLOR_WHITE = 7 > }; > +#endif > > static const uint32_t color_table_rgb[2][8] = { > { /* dark */ > diff --git a/console.h b/console.h > index 67d1373..9c1487e 100644 > --- a/console.h > +++ b/console.h > @@ -328,7 +328,12 @@ static inline int ds_get_bytes_per_pixel(DisplayState *ds) > return ds->surface->pf.bytes_per_pixel; > } > > +#ifdef CONFIG_CURSES > +#include > +typedef chtype console_ch_t; > +#else > typedef unsigned long console_ch_t; > +#endif > static inline void console_write_ch(console_ch_t *dest, uint32_t ch) > { > if (!(ch& 0xff))