From nobody Wed Nov 12 11:51:19 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1570161335; cv=none; d=zoho.com; s=zohoarc; b=ioRWRdoHZKqztqvbJ5Unqr0XvWhTk3Y9azIq5JzIZ8gGxgcnNhahlHvypNlEAZ4wy4H/R/I1ayoZYorg+YJANbkOL+zCimcpBld9kexc+SqQ5EOOgJN6//Ul01jrfhB8PrvArSsWB2VsT0/y5Lz9vSoEyMq4xKibPYoJ/U+Uk14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570161335; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=DRplJ7s5wS8wWAiJ0s8iSyGbDczl1bzm8yyvKstkRwM=; b=gJfFdy4wpyswfG/bIdoLbY1EkEq1oj95l2fxsejmH6y5MGn82nTlLdU4/sQJlxynbAdxDGb0jKBEMUMk5JhHU99R5qtjCY53ZC0TVzJEjZVMFcn2SBFnlomNQo7vP7dpyYN8VLEoCDeicvXu3e75R6iVz2ZRK3uuXLoQ3IuBLlM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1570161335885926.1560255664092; Thu, 3 Oct 2019 20:55:35 -0700 (PDT) Received: from localhost ([::1]:42046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGEgg-00018S-KA for importer@patchew.org; Thu, 03 Oct 2019 23:55:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53146) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGEfN-0000DN-A8 for qemu-devel@nongnu.org; Thu, 03 Oct 2019 23:54:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iGEfM-0005cm-Am for qemu-devel@nongnu.org; Thu, 03 Oct 2019 23:54:05 -0400 Received: from mail-io1-xd44.google.com ([2607:f8b0:4864:20::d44]:45993) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iGEfM-0005bs-5S for qemu-devel@nongnu.org; Thu, 03 Oct 2019 23:54:04 -0400 Received: by mail-io1-xd44.google.com with SMTP id c25so10483332iot.12 for ; Thu, 03 Oct 2019 20:54:04 -0700 (PDT) Received: from matt-laptop3.localdomain (d118-75-38-58.col.wideopenwest.com. [75.118.58.38]) by smtp.gmail.com with ESMTPSA id n17sm1570274ioj.73.2019.10.03.20.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2019 20:54:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DRplJ7s5wS8wWAiJ0s8iSyGbDczl1bzm8yyvKstkRwM=; b=WBGKMJ5+R5bTQYTON78PqI+80rbTZksQCK7GvyyE9s6XwrbJ1y8JlXiTkzoWAW15IT ZgOStmyoVQNr/LAmfzyrgOseEW05bnXWiSu99ZTWvVFCEjdSOHPpVNVZ3Hvsa4Nbjorb UmauygC1Xf8SBY29BNMcfbSAGVbzJldP955lbn8xCA+Lf9XyyDIaKcHDJWBbZfpa8cZB kUlfrgMiRicHd6cqRhptWq5Z9cGFCCR58C35dYTJpsuuWkjlkuktnqBTckg9UOedmQVQ hWCVtZawY+dXvvykqTn2gONdyiktHnh9AOQp4XiPfuoaZfKhD4WBqORdmIx5b3+cH3Yw gywQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DRplJ7s5wS8wWAiJ0s8iSyGbDczl1bzm8yyvKstkRwM=; b=il78UVqFjfAePczRQfScSlwY+aCfiLcSh6tJEET/wMjphskN05tfO6ehAHH8ADYyWT cDJfKptAZSD9B+/YdZKKtAvrQm5XHqiKrQVkZwaSoNuNPjvLd2+XTfi1awUDsxB789rs Ov9zGLtkslGAvOzT1HevbOzL4oVWVj5LK26a4AynfYsZGkHj7WYSpE/eVd/Tru3+02sQ ThvbivRwVx1QO81E5rxAXhnPvmD60Th+UtSnWFk67+Xt9j7lbdRfLhdQFDgXKh3hBP9B hwZtho4U4iSBHuLALiRLU4mcDuxW5NWmdN5C8vTXocq1JUWW1RS/o6cUeY6tPNhDuH3H U5oA== X-Gm-Message-State: APjAAAUbgrrGT5UK5V/eSTYP1XvChUjRZVJw4cRulUAiLggVYW9O/VqU h086dV/Z4JMYIXQQYnLpSYUe63yh X-Google-Smtp-Source: APXvYqzWmnAn93FQyCdk8ZKB9fDfmc/k2GvS+BnHJDPMDAXIjNee8vW06LdAWKSNqwhm5pwzb4tpUw== X-Received: by 2002:a92:5fd7:: with SMTP id i84mr13149817ill.125.1570161243222; Thu, 03 Oct 2019 20:54:03 -0700 (PDT) From: Matthew Kilgore To: qemu-devel@nongnu.org Subject: [PATCH v2 1/2] curses: use the bit mask constants provided by curses Date: Thu, 3 Oct 2019 23:53:37 -0400 Message-Id: <20191004035338.25601-2-mattkilgore12@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191004035338.25601-1-mattkilgore12@gmail.com> References: <20191004035338.25601-1-mattkilgore12@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d44 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: samuel.thibault@ens-lyon.org, Matthew Kilgore , philmd@redhat.com, Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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=C3=A9 Reviewed-by: Samuel Thibault Tested-by: Samuel Thibault --- 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 =3D screen + y * width; for (h +=3D y; y < h; y ++, line +=3D width) { for (x =3D 0; x < width; x++) { - chtype ch =3D line[x] & 0xff; - chtype at =3D line[x] & ~0xff; + chtype ch =3D line[x] & A_CHARTEXT; + chtype at =3D line[x] & A_ATTRIBUTES; ret =3D getcchar(&vga_to_curses[ch], wch, &attrs, &colors, NUL= L); if (ret =3D=3D ERR || wch[0] =3D=3D 0) { wch[0] =3D ch; --=20 2.23.0