From patchwork Fri Oct 6 11:36:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729981 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp455870wrp; Fri, 6 Oct 2023 04:38:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnTc/N60/E14VxihrgtyIG8Rkc95I+ft8tbTAh59pxH0JGs7+HXRyT3uymhBHx5DdxIw98 X-Received: by 2002:a67:fdd0:0:b0:454:2d1e:6ced with SMTP id l16-20020a67fdd0000000b004542d1e6cedmr8382693vsq.27.1696592282329; Fri, 06 Oct 2023 04:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592282; cv=none; d=google.com; s=arc-20160816; b=QzwxK3Tr4+wmn3iWwVkXv/3HNsOBGRUDm7Vt+bGKjN1soG5Hcy4+UzM6auEUl6ho17 BMAuT0HdtZGs4zD9ahIVN+j2sG7TUXHJ7nml9BmAOXqtem/sITkR6uoa4aUnQ+bVe0D6 3uT1PlRH48BpsGZTjyrJ1/7uASxgACPqqBp2fDJWi8bwyLSByKXc1L/s7zSSQmVOsJ6F leimNDyDEfpdT7TD+/aiVySVjyYuiH9qPInxJBHe0ppSufkFZfYN/oiWp7mll+HNXSZz Jb4mwnNEF8bfnKylbnb/8irabw6DDdEzIL4mW2mMDVTjxgq8gWS4g0gh1WkxIhj2DpF0 Adjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=WeDsGMFtz4asvODucopxPE5YKxApxjds6GXhzdwffeM=; fh=kWQoQsLK82AARKMfoe+qpmqOSQjjSZfWUhPHIg9yF+c=; b=hsGWg4Rnhm30XPGddjx5v+ezabdjoQy2mMTBcHqzH1OeT8+ACkGS2tvVvX3ju+y/Cv Ltl8xG+JNegBvhwnxdXJQ12N7ECmTQW18UDZXartLzmS3OfcdGrC6jizYfjRql9fVh7l vGPsD+EHdY3FQUxLbRJkZAJ5vKTJOSheybNSoCGxPNeVdHqjeUupl1LtfKYLGIVZB8Ne 0u9kFnlaX6LMzOcioCktVxZUfAk4rV/DqJr3Wh1AWMeyLOsmzbeOp7dGWTNfYiJe/qUg LeyAUsQrpEdEYEH1BO6uZ1iFsS67WSowJEH1ucpDJ00dNLZijnrRep8U62nrurkU1CUB TmNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IOIGS9hM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id tn4-20020a05620a3c0400b00773d6c99af2si2173173qkn.449.2023.10.06.04.38.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:38:02 -0700 (PDT) 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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IOIGS9hM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 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= 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 X-MC-Unique: vnqYtYC4OMm7mYa7zGU1_Q-1 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) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-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 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Fix: hw/audio/soundhw.c:86:33: error: declaration shadows a variable in the global 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é 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 char *descr, 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); #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 = NULL; static const char *audiodev_id; -void select_soundhw(const char *optarg, const char *audiodev) +void select_soundhw(const char *name, const char *audiodev) { struct soundhw *c; @@ -92,7 +92,7 @@ void select_soundhw(const char *optarg, const char *audiodev) } for (c = soundhw; c->name; ++c) { - if (g_str_equal(c->name, optarg)) { + if (g_str_equal(c->name, name)) { selected = c; audiodev_id = audiodev; break; @@ -100,7 +100,7 @@ void select_soundhw(const char *optarg, const char *audiodev) } if (!c->name) { - error_report("Unknown sound card name `%s'", optarg); + error_report("Unknown sound card name `%s'", name); show_valid_soundhw(); exit(1); }