]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
curses: use the bit mask constants provided by curses
authorMatthew Kilgore <mattkilgore12@gmail.com>
Fri, 4 Oct 2019 03:53:37 +0000 (23:53 -0400)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 18 Oct 2019 08:39:12 +0000 (10:39 +0200)
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>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Tested-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-id: 20191004035338.25601-2-mattkilgore12@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/curses.c

index ec281125acbdf28230d1808f68f2feaa24892aad..84003f56a323f6546e1e92e095dd40556ac49a5b 100644 (file)
@@ -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;