From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id D9F253857815 for ; Mon, 31 Jan 2022 17:23:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D9F253857815 X-ASG-Debug-ID: 1643649794-0c856e06ab2b7d20001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id GGiGyKih317jWyan (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 31 Jan 2022 12:23:14 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by smtp.ebox.ca (Postfix) with ESMTP id 9CE63441B21; Mon, 31 Jan 2022 12:23:14 -0500 (EST) From: Simon Marchi X-Barracuda-RBL-IP: 192.222.157.6 X-Barracuda-Effective-Source-IP: 192-222-157-6.qc.cable.ebox.net[192.222.157.6] X-Barracuda-Apparent-Source-IP: 192.222.157.6 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [pushed] gdb: fix some clang-tidy readability-misleading-indentation warnings Date: Mon, 31 Jan 2022 12:23:14 -0500 X-ASG-Orig-Subj: [pushed] gdb: fix some clang-tidy readability-misleading-indentation warnings Message-Id: <20220131172314.2802733-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1643649794 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 4556 X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.95702 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Spam-Status: No, score=-3613.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_QUARANTINE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2022 17:23:28 -0000 From: Simon Marchi I have warnings like these showing in my editor all the time, so I thought I'd run clang-tidy with this diagnostic on all the files (that I can compile) and fix them. There is still one warning, in utils.c, but that's because some code is mixed up with preprocessor macros (#ifdef TUI), so I think there no good solution there. Change-Id: I345175fc7dd865318f0fbe61ac026c88c3b6a96b --- gdb/disasm.c | 2 +- gdb/dtrace-probe.c | 2 +- gdb/hppa-tdep.c | 2 +- gdb/mips-tdep.c | 2 +- gdb/p-valprint.c | 2 +- gdb/sparc64-tdep.c | 4 ++-- gdb/tracepoint.c | 16 ++++++++-------- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gdb/disasm.c b/gdb/disasm.c index 3000e5dddad9..5cd1f5adbd22 100644 --- a/gdb/disasm.c +++ b/gdb/disasm.c @@ -189,7 +189,7 @@ line_is_less_than (const deprecated_dis_line_entry &mle1, { if (mle1.start_pc != mle2.start_pc) val = mle1.start_pc < mle2.start_pc; - else + else val = mle1.line < mle2.line; } else diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c index 9aeefb6060c4..6f01edf3924c 100644 --- a/gdb/dtrace-probe.c +++ b/gdb/dtrace-probe.c @@ -851,7 +851,7 @@ dtrace_static_probe_ops::get_probes if (bfd_malloc_and_get_section (abfd, sect, &dof) && dof != NULL) dtrace_process_dof (sect, objfile, probesp, (struct dtrace_dof_hdr *) dof); - else + else complaint (_("could not obtain the contents of" "section '%s' in objfile `%s'."), bfd_section_name (sect), bfd_get_filename (abfd)); diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 32c543570458..7734115b744c 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -2171,7 +2171,7 @@ hppa_frame_cache (struct frame_info *this_frame, void **this_cache) fprintf_unfiltered (gdb_stdlog, " (base=%s) [saved]", paddress (gdbarch, cache->base)); } - else + else { /* The prologue has been slowly allocating stack space. Adjust the SP back. */ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index e5f8c6b20533..1c080bbe50fe 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -2063,7 +2063,7 @@ micromips_next_pc (struct regcache *regcache, CORE_ADDR pc) if (regcache_raw_get_signed (regcache, b0s5_reg (insn >> 16)) != regcache_raw_get_signed (regcache, b5s5_reg (insn >> 16))) pc += micromips_relative_offset16 (insn); - else + else pc += micromips_pc_insn_size (gdbarch, pc); break; diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 635d7ed5e4de..a88d6b9a82cd 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -313,7 +313,7 @@ pascal_language::value_print_inner (struct value *val, } else { - if (pascal_is_string_type (type, &length_pos, &length_size, + if (pascal_is_string_type (type, &length_pos, &length_size, &string_pos, &char_type, NULL) > 0) { len = extract_unsigned_integer (valaddr + length_pos, diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index 95d46c83253b..7d9b313783a4 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -327,8 +327,8 @@ adi_is_addr_mapped (CORE_ADDR vaddr, size_t cnt) } } } - else - warning (_("unable to open /proc file '%s'"), filename); + else + warning (_("unable to open /proc file '%s'"), filename); return false; } diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 95fc58fb8f06..506af3c527ec 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2410,14 +2410,14 @@ tfind_line_command (const char *args, int from_tty) error (_("Cannot find a good line.")); } } - else - { - /* Is there any case in which we get here, and have an address - which the user would want to see? If we have debugging - symbols and no line numbers? */ - error (_("Line number %d is out of range for \"%s\"."), - sal.line, symtab_to_filename_for_display (sal.symtab)); - } + else + { + /* Is there any case in which we get here, and have an address + which the user would want to see? If we have debugging + symbols and no line numbers? */ + error (_("Line number %d is out of range for \"%s\"."), + sal.line, symtab_to_filename_for_display (sal.symtab)); + } /* Find within range of stated line. */ if (args && *args) base-commit: 8d2ef06e1c220bcfb133a47b98b6287ccabdb587 -- 2.34.1