Just a tidy, no functional changes.
gdb/ChangeLog:
2016-09-06 Pedro Alves <palves@redhat.com>
* event-top.c (restore_ui_cleanup): Now static.
(make_cleanup_restore_current_ui): New function.
(switch_thru_all_uis_init): Use it.
* infcall.c (call_thread_fsm_should_stop): Use it.
* infrun.c (fetch_inferior_event): Use it.
* top.c (new_ui_command): Use it.
* top.h (restore_ui_cleanup): Delete declaration.
(make_cleanup_restore_current_ui): New declaration.
+2016-09-06 Pedro Alves <palves@redhat.com>
+
+ * event-top.c (restore_ui_cleanup): Now static.
+ (make_cleanup_restore_current_ui): New function.
+ (switch_thru_all_uis_init): Use it.
+ * infcall.c (call_thread_fsm_should_stop): Use it.
+ * infrun.c (fetch_inferior_event): Use it.
+ * top.c (new_ui_command): Use it.
+ * top.h (restore_ui_cleanup): Delete declaration.
+ (make_cleanup_restore_current_ui): New declaration.
+
2016-09-05 Ulrich Weigand <uweigand@de.ibm.com>
* i386-tdep.c (i386_floatformat_for_type): New function.
struct ui *current_ui;
struct ui *ui_list;
-/* See top.h. */
+/* A cleanup handler that restores the current UI. */
-void
+static void
restore_ui_cleanup (void *data)
{
current_ui = (struct ui *) data;
/* See top.h. */
+struct cleanup *
+make_cleanup_restore_current_ui (void)
+{
+ return make_cleanup (restore_ui_cleanup, current_ui);
+}
+
+/* See top.h. */
+
void
switch_thru_all_uis_init (struct switch_thru_all_uis *state)
{
state->iter = ui_list;
- state->old_chain = make_cleanup (restore_ui_cleanup, current_ui);
+ state->old_chain = make_cleanup_restore_current_ui ();
}
/* See top.h. */
f->return_value = get_call_return_value (&f->return_meta_info);
/* Break out of wait_sync_command_done. */
- old_chain = make_cleanup (restore_ui_cleanup, current_ui);
+ old_chain = make_cleanup_restore_current_ui ();
current_ui = f->waiting_ui;
target_terminal_ours ();
f->waiting_ui->prompt_state = PROMPT_NEEDED;
/* Events are always processed with the main UI as current UI. This
way, warnings, debug output, etc. are always consistently sent to
the main console. */
- make_cleanup (restore_ui_cleanup, current_ui);
+ make_cleanup_restore_current_ui ();
current_ui = main_ui;
/* End up with readline processing input, if necessary. */
interpreter_name = argv[0];
tty_name = argv[1];
- make_cleanup (restore_ui_cleanup, current_ui);
+ make_cleanup_restore_current_ui ();
failure_chain = make_cleanup (null_cleanup, NULL);
/* Cleanup that deletes a UI. */
extern struct cleanup *make_delete_ui_cleanup (struct ui *ui);
-/* Cleanup that restores the current UI. */
-extern void restore_ui_cleanup (void *data);
+/* Make a cleanup that restores the current UI. */
+extern struct cleanup *make_cleanup_restore_current_ui (void);
/* Register the UI's input file descriptor in the event loop. */
extern void ui_register_input_event_handler (struct ui *ui);