From patchwork Fri Oct 18 10:17:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11198139 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B77C17E1 for ; Fri, 18 Oct 2019 10:19:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4BAC22064B for ; Fri, 18 Oct 2019 10:19:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BAC22064B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLPLX-0007ID-Qx for patchwork-qemu-devel@patchwork.kernel.org; Fri, 18 Oct 2019 06:18:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53269) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLPJt-0005N6-4C for qemu-devel@nongnu.org; Fri, 18 Oct 2019 06:17:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLPJs-0002Vt-3g for qemu-devel@nongnu.org; Fri, 18 Oct 2019 06:17:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58922) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLPJr-0002V4-UI for qemu-devel@nongnu.org; Fri, 18 Oct 2019 06:17:16 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 19357307C656; Fri, 18 Oct 2019 10:17:15 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-43.ams2.redhat.com [10.36.116.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EBE81001B03; Fri, 18 Oct 2019 10:17:12 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3CA449D26; Fri, 18 Oct 2019 12:17:11 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 2/4] curses: use the bit mask constants provided by curses Date: Fri, 18 Oct 2019 12:17:09 +0200 Message-Id: <20191018101711.24105-3-kraxel@redhat.com> In-Reply-To: <20191018101711.24105-1-kraxel@redhat.com> References: <20191018101711.24105-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 18 Oct 2019 10:17:15 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Matthew Kilgore , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Matthew Kilgore 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 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Samuel Thibault Tested-by: Samuel Thibault Message-id: 20191004035338.25601-2-mattkilgore12@gmail.com Signed-off-by: Gerd Hoffmann --- 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;