From patchwork Wed Sep 9 09:46:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11765245 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 307AE92C for ; Wed, 9 Sep 2020 09:53:56 +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 E73F421D79 for ; Wed, 9 Sep 2020 09:53:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WmYvQCJj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E73F421D79 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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]:57872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFwnb-0000tR-12 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Sep 2020 05:53:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFwgo-0006Z5-Kp; Wed, 09 Sep 2020 05:46:54 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:42611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFwgm-0007fs-Sm; Wed, 09 Sep 2020 05:46:54 -0400 Received: by mail-pg1-x543.google.com with SMTP id m5so1668030pgj.9; Wed, 09 Sep 2020 02:46:52 -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=s4O1f6yoxMsnnDNuUCRmwCFjeJefj3nbZpXkl1R+kT0=; b=WmYvQCJjJknqB9ryBg6cUmmTxm2CTRJJ2zcW8fehdFKIaaeYt4R24aCAPdI40W8tga w5aEDs5p/Q9Swv1de2MM3H2YlefyOeOyROGkAw+FrSNsKh1ZiD4HOtwOHNja8yvAFTpf yeeFPc5bCcDafnr/mU4q594hY732hbtrzZwmIzZEZjSMSXaFybXz1Cs2TgKWuQcB3Adn WPM9MXC3b4q7dInfiawewRgK7f0JSRXW59ui07K0s5YR2CIUOex/EtSfC96DdYJvENWY iHHDncAdx9tcYyk+HnRL5cAuxPDWWHDgKHKMkhXSBj7KLPFh9ZF/TamoenChWf3IE3P9 dWwQ== 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=s4O1f6yoxMsnnDNuUCRmwCFjeJefj3nbZpXkl1R+kT0=; b=OIFFKOpw5HZYRs/j5by9UuC30cuSFKT0YWgVuLn1dG1thAvkE5qzrCVNgLC1cgUA58 drOR4eR5pDIgulcW59I9QD3bdOamHHCXLCfrsrWyo4BDwqh3Yt+B3/CNzq98oNw41Vmv Kro6pSSoq2UDwt60MGFHzZedQn3U3cVo1fvrMsmAcoWKNbN/7nF9UPpOpznBl6/5K1et 25XeAJsQUxYuo2SSzWck1gzQaCyMQK1CeeNAbTzUHGwoBC4Vt08k4g5qsh7faAzcyMUz FB5wbxp6U+4kPBy9vs2+OntGyu2zMtUn6kFpyJ6dM5SYejJAsx/toKFDBpCjGFk8klpU 06lw== X-Gm-Message-State: AOAM5307988cXyEkC9PBUSeiqXXg9RVMnorqBR3HhdhyR7tYgu/2RPmR eI3MFV3lL7ArDGDwdI6+7lBC5vWuEgK/X22s X-Google-Smtp-Source: ABdhPJxUMaMkSlfxP6+Ei5eMHskD8j2Y/CBkOG71TWLUilUCQYg/x0AZCunq9jIz4eRhgE6XyDaOtA== X-Received: by 2002:a62:7616:: with SMTP id r22mr116663pfc.48.1599644810807; Wed, 09 Sep 2020 02:46:50 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id 64sm1708312pgi.90.2020.09.09.02.46.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 02:46:49 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v2 04/21] curses: Fixes curses compiling errors. Date: Wed, 9 Sep 2020 17:46:00 +0800 Message-Id: <20200909094617.1582-5-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200909094617.1582-1-luoyonggang@gmail.com> References: <20200909094617.1582-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::543; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x543.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Peter Maydell , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This is the compiling error: ../ui/curses.c: In function 'curses_refresh': ../ui/curses.c:256:5: error: 'next_maybe_keycode' may be used uninitialized in this function [-Werror=maybe-uninitialized] 256 | curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keycode) | ^~~~~~~~~~ ../ui/curses.c:302:32: note: 'next_maybe_keycode' was declared here 302 | enum maybe_keycode next_maybe_keycode; | ^~~~~~~~~~~~~~~~~~ ../ui/curses.c:256:5: error: 'maybe_keycode' may be used uninitialized in this function [-Werror=maybe-uninitialized] 256 | curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keycode) | ^~~~~~~~~~ ../ui/curses.c:265:24: note: 'maybe_keycode' was declared here 265 | enum maybe_keycode maybe_keycode; | ^~~~~~~~~~~~~ cc1.exe: all warnings being treated as errors gcc version 10.2.0 (Rev1, Built by MSYS2 project) Signed-off-by: Yonggang Luo Reviewed-by: Peter Maydell Reviewed-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrangé --- ui/curses.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index 12bc682cf9..e4f9588c3e 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -262,7 +262,7 @@ static int curses2foo(const int _curses2foo[], const int _curseskey2foo[], static void curses_refresh(DisplayChangeListener *dcl) { int chr, keysym, keycode, keycode_alt; - enum maybe_keycode maybe_keycode; + enum maybe_keycode maybe_keycode = CURSES_KEYCODE; curses_winch_check(); @@ -299,7 +299,7 @@ static void curses_refresh(DisplayChangeListener *dcl) /* alt or esc key */ if (keycode == 1) { - enum maybe_keycode next_maybe_keycode; + enum maybe_keycode next_maybe_keycode = CURSES_KEYCODE; int nextchr = console_getch(&next_maybe_keycode); if (nextchr != -1) {