From 4904c3c6b69d5c7b5e4682220c1d9503e00a457e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 23 Apr 2018 20:52:36 -0600 Subject: [PATCH] Make do_is_mi_like_p const. This changes ui_out to make is_mi_like_p and do_is_mi_like_p "const". ChangeLog 2018-04-30 Tom Tromey * ui-out.c: Update. * cli-out.h (cli_ui_out::do_is_mi_like_p): Update. * ui-out.h (ui_out::is_mi_like_p): Now const. (ui_out::do_is_mi_like_p): Now const. * mi/mi-out.h (mi_ui_out::do_is_mi_like_p): Update. --- gdb/ChangeLog | 8 ++++++++ gdb/mi/mi-out.h | 2 +- gdb/ui-out.c | 2 +- gdb/ui-out.h | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 58640da0dcc..b2a8b7931f3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2018-04-30 Tom Tromey + + * ui-out.c: Update. + * cli-out.h (cli_ui_out::do_is_mi_like_p): Update. + * ui-out.h (ui_out::is_mi_like_p): Now const. + (ui_out::do_is_mi_like_p): Now const. + * mi/mi-out.h (mi_ui_out::do_is_mi_like_p): Update. + 2018-04-30 Tom Tromey * varobj.c (varobj_set_visualizer): Use new_reference. diff --git a/gdb/mi/mi-out.h b/gdb/mi/mi-out.h index 7389071dcfc..89ff88cd327 100644 --- a/gdb/mi/mi-out.h +++ b/gdb/mi/mi-out.h @@ -69,7 +69,7 @@ protected: virtual void do_flush () override; virtual void do_redirect (struct ui_file *outstream) override; - virtual bool do_is_mi_like_p () override + virtual bool do_is_mi_like_p () const override { return true; } private: diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 3648815090c..ebe0285b49e 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -581,7 +581,7 @@ ui_out::test_flags (ui_out_flags mask) } bool -ui_out::is_mi_like_p () +ui_out::is_mi_like_p () const { return do_is_mi_like_p (); } diff --git a/gdb/ui-out.h b/gdb/ui-out.h index a415100d7ea..81e2e0b20db 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -119,7 +119,7 @@ class ui_out a hack to encapsulate that test. Once GDB manages to separate the CLI/MI from the core of GDB the problem should just go away .... */ - bool is_mi_like_p (); + bool is_mi_like_p () const; bool query_table_field (int colno, int *width, int *alignment, const char **col_name); @@ -157,7 +157,7 @@ class ui_out /* Set as not MI-like by default. It is overridden in subclasses if necessary. */ - virtual bool do_is_mi_like_p () + virtual bool do_is_mi_like_p () const { return false; } private: -- 2.30.2