+2016-11-30 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * cli-out.h (cli_ui_out_data) <streams>: Change type to
+ std::vector.
+ * cli-out.c: Remove vec.h include.
+ (cli_uiout_dtor): Update.
+ (cli_field_fmt): Update.
+ (cli_spaces): Update.
+ (cli_text): Update.
+ (cli_message): Update.
+ (cli_flush): Update.
+ (cli_redirect): Update.
+ (out_field_fmt): Update.
+ (field_separator): Update.
+ (cli_out_data_ctor): Update.
+ (cli_out_new): Update.
+ (cli_out_set_stream): Update.
+
2016-11-30 Simon Marchi <simon.marchi@polymtl.ca>
* mi/mi-out.c: Remove vec.h include.
#include "ui-out.h"
#include "cli-out.h"
#include "completer.h"
-#include "vec.h"
#include "readline/readline.h"
typedef struct cli_ui_out_data cli_out_data;
{
cli_out_data *data = (cli_out_data *) ui_out_data (ui_out);
- VEC_free (ui_filep, data->streams);
delete data;
}
if (data->suppress_output)
return;
- stream = VEC_last (ui_filep, data->streams);
+ stream = data->streams.back ();
vfprintf_filtered (stream, format, args);
if (align != ui_noalign)
if (data->suppress_output)
return;
- stream = VEC_last (ui_filep, data->streams);
+ stream = data->streams.back ();
print_spaces_filtered (numspaces, stream);
}
if (data->suppress_output)
return;
- stream = VEC_last (ui_filep, data->streams);
+ stream = data->streams.back ();
fputs_filtered (string, stream);
}
if (data->suppress_output)
return;
- struct ui_file *stream = VEC_last (ui_filep, data->streams);
+ struct ui_file *stream = data->streams.back ();
vfprintf_unfiltered (stream, format, args);
}
cli_flush (struct ui_out *uiout)
{
cli_out_data *data = (cli_out_data *) ui_out_data (uiout);
- struct ui_file *stream = VEC_last (ui_filep, data->streams);
+ struct ui_file *stream = data->streams.back ();
gdb_flush (stream);
}
cli_out_data *data = (cli_out_data *) ui_out_data (uiout);
if (outstream != NULL)
- VEC_safe_push (ui_filep, data->streams, outstream);
+ data->streams.push_back (outstream);
else
- VEC_pop (ui_filep, data->streams);
+ data->streams.pop_back ();
return 0;
}
const char *format,...)
{
cli_out_data *data = (cli_out_data *) ui_out_data (uiout);
- struct ui_file *stream = VEC_last (ui_filep, data->streams);
+ struct ui_file *stream = data->streams.back ();
va_list args;
va_start (args, format);
field_separator (void)
{
cli_out_data *data = (cli_out_data *) ui_out_data (current_uiout);
- struct ui_file *stream = VEC_last (ui_filep, data->streams);
+ struct ui_file *stream = data->streams.back ();
fputc_filtered (' ', stream);
}
{
gdb_assert (stream != NULL);
- self->streams = NULL;
- VEC_safe_push (ui_filep, self->streams, stream);
+ self->streams.push_back (stream);
self->suppress_output = 0;
}
{
cli_out_data *data = (cli_out_data *) ui_out_data (uiout);
struct ui_file *old;
-
- old = VEC_pop (ui_filep, data->streams);
- VEC_quick_push (ui_filep, data->streams, stream);
+
+ old = data->streams.back ();
+ data->streams.back () = stream;
return old;
}
-\f
+
/* CLI interface to display tab-completion matches. */
/* CLI version of displayer.crlf. */