From patchwork Sat Apr 1 19:32:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 67174 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 63EA43858434 for ; Sat, 1 Apr 2023 19:33:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63EA43858434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680377595; bh=uKZRVL1R96tBuMhalAOSBTT8Ms2PN1irPrSOXqfg5yU=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=iTAStfgry6KtKf4uvn0gLbOjZ+UTum8AXcse88JmzylrxBCG4WnpRiiAx9oqL1ZsC +lnAVXcRo+H5sBXSpwYJlMF9k+jZiNVQHH2XEO/sS3j95rsD/veub2FZHwgFIvuf+l 4JZase4ftp2gEB86lFxVzV0uBbIDF6GVIdzzudyM= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id AF35A3858D35 for ; Sat, 1 Apr 2023 19:32:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF35A3858D35 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 331JWfV9002207 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 1 Apr 2023 15:32:46 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 331JWfV9002207 Received: from simark.localdomain (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id B115B1E0D2; Sat, 1 Apr 2023 15:32:41 -0400 (EDT) To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb: remove unused parameters in print_doc_of_command, apropos_cmd Date: Sat, 1 Apr 2023 15:32:40 -0400 Message-Id: <20230401193240.1619282-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sat, 1 Apr 2023 19:32:41 +0000 X-Spam-Status: No, score=-3189.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" I noticed the prefix parameter was unused in print_doc_of_command. And when removing it, it becomes unused in apropos_cmd. Sending as non-obvious, in case somebody can spot if this is a mistake, and it should actually be used. Change-Id: Id72980b03fe091b22931e6b85945f412b274ed5e --- gdb/cli/cli-cmds.c | 2 +- gdb/cli/cli-decode.c | 16 +++++++--------- gdb/cli/cli-decode.h | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) base-commit: 3026cdbdde0e1937f811b52ba18fe3fbb1419ef9 diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 0c680896c917..3b1c6a9f4bd6 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -1768,7 +1768,7 @@ apropos_command (const char *arg, int from_tty) compiled_regex pattern (arg, REG_ICASE, _("Error in regular expression")); - apropos_cmd (gdb_stdout, cmdlist, verbose, pattern, ""); + apropos_cmd (gdb_stdout, cmdlist, verbose, pattern); } /* The options for the "alias" command. */ diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 2a4f9b45ab1d..948592a6f621 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -1637,9 +1637,8 @@ fput_command_names_styled (const cmd_list_element &c, otherwise print only one-line help for command C. */ static void -print_doc_of_command (const cmd_list_element &c, const char *prefix, - bool verbose, compiled_regex &highlight, - struct ui_file *stream) +print_doc_of_command (const cmd_list_element &c, bool verbose, + compiled_regex &highlight, struct ui_file *stream) { /* When printing the full documentation, add a line to separate this documentation from the previous command help, in the likely @@ -1674,7 +1673,7 @@ print_doc_of_command (const cmd_list_element &c, const char *prefix, void apropos_cmd (struct ui_file *stream, struct cmd_list_element *commandlist, - bool verbose, compiled_regex ®ex, const char *prefix) + bool verbose, compiled_regex ®ex) { struct cmd_list_element *c; int returnvalue; @@ -1698,7 +1697,7 @@ apropos_cmd (struct ui_file *stream, /* Try to match against the name. */ returnvalue = regex.search (c->name, name_len, 0, name_len, NULL); if (returnvalue >= 0) - print_doc_of_command (*c, prefix, verbose, regex, stream); + print_doc_of_command (*c, verbose, regex, stream); /* Try to match against the name of the aliases. */ for (const cmd_list_element &alias : c->aliases) @@ -1707,7 +1706,7 @@ apropos_cmd (struct ui_file *stream, returnvalue = regex.search (alias.name, name_len, 0, name_len, NULL); if (returnvalue >= 0) { - print_doc_of_command (*c, prefix, verbose, regex, stream); + print_doc_of_command (*c, verbose, regex, stream); break; } } @@ -1718,15 +1717,14 @@ apropos_cmd (struct ui_file *stream, /* Try to match against documentation. */ if (regex.search (c->doc, doc_len, 0, doc_len, NULL) >= 0) - print_doc_of_command (*c, prefix, verbose, regex, stream); + print_doc_of_command (*c, verbose, regex, stream); } /* Check if this command has subcommands. */ if (c->is_prefix ()) { /* Recursively call ourselves on the subcommand list, passing the right prefix in. */ - apropos_cmd (stream, *c->subcommands, verbose, regex, - c->prefixname ().c_str ()); + apropos_cmd (stream, *c->subcommands, verbose, regex); } } } diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h index 013ffc8fd4cf..8fe9325c2da3 100644 --- a/gdb/cli/cli-decode.h +++ b/gdb/cli/cli-decode.h @@ -283,7 +283,7 @@ struct cmd_list_element extern void help_cmd (const char *, struct ui_file *); extern void apropos_cmd (struct ui_file *, struct cmd_list_element *, - bool verbose, compiled_regex &, const char *); + bool verbose, compiled_regex &); /* Used to mark commands that don't do anything. If we just leave the function field NULL, the command is interpreted as a help topic, or