From patchwork Wed Jan 12 11:26:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 531564 Delivered-To: patch@linaro.org Received: by 2002:a5d:4010:0:0:0:0:0 with SMTP id n16csp1487344wrp; Wed, 12 Jan 2022 03:36:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzEleJcJS1de1b+fqy3sKCoZtTEsVcBd4RtVQCqCqlxPqam040e/aanyLK2qnRPdNPwCHt X-Received: by 2002:a25:f206:: with SMTP id i6mr6202630ybe.750.1641987414082; Wed, 12 Jan 2022 03:36:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641987414; cv=none; d=google.com; s=arc-20160816; b=DJ7zDpn9/OLAuj0EeCLY/z6T8M8hLQllofyNNpl/RP540AfACxifxn0X9agWbIXfMp K9arlvmGO/zp9+5IT1k9Dz9yADBrPCn8ZxRoo920wVgYsX1sxi98jeEzWHI0aWxWlrGF 4SdFFI0ODvWEnwzBDGdO3rupXnGRV4rOyKmTea4OSaflQbv+EpVLaQRSMbsWIc/84bCf 4uDM53DN/YXKi2igvv+Bmk/UGBNk/LuylfIPryR9ImPNR+gFSmNWy8pogBU6lM+aIBHN xoA5+PW6eLYaBRYmfX9TBJASO8aOTV2CiuXch3We1Kxa74YgOX96u76/WvPWY5kmSyxk dkhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=RloSuI0Jr/ZxHwMFrsFKsR8b4g1vVCA7iOPpJ0mZCiw=; b=dYbvR4v/I1BsSaNjA8SWZlPkYjk4PWZgCC6WUBYDnSa6JxKImDU1wrsm2QocXCjyKm GzhpxOqO/uBQUnOtML7vLA6lZCbfOQJxjii6SzdgFUYKFenNL+dVgs+50xav6LLBvJuv lyVnt7+rjElnYPhlJGdfP9+Mg0iViz/IfImWUnUDg7nlmIXNKiwOM+aUEbIIgrrkAj56 IkWAXGzbN4YKP1QwJiIW+QQzexx9YB/alMHfOWc5l1IzRc51ruiXOYBNrE7aCy2Nen6U StVu93PT9F+ch5eA+PuBdsdZWV6tqLPZbHsaOWw8KoZIaaQikm++fQgEv/3yde9dhB8b t6Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KhBSd0N4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l7si12281644ybt.466.2022.01.12.03.36.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Jan 2022 03:36:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KhBSd0N4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7bvx-00061Y-HJ for patch@linaro.org; Wed, 12 Jan 2022 06:36:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7bmu-0002cE-GS for qemu-devel@nongnu.org; Wed, 12 Jan 2022 06:27:32 -0500 Received: from [2607:f8b0:4864:20::930] (port=36515 helo=mail-ua1-x930.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n7bms-0003Nf-D8 for qemu-devel@nongnu.org; Wed, 12 Jan 2022 06:27:32 -0500 Received: by mail-ua1-x930.google.com with SMTP id r15so4128240uao.3 for ; Wed, 12 Jan 2022 03:27:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RloSuI0Jr/ZxHwMFrsFKsR8b4g1vVCA7iOPpJ0mZCiw=; b=KhBSd0N4aei+wy1/WgWm3lHY+Plhcuzuw4HVg9dP1XbcaYsHJaW76vEYudKjlze9ZQ YJQ3hUdTGzuwUVGpPXH0X0xkE0l7zDOqxrnfuK9Fa3S7PIqOVT63SIXEk+JEF3xYmKq1 m1nKaX3FyFnlhmbbeqAsgpnJGSQyLXzhZU293y5f9r6BfLvJgqwqKozUJRJ5PG4JaXwr c/2q3pai0UnF8sqZ+N9S/GzLPPrqj3vl6DZ8tNGeVWAFHFLfyaWRx+FVBRy1dCdK8x9v ChZnhmhJ8IeXf9rTNyxCT5tLWnl7/4Sz6QB9kJ3cWe3fj0ZsLDagq34xxMkLrqJLec4P wCQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RloSuI0Jr/ZxHwMFrsFKsR8b4g1vVCA7iOPpJ0mZCiw=; b=zm0/ekjea2j8GmsjzGyN/50Xm3mteFvUPufdDEiXi1PGlu1wne+9JwYm7fr6MMLo2C XltYy8vWVzDmEgEu0c1n3UEFHeHQPHPv5Eyz/LhspgR2OorgxiXxYxdwGIeRCtDH+RpN aAR/kTGu042votCNaKgIIrsEHIhlAGSE9vMHppgdqNv88tgQkejwK5UmU8ugLHRYmjbf obxeYr/gO+EeJNgVpZAzXbTMI9zdjQJhge1dDwDtyegH4uxACxs62mjQLWtpGpuTRhdp aOb+WWplhVOrKtoDNKHeBcXnDWONgUTTptPLMKEQXv9JJlUIGe8Pq5LZ5Vs79qWWCxij e8DQ== X-Gm-Message-State: AOAM533a7WTv2THyEDwgovuwTxLyfC+y4G0Ltx89bAD6cdI3JFHpm49H O4hVkEjF1Bkume07fFrV7u0DRg== X-Received: by 2002:a05:6102:ac3:: with SMTP id m3mr3977069vsh.1.1641986849536; Wed, 12 Jan 2022 03:27:29 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f1sm7063861uae.5.2022.01.12.03.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 03:27:24 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5F5891FFB8; Wed, 12 Jan 2022 11:27:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 01/31] ui: avoid compiler warnings from unused clipboard info variable Date: Wed, 12 Jan 2022 11:26:52 +0000 Message-Id: <20220112112722.3641051-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220112112722.3641051-1-alex.bennee@linaro.org> References: <20220112112722.3641051-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::930 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::930; envelope-from=alex.bennee@linaro.org; helo=mail-ua1-x930.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , Richard Henderson , qemu-devel@nongnu.org, Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Daniel P. Berrangé With latest clang 13.0.0 we get ../ui/clipboard.c:47:34: error: variable 'old' set but not used [-Werror,-Wunused-but-set-variable] g_autoptr(QemuClipboardInfo) old = NULL; ^ The compiler can't tell that we only declared this variable in order to get the side effect of free'ing it when out of scope. This pattern is a little dubious for a use of g_autoptr, so rewrite the code to avoid it. Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Daniel P. Berrangé [AJB: fix merge conflict] Signed-off-by: Alex Bennée Message-Id: <20211215141949.3512719-2-berrange@redhat.com> Message-Id: <20220105135009.1584676-2-alex.bennee@linaro.org> diff --git a/ui/clipboard.c b/ui/clipboard.c index 82572ea116..5f15cf853d 100644 --- a/ui/clipboard.c +++ b/ui/clipboard.c @@ -62,13 +62,11 @@ void qemu_clipboard_update(QemuClipboardInfo *info) .type = QEMU_CLIPBOARD_UPDATE_INFO, .info = info, }; - g_autoptr(QemuClipboardInfo) old = NULL; - assert(info->selection < QEMU_CLIPBOARD_SELECTION__COUNT); notifier_list_notify(&clipboard_notifiers, ¬ify); - old = cbinfo[info->selection]; + qemu_clipboard_info_unref(cbinfo[info->selection]); cbinfo[info->selection] = qemu_clipboard_info_ref(info); }