From patchwork Wed Jan 5 13:49:36 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: 530138 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp296458imp; Wed, 5 Jan 2022 05:52:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDtFoJsv+HtrRaDulb7JDw73oFgMODrkK6KbhjNCrSDeDIXHNjBrluP6vsBEgGgKqNqCjd X-Received: by 2002:a05:6902:134f:: with SMTP id g15mr17222451ybu.534.1641390765179; Wed, 05 Jan 2022 05:52:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641390765; cv=none; d=google.com; s=arc-20160816; b=FuZMOT4dpHToJK0tAX6IvhJ+gdagre1QHHlf31QP4pJ2rJ/+E1lb9wTuBOQAJLn1DV l0qteZv3KqW7lkfyj28ER04EEYUtUOwJTcNM44At3lujWqnCBsEiH554poKCC2/+ABOt 12dxisZ6SlUOEbOwtGXokQU2JkwyLCkXrNsbSAZhq1AJ+3h6/6CIkRGOy8U9NWGCmxsX gOXqsM1XhO7xp82AvCmCWTzpoZsg39nexRmv0CI0VXrI8mNsIjKrKw/NFmV8Lo5TSOkj G4v3Y8nRnvdhP6cVQh/ok8xGO3wjjJdF7pDQnvC3Dyn9vHwa3aSnMh7kHgaiyA72GAaH QgTw== 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=bD0oDY1HtICxlXxcowAdM7TsTzK/YruAnbX2dCOOobA=; b=ULtBRqrU9GZMLb1/tlsr37ULot6idSp04zLtL4h/zSQd28Q7BjIQynkF4kKwJqegTK 6MJeludoE6dHJU4OhRNQ6xHkwNGDL1HGQPRxG1BAOZlo9j0BAtPq/9k5v3kRGNlmud+B dKMHMCa412NyO6F4/gmp7folpkLOvg2HFJWLgD6lWiEZyzd3aDxfN5pO5R36+VhN//iE c436iJn2TgmmmXaYWvf/cPazhDnh8UxZBwZMpylr0kzh56ZLfr2uquxOWpsh1VRBQt6+ Mz3cTkaCiO0feFBm9Xn9/38EwGr5xfxI9Jhet/Yj7PAYU4TjImB14CaVU92uwnBd2V1n Px3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="sYVMpR/e"; 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 83si11518644ybc.633.2022.01.05.05.52.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Jan 2022 05:52:45 -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="sYVMpR/e"; 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]:43122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n56ia-0008Bj-Ii for patch@linaro.org; Wed, 05 Jan 2022 08:52:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n56gN-00088a-60 for qemu-devel@nongnu.org; Wed, 05 Jan 2022 08:50:27 -0500 Received: from [2a00:1450:4864:20::52b] (port=43645 helo=mail-ed1-x52b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n56gC-0004Be-Bb for qemu-devel@nongnu.org; Wed, 05 Jan 2022 08:50:21 -0500 Received: by mail-ed1-x52b.google.com with SMTP id z9so92343806edm.10 for ; Wed, 05 Jan 2022 05:50:15 -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=bD0oDY1HtICxlXxcowAdM7TsTzK/YruAnbX2dCOOobA=; b=sYVMpR/eD8cqP7I/e81dWfevm/vRdkcciL2z86aHTOgK9mbbmrIt7nt/w1/GDAgN2+ iAsD3pqSlIIEcmafUVET0c9MPv5FOKg+Dawnr+Xi9U0t9G4FrcDWy81hqQbfo41xybnI vfTtFtFDry38KdInoySNvBfk+D62nn/6faEmET+GVWJgboW0J7X4zvuuoNtMDyBzfMHm 9NzGPtuvQGHVQf58Ej3bBZfs8Aa84NPcw7LAzZWJXrsxfvu+NzTemesSbAgZPqd8QXcA CBoRfUFaKfrovr+3BiaM+yQXliRbURDXaktFwEugwqNCpy5ZavhdtP6dtb12n/a7KYdX 900Q== 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=bD0oDY1HtICxlXxcowAdM7TsTzK/YruAnbX2dCOOobA=; b=kj+Zy1SkJjnKEOrvYrGhn5GbkQ2KJpu5ASG+aKxvkUbTrFL2aS4EcSL285PHdy2PKp pQeiR/MDri/sDBXr8wAKB/MjJ9OXem/RtcFYLXQfAC7nKn6frizLOyncNEUfssTrq6K7 6sjLxP1X/OZ7/W/GpsmZqL04kh7DRUcHIigj7YmRqqUvHM+da9alW00+ntWmKQT4QGPU nRMpT/jHAtBfFnblIJlDKFxYv1HtDYNdI2lm+EIhpsW9j2obj/u3foOkJnz5jI0RIZJP kfsRFFS1e4pBF85PLP9xczg4uMl4dIb8RECubacx4+/8uVVI3pbZoI+Q79/XbbHLbRv1 1VAg== X-Gm-Message-State: AOAM5301eKvncAIHNVBWkLjO1iQoXPzYhQNZqYdrftBWHYpv96aBU71N zfsqEkh6lSiHXRfiWhFHI5IddQ== X-Received: by 2002:a17:906:85ce:: with SMTP id i14mr41592984ejy.416.1641390614526; Wed, 05 Jan 2022 05:50:14 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h11sm9956072edb.59.2022.01.05.05.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 05:50:10 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 39DD41FFB8; Wed, 5 Jan 2022 13:50:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 01/34] ui: avoid compiler warnings from unused clipboard info variable Date: Wed, 5 Jan 2022 13:49:36 +0000 Message-Id: <20220105135009.1584676-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220105135009.1584676-1-alex.bennee@linaro.org> References: <20220105135009.1584676-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52b (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52b.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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , f4bug@amsat.org, Gerd Hoffmann , stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , aurelien@aurel32.net 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> --- ui/clipboard.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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); }