qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Matthew Kilgore <mattkilgore12@gmail.com>, qemu-devel@nongnu.org
Cc: samuel.thibault@ens-lyon.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH v2 1/2] curses: use the bit mask constants provided by curses
Date: Fri, 4 Oct 2019 10:57:14 +0200	[thread overview]
Message-ID: <56d01d33-c9ed-be85-cce8-3119961b2bf9@redhat.com> (raw)
In-Reply-To: <20191004035338.25601-2-mattkilgore12@gmail.com>

On 10/4/19 5:53 AM, Matthew Kilgore wrote:
> The curses API provides the A_ATTRIBUTES and A_CHARTEXT bit masks for
> getting the attributes and character parts of a chtype, respectively. We
> should use provided constants instead of using 0xff.
> 
> Signed-off-by: Matthew Kilgore <mattkilgore12@gmail.com>

Thanks for splitting your previous patch!

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>   ui/curses.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ui/curses.c b/ui/curses.c
> index ec281125acbd..84003f56a323 100644
> --- a/ui/curses.c
> +++ b/ui/curses.c
> @@ -75,8 +75,8 @@ static void curses_update(DisplayChangeListener *dcl,
>       line = screen + y * width;
>       for (h += y; y < h; y ++, line += width) {
>           for (x = 0; x < width; x++) {
> -            chtype ch = line[x] & 0xff;
> -            chtype at = line[x] & ~0xff;
> +            chtype ch = line[x] & A_CHARTEXT;
> +            chtype at = line[x] & A_ATTRIBUTES;
>               ret = getcchar(&vga_to_curses[ch], wch, &attrs, &colors, NULL);
>               if (ret == ERR || wch[0] == 0) {
>                   wch[0] = ch;
> 


  reply	other threads:[~2019-10-04  8:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04  3:53 [PATCH v2 0/2] curses: fix attribute passing Matthew Kilgore
2019-10-04  3:53 ` [PATCH v2 1/2] curses: use the bit mask constants provided by curses Matthew Kilgore
2019-10-04  8:57   ` Philippe Mathieu-Daudé [this message]
2019-10-13 15:34   ` Samuel Thibault
2019-10-04  3:53 ` [PATCH v2 2/2] curses: correctly pass the color pair to setcchar() Matthew Kilgore
2019-10-13 15:34   ` Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56d01d33-c9ed-be85-cce8-3119961b2bf9@redhat.com \
    --to=philmd@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=mattkilgore12@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=samuel.thibault@ens-lyon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).