aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMatthew Kilgore <mattkilgore12@gmail.com>2019-10-03 23:53:37 -0400
committerGerd Hoffmann <kraxel@redhat.com>2019-10-18 10:39:12 +0200
commitcd54ea456dbb2c704e8eb88c8ef4d3316aec133b (patch)
treece32dc6f6846e00b16fe7b29d8a4a7caad225b0a /ui
parentdff742ad27efa474ec04accdbf422c9acfd3e30e (diff)
downloadqemu-cd54ea456dbb2c704e8eb88c8ef4d3316aec133b.zip
qemu-cd54ea456dbb2c704e8eb88c8ef4d3316aec133b.tar.gz
qemu-cd54ea456dbb2c704e8eb88c8ef4d3316aec133b.tar.bz2
curses: use the bit mask constants provided by curses
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>
Diffstat (limited to 'ui')
-rw-r--r--ui/curses.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/curses.c b/ui/curses.c
index ec28112..84003f5 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;