summaryrefslogtreecommitdiff
path: root/gdb/mi/mi-out.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2014-12-12 22:12:12 +0100
committerJan Kratochvil <jan.kratochvil@redhat.com>2014-12-12 22:12:12 +0100
commitde571fc5fbd89d21436119ca2cd9dce1375bdcb3 (patch)
tree49f49c8013617b93c78f879040f470741c130d7a /gdb/mi/mi-out.c
parent6dddd6a5747532ef6e9703432c51680011df4e8d (diff)
downloadbinutils-gdb-de571fc5fbd89d21436119ca2cd9dce1375bdcb3.tar.gz
introduce ui_file_write_for_put
This introduces a small helper function, ui_file_write_for_put. It is a wrapper for ui_write that is suitable for passing directly to ui_file_put. This patch also updates one existing spot to use this new function. gdb/ChangeLog 2014-12-12 Tom Tromey <tromey@redhat.com> * ui-file.h (ui_file_write_for_put): Declare. * ui-file.c (ui_file_write_for_put): New function. * mi/mi-out.c (do_write): Remove. (mi_out_put): Use ui_file_write_for_put.
Diffstat (limited to 'gdb/mi/mi-out.c')
-rw-r--r--gdb/mi/mi-out.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c
index 6ec41e6aab2..9f5d1c0e77e 100644
--- a/gdb/mi/mi-out.c
+++ b/gdb/mi/mi-out.c
@@ -376,18 +376,12 @@ mi_out_rewind (struct ui_out *uiout)
/* Dump the buffer onto the specified stream. */
-static void
-do_write (void *data, const char *buffer, long length_buffer)
-{
- ui_file_write (data, buffer, length_buffer);
-}
-
void
mi_out_put (struct ui_out *uiout, struct ui_file *stream)
{
mi_out_data *data = ui_out_data (uiout);
- ui_file_put (data->buffer, do_write, stream);
+ ui_file_put (data->buffer, ui_file_write_for_put, stream);
ui_file_rewind (data->buffer);
}