From 7becfd03bad526c02216eeb5ec2bebae694b1af1 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 10 Jan 2017 11:30:47 -0500 Subject: Change return type of ui_out redirect to void All implementations of redirect/do_redirect in the ui_out subsystem always return 0 (success). We can therefore clean it up and make them return void. gdb/ChangeLog: * cli-out.c (cli_ui_out::do_redirect): Change return type to void. * cli-out.h (cli_ui_out::do_redirect): Likewise. * mi/mi-out.c (mi_ui_out::do_redirect): Likewise. * mi/mi-out.h (mi_ui_out::do_redirect): Likewise. * ui-out.c (ui_out::redirect): Likewise. * ui-out.h (ui_out::redirect, ui_out::do_redirect): Likewise. * cli/cli-logging.c (set_logging_redirect): Update call site of ui_out::redirect. (handle_redirections): Likewise. * scm-ports.c (ioscm_with_output_to_port_worker): Likewise. * top.c (execute_command_to_string): Likewise. * utils.c (do_ui_out_redirect_pop): Likewise. --- gdb/top.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gdb/top.c') diff --git a/gdb/top.c b/gdb/top.c index 24ea14e..ef8d856 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -706,10 +706,8 @@ execute_command_to_string (char *p, int from_tty) make_cleanup_ui_file_delete (str_file); - if (current_uiout->redirect (str_file) < 0) - warning (_("Current output protocol does not support redirection")); - else - make_cleanup_ui_out_redirect_pop (current_uiout); + current_uiout->redirect (str_file); + make_cleanup_ui_out_redirect_pop (current_uiout); scoped_restore save_stdout = make_scoped_restore (&gdb_stdout, str_file); -- cgit v1.1