diff options
author | Tom Tromey <tom@tromey.com> | 2016-09-22 20:33:30 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2016-10-21 14:17:32 -0600 |
commit | 9746809447893fd4672ea6babf4e961157cb541d (patch) | |
tree | 0d82c7443e54ba27007cf112c1ae506872bb4949 /gdb/utils.c | |
parent | b7b633e9b13fc5697af035f4504c9790c612a8c7 (diff) | |
download | gdb-9746809447893fd4672ea6babf4e961157cb541d.zip gdb-9746809447893fd4672ea6babf4e961157cb541d.tar.gz gdb-9746809447893fd4672ea6babf4e961157cb541d.tar.bz2 |
Use scoped_restore for ui_file
This replaces all the uses of make_cleanup_restore_ui_file with
scoped_restore.
2016-10-21 Tom Tromey <tom@tromey.com>
* utils.c (make_cleanup_restore_ui_file, do_restore_ui_file)
(struct restore_ui_file_closure): Remove.
* utils.h (make_cleanup_restore_ui_file): Don't declare.
* guile/scm-ports.c (ioscm_with_output_to_port_worker): Use
scoped_restore.
* top.c (execute_command_to_string): Use scoped_restore.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r-- | gdb/utils.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index 71c0e00..e552685 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -319,35 +319,6 @@ make_cleanup_htab_delete (htab_t htab) return make_cleanup (do_htab_delete_cleanup, htab); } -struct restore_ui_file_closure -{ - struct ui_file **variable; - struct ui_file *value; -}; - -static void -do_restore_ui_file (void *p) -{ - struct restore_ui_file_closure *closure - = (struct restore_ui_file_closure *) p; - - *(closure->variable) = closure->value; -} - -/* Remember the current value of *VARIABLE and make it restored when - the cleanup is run. */ - -struct cleanup * -make_cleanup_restore_ui_file (struct ui_file **variable) -{ - struct restore_ui_file_closure *c = XNEW (struct restore_ui_file_closure); - - c->variable = variable; - c->value = *variable; - - return make_cleanup_dtor (do_restore_ui_file, (void *) c, xfree); -} - /* Helper for make_cleanup_value_free_to_mark. */ static void |