From nobody Tue Feb 10 22:17:44 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696592282; cv=none; d=zohomail.com; s=zohoarc; b=iF5u2o80HUz2425kkcXhelh5q7mLypmQAw3rjnkbQbE7fFXxgQgD7+EKBcQDbxfglo9gd5cMjFpaZ/4VS0us/HhrdRmRdzXdWPrQ+gd8TEppLYVG0gEp6lAaa0QjVE2aryIsZC5czhL6J57UoR2k2VmG3N++CYL+HbpJ6o3k8/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592282; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WeDsGMFtz4asvODucopxPE5YKxApxjds6GXhzdwffeM=; b=jZi0meDXXJtDx+MrefgXiU0STun3RzPx+uOXVCQv+oD3PYjkW758qO2OpG6WyZpZFljhlV9MPifzwA78Lqo6aM+SV2SHwKLOT9CjlswzLTKJDhCn7qAAaBcVbEzYg/P8t7NO/DoLzQpW8L4AoPhS26g5Bl+ZqhPIe2ajEs8dlxQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696592282954377.75965862967803; Fri, 6 Oct 2023 04:38:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj8x-00051J-5v; Fri, 06 Oct 2023 07:37:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8o-0004zE-6S for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8h-00006U-KA for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:08 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-342-vnqYtYC4OMm7mYa7zGU1_Q-1; Fri, 06 Oct 2023 07:37:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AC3AC1C06370; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8AEAB20268CB; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 71B2C21E6913; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WeDsGMFtz4asvODucopxPE5YKxApxjds6GXhzdwffeM=; b=IOIGS9hMfoKyzsS7YG/ImVP6gEUrckauKKwzOH2Q/v2e8pHq5pgrE2DrFpB9YKdE0c6RPA cDMPdHnRAILplv4SCzLrI9pHOEnFZ1nC7VDMJiNP7mmvg1jZF33S0K0DZG40da3lprEBw0 KQ5/Cw2BR/kiNkKLediWhANgXfLGpXE= X-MC-Unique: vnqYtYC4OMm7mYa7zGU1_Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Thomas Huth Subject: [PULL 10/32] hw/audio/soundhw: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:35 +0200 Message-ID: <20231006113657.3803180-11-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696592283570100001 From: Philippe Mathieu-Daud=C3=A9 Fix: hw/audio/soundhw.c:86:33: error: declaration shadows a variable in the gl= obal scope [-Werror,-Wshadow] void select_soundhw(const char *optarg, const char *audiodev) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-2-philmd@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- include/hw/audio/soundhw.h | 2 +- hw/audio/soundhw.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/audio/soundhw.h b/include/hw/audio/soundhw.h index 270717a06a..474c5ff94e 100644 --- a/include/hw/audio/soundhw.h +++ b/include/hw/audio/soundhw.h @@ -8,6 +8,6 @@ void deprecated_register_soundhw(const char *name, const ch= ar *descr, =20 void soundhw_init(void); void show_valid_soundhw(void); -void select_soundhw(const char *optarg, const char *audiodev); +void select_soundhw(const char *name, const char *audiodev); =20 #endif diff --git a/hw/audio/soundhw.c b/hw/audio/soundhw.c index 94d9463e42..b387b0ef7d 100644 --- a/hw/audio/soundhw.c +++ b/hw/audio/soundhw.c @@ -83,7 +83,7 @@ void show_valid_soundhw(void) static struct soundhw *selected =3D NULL; static const char *audiodev_id; =20 -void select_soundhw(const char *optarg, const char *audiodev) +void select_soundhw(const char *name, const char *audiodev) { struct soundhw *c; =20 @@ -92,7 +92,7 @@ void select_soundhw(const char *optarg, const char *audio= dev) } =20 for (c =3D soundhw; c->name; ++c) { - if (g_str_equal(c->name, optarg)) { + if (g_str_equal(c->name, name)) { selected =3D c; audiodev_id =3D audiodev; break; @@ -100,7 +100,7 @@ void select_soundhw(const char *optarg, const char *aud= iodev) } =20 if (!c->name) { - error_report("Unknown sound card name `%s'", optarg); + error_report("Unknown sound card name `%s'", name); show_valid_soundhw(); exit(1); } --=20 2.41.0