From 2dab0c7ba0d69bcc16cfe58da279ce915ef24348 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 16 May 2020 09:58:45 -0600 Subject: Remove ALL_UIS Continuing my goal of removing the "ALL_*" iterator macros, this removes ALL_UIS, replacing it with an iterator adaptor. gdb/ChangeLog 2020-05-16 Tom Tromey * top.c (quit_force): Update. * infrun.c (handle_no_resumed): Update. * top.h (all_uis): New function. (ALL_UIS): Remove. --- gdb/top.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gdb/top.h') diff --git a/gdb/top.h b/gdb/top.h index e98772a..fd99297 100644 --- a/gdb/top.h +++ b/gdb/top.h @@ -22,6 +22,7 @@ #include "gdbsupport/buffer.h" #include "gdbsupport/event-loop.h" +#include "gdbsupport/next-iterator.h" #include "value.h" struct tl_interp_info; @@ -206,9 +207,12 @@ public: #define SWITCH_THRU_ALL_UIS() \ for (switch_thru_all_uis stau_state; !stau_state.done (); stau_state.next ()) -/* Traverse over all UIs. */ -#define ALL_UIS(UI) \ - for (UI = ui_list; UI; UI = UI->next) \ +/* An adapter that can be used to traverse over all UIs. */ +static inline +next_adapter all_uis () +{ + return next_adapter (ui_list); +} /* Register the UI's input file descriptor in the event loop. */ extern void ui_register_input_event_handler (struct ui *ui); -- cgit v1.1