public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Remove tui_refresh_all
@ 2024-04-26 16:15 Tom Tromey
  2024-05-09 18:52 ` Alexandra Petlanova Hajkova
  2024-05-10 10:22 ` Andrew Burgess
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Tromey @ 2024-04-26 16:15 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This removes tui_refresh_all.  There is only a single caller,
tui_refresh_all_win, so inlining the code there simplifies gdb at no
cost.
---
 gdb/tui/tui-win.c        |  6 +++++-
 gdb/tui/tui-wingeneral.c | 12 ------------
 gdb/tui/tui-wingeneral.h |  1 -
 3 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index ced7e254f50..47e33fb60f4 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -480,7 +480,11 @@ void
 tui_refresh_all_win (void)
 {
   clearok (curscr, TRUE);
-  tui_refresh_all ();
+  for (tui_win_info *win_info : all_tui_windows ())
+    {
+      if (win_info->is_visible ())
+	win_info->refresh_window ();
+    }
 }
 
 void
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index c14ac5a8faf..c56179dc562 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -189,15 +189,3 @@ tui_win_info::make_visible (bool visible)
   else
     handle.reset (nullptr);
 }
-
-/* Function to refresh all the windows currently displayed.  */
-
-void
-tui_refresh_all ()
-{
-  for (tui_win_info *win_info : all_tui_windows ())
-    {
-      if (win_info->is_visible ())
-	win_info->refresh_window ();
-    }
-}
diff --git a/gdb/tui/tui-wingeneral.h b/gdb/tui/tui-wingeneral.h
index 6bee433689e..652cef95733 100644
--- a/gdb/tui/tui-wingeneral.h
+++ b/gdb/tui/tui-wingeneral.h
@@ -28,7 +28,6 @@ struct tui_win_info;
 
 extern void tui_unhighlight_win (struct tui_win_info *);
 extern void tui_highlight_win (struct tui_win_info *);
-extern void tui_refresh_all ();
 
 /* An RAII class that suppresses output on construction (calling
    wnoutrefresh on the existing windows), and then flushes the output
-- 
2.44.0


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

* Re: [PATCH] Remove tui_refresh_all
  2024-04-26 16:15 [PATCH] Remove tui_refresh_all Tom Tromey
@ 2024-05-09 18:52 ` Alexandra Petlanova Hajkova
  2024-05-10 10:22 ` Andrew Burgess
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandra Petlanova Hajkova @ 2024-05-09 18:52 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 2120 bytes --]

On Fri, Apr 26, 2024 at 6:16 PM Tom Tromey <tom@tromey.com> wrote:

> This removes tui_refresh_all.  There is only a single caller,
> tui_refresh_all_win, so inlining the code there simplifies gdb at no
> cost.
> ---
>  gdb/tui/tui-win.c        |  6 +++++-
>  gdb/tui/tui-wingeneral.c | 12 ------------
>  gdb/tui/tui-wingeneral.h |  1 -
>  3 files changed, 5 insertions(+), 14 deletions(-)
>
> diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
> index ced7e254f50..47e33fb60f4 100644
> --- a/gdb/tui/tui-win.c
> +++ b/gdb/tui/tui-win.c
> @@ -480,7 +480,11 @@ void
>  tui_refresh_all_win (void)
>  {
>    clearok (curscr, TRUE);
> -  tui_refresh_all ();
> +  for (tui_win_info *win_info : all_tui_windows ())
> +    {
> +      if (win_info->is_visible ())
> +       win_info->refresh_window ();
> +    }
>  }
>
>  void
> diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
> index c14ac5a8faf..c56179dc562 100644
> --- a/gdb/tui/tui-wingeneral.c
> +++ b/gdb/tui/tui-wingeneral.c
> @@ -189,15 +189,3 @@ tui_win_info::make_visible (bool visible)
>    else
>      handle.reset (nullptr);
>  }
> -
> -/* Function to refresh all the windows currently displayed.  */
> -
> -void
> -tui_refresh_all ()
> -{
> -  for (tui_win_info *win_info : all_tui_windows ())
> -    {
> -      if (win_info->is_visible ())
> -       win_info->refresh_window ();
> -    }
> -}
> diff --git a/gdb/tui/tui-wingeneral.h b/gdb/tui/tui-wingeneral.h
> index 6bee433689e..652cef95733 100644
> --- a/gdb/tui/tui-wingeneral.h
> +++ b/gdb/tui/tui-wingeneral.h
> @@ -28,7 +28,6 @@ struct tui_win_info;
>
>  extern void tui_unhighlight_win (struct tui_win_info *);
>  extern void tui_highlight_win (struct tui_win_info *);
> -extern void tui_refresh_all ();
>
>  /* An RAII class that suppresses output on construction (calling
>     wnoutrefresh on the existing windows), and then flushes the output
> --
> 2.44.0
>
> Hi,
it looks super reasonable, also it adds no regressions for Fedora Rawhide
aarch64.

Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>

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

* Re: [PATCH] Remove tui_refresh_all
  2024-04-26 16:15 [PATCH] Remove tui_refresh_all Tom Tromey
  2024-05-09 18:52 ` Alexandra Petlanova Hajkova
@ 2024-05-10 10:22 ` Andrew Burgess
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Burgess @ 2024-05-10 10:22 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches; +Cc: Tom Tromey

Tom Tromey <tom@tromey.com> writes:

> This removes tui_refresh_all.  There is only a single caller,
> tui_refresh_all_win, so inlining the code there simplifies gdb at no
> cost.

LGTM.

Approved-By: Andrew Burgess <aburgess@redhat.com>

Thanks,
Andrew


> ---
>  gdb/tui/tui-win.c        |  6 +++++-
>  gdb/tui/tui-wingeneral.c | 12 ------------
>  gdb/tui/tui-wingeneral.h |  1 -
>  3 files changed, 5 insertions(+), 14 deletions(-)
>
> diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
> index ced7e254f50..47e33fb60f4 100644
> --- a/gdb/tui/tui-win.c
> +++ b/gdb/tui/tui-win.c
> @@ -480,7 +480,11 @@ void
>  tui_refresh_all_win (void)
>  {
>    clearok (curscr, TRUE);
> -  tui_refresh_all ();
> +  for (tui_win_info *win_info : all_tui_windows ())
> +    {
> +      if (win_info->is_visible ())
> +	win_info->refresh_window ();
> +    }
>  }
>  
>  void
> diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
> index c14ac5a8faf..c56179dc562 100644
> --- a/gdb/tui/tui-wingeneral.c
> +++ b/gdb/tui/tui-wingeneral.c
> @@ -189,15 +189,3 @@ tui_win_info::make_visible (bool visible)
>    else
>      handle.reset (nullptr);
>  }
> -
> -/* Function to refresh all the windows currently displayed.  */
> -
> -void
> -tui_refresh_all ()
> -{
> -  for (tui_win_info *win_info : all_tui_windows ())
> -    {
> -      if (win_info->is_visible ())
> -	win_info->refresh_window ();
> -    }
> -}
> diff --git a/gdb/tui/tui-wingeneral.h b/gdb/tui/tui-wingeneral.h
> index 6bee433689e..652cef95733 100644
> --- a/gdb/tui/tui-wingeneral.h
> +++ b/gdb/tui/tui-wingeneral.h
> @@ -28,7 +28,6 @@ struct tui_win_info;
>  
>  extern void tui_unhighlight_win (struct tui_win_info *);
>  extern void tui_highlight_win (struct tui_win_info *);
> -extern void tui_refresh_all ();
>  
>  /* An RAII class that suppresses output on construction (calling
>     wnoutrefresh on the existing windows), and then flushes the output
> -- 
> 2.44.0


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

end of thread, other threads:[~2024-05-10 10:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26 16:15 [PATCH] Remove tui_refresh_all Tom Tromey
2024-05-09 18:52 ` Alexandra Petlanova Hajkova
2024-05-10 10:22 ` Andrew Burgess

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).