From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2Qz3FEkHYGnNITMAWB0awg (envelope-from ) for ; Thu, 08 Jan 2026 14:36:41 -0500 Received: by simark.ca (Postfix, from userid 112) id 52DF41E08D; Thu, 08 Jan 2026 14:36:41 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D946C1E08D for ; Thu, 08 Jan 2026 14:36:40 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 802114BA2E21 for ; Thu, 8 Jan 2026 19:36:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 802114BA2E21 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id D57AE4BA2E21 for ; Thu, 8 Jan 2026 19:35:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D57AE4BA2E21 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D57AE4BA2E21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767900911; cv=none; b=iNJRmYKiHBuFbCpCUJDByten+lWE+hk9jjr57NTm5z85bCJz9rzDPGnPww9FWYJEkKa64hnad4tUEdCi/V7OMELU8OqgWeI6Mf/HWxhcv/1H45cFk9GM28Zn+V7zjSMQa6GQKGxXXc0BNApoLQyBRw+udz8XZfvWaODHEQrBRy8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767900911; c=relaxed/simple; bh=1UrsxxPYLUXzX3zRAk1vndWN9tFPUH/ydx3ztjrw70I=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=p5tA76I8VLV2gEiT7Opze+UMfTwb7rVLP01UF84P/XLoxdhfkOjCOpCVsaKJKCw2sUapOaxAousK0kEOwddFkgajVkOX/RHe/tqIJPXUMiqm20tpEpE86o0if1yBifMcbKUHuamIaCD41cZprvvUiZst+5rNJKBMDH55U8BOD1s= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D57AE4BA2E21 Received: by simark.ca (Postfix) id 865181E0C5; Thu, 08 Jan 2026 14:35:09 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 7/8] gdb/xcoffread: replace 2 switches with if Date: Thu, 8 Jan 2026 14:33:25 -0500 Message-ID: <20260108193507.553779-8-simon.marchi@efficios.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260108193507.553779-1-simon.marchi@efficios.com> References: <20260108193507.553779-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Replace these 2 switches that have only one case with a single if statement. It is highly unlikely that we'll ever need to check for other values. Change-Id: I6a48d4f27ba4d1d128aaa39d5f3d693a11e99fc9 --- gdb/xcoffread.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 5494bb0debbb..5ec7281b683b 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -188,24 +188,18 @@ scan_xcoff_symtab (struct objfile *objfile) else csect_aux = main_aux[0]; - switch (csect_aux.x_csect.x_smtyp & 0x7) + if ((csect_aux.x_csect.x_smtyp & 0x7) == XTY_SD + && csect_aux.x_csect.x_smclas == XMC_TC0) { - case XTY_SD: - switch (csect_aux.x_csect.x_smclas) - { - case XMC_TC0: - if (toc_offset) - warning (_("More than one XMC_TC0 symbol found.")); - toc_offset = symbol.n_value; + if (toc_offset) + warning (_("More than one XMC_TC0 symbol found.")); + toc_offset = symbol.n_value; - /* Make TOC offset relative to start address of - section. */ - asection *bfd_sect - = xcoff_secnum_to_section (symbol.n_scnum, objfile); - if (bfd_sect) - toc_offset -= bfd_section_vma (bfd_sect); - break; - } + /* Make TOC offset relative to start address of section. */ + asection *bfd_sect + = xcoff_secnum_to_section (symbol.n_scnum, objfile); + if (bfd_sect) + toc_offset -= bfd_section_vma (bfd_sect); break; } } -- 2.52.0