public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Remove parameter from language_info
@ 2021-03-29 14:26 Tom Tromey
  2021-03-29 14:38 ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2021-03-29 14:26 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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  <tromey@adacore.com>

	* 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)
 \f
 
 /* 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);
-    }
 }
 \f
 
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);
 \f
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;
     }
-- 
2.26.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Remove parameter from language_info
  2021-03-29 14:26 [PATCH] Remove parameter from language_info Tom Tromey
@ 2021-03-29 14:38 ` Simon Marchi
  2021-03-29 15:35   ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2021-03-29 14:38 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

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  <tromey@adacore.com>
> 
> 	* 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)
>  \f
>  
>  /* 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);
> -    }
>  }
>  \f
>  
> 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);
>  \f
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Remove parameter from language_info
  2021-03-29 14:38 ` Simon Marchi
@ 2021-03-29 15:35   ` Tom Tromey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2021-03-29 15:35 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Tom Tromey, gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

Simon> Thanks, that LGTM (obvious even).  I would suggest moving the function
Simon> comment to the header at the same time.

Good idea.  I made this change and now I'm checking it in.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-29 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 14:26 [PATCH] Remove parameter from language_info Tom Tromey
2021-03-29 14:38 ` Simon Marchi
2021-03-29 15:35   ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).