From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id C5AE23857026 for ; Mon, 29 Mar 2021 14:38:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C5AE23857026 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 12TEcZF6004913 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Mar 2021 10:38:40 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 12TEcZF6004913 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 79BAC1E590; Mon, 29 Mar 2021 10:38:35 -0400 (EDT) Subject: Re: [PATCH] Remove parameter from language_info To: Tom Tromey , gdb-patches@sourceware.org References: <20210329142606.2501921-1-tromey@adacore.com> From: Simon Marchi Message-ID: Date: Mon, 29 Mar 2021 10:38:35 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210329142606.2501921-1-tromey@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 29 Mar 2021 14:38:35 +0000 X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 29 Mar 2021 14:38:43 -0000 On 2021-03-29 10:26 a.m., Tom Tromey wrote: > I noticed that language_info is only ever called with a value of '1'. > This patch removes the parameter. > > gdb/ChangeLog > 2021-03-29 Tom Tromey > > * top.c (check_frame_language_change): Update. > * language.c (language_info): Remove parameter. > * language.h (language_info): Remove parameter. > --- > gdb/ChangeLog | 6 ++++++ > gdb/language.c | 14 +++----------- > gdb/language.h | 2 +- > gdb/top.c | 3 ++- > 4 files changed, 12 insertions(+), 13 deletions(-) > > diff --git a/gdb/language.c b/gdb/language.c > index f38d64f28d7..872f2553b22 100644 > --- a/gdb/language.c > +++ b/gdb/language.c > @@ -375,25 +375,17 @@ set_language (enum language lang) > > > /* Print out the current language settings: language, range and > - type checking. If QUIETLY, print only what has changed. */ > + type checking. */ > > void > -language_info (int quietly) > +language_info () > { > - if (quietly && expected_language == current_language) > + if (expected_language == current_language) > return; > > expected_language = current_language; > printf_unfiltered (_("Current language: %s\n"), language); > show_language_command (NULL, 1, NULL, NULL); > - > - if (!quietly) > - { > - printf_unfiltered (_("Range checking: %s\n"), range); > - show_range_command (NULL, 1, NULL, NULL); > - printf_unfiltered (_("Case sensitivity: %s\n"), case_sensitive); > - show_case_command (NULL, 1, NULL, NULL); > - } > } > > > diff --git a/gdb/language.h b/gdb/language.h > index 5afb8335961..b62ff845123 100644 > --- a/gdb/language.h > +++ b/gdb/language.h > @@ -733,7 +733,7 @@ struct symbol * > (LANG)->la_language == language_cplus || \ > (LANG)->la_language == language_objc) > > -extern void language_info (int); > +extern void language_info (); > > extern enum language set_language (enum language); > > diff --git a/gdb/top.c b/gdb/top.c > index 31b751fa262..6dd2fe8a3b0 100644 > --- a/gdb/top.c > +++ b/gdb/top.c > @@ -482,7 +482,8 @@ check_frame_language_change (void) > { > if (language_mode == language_mode_auto && info_verbose) > { > - language_info (1); /* Print what changed. */ > + /* Print what changed. */ > + language_info (); > } > warned = 0; > } > Thanks, that LGTM (obvious even). I would suggest moving the function comment to the header at the same time. Simon