From d2c0eef48a1bb331ca08f8f26ff82c5d4086ba0c Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sat, 26 Nov 2016 22:05:42 -0500 Subject: Constify wrap_here/wrap_hint code path Constify the data path between ui_out_wrap_hint and the wrap_indent global, because we can. It's clearer that the argument passed to wrap_hint is not intended to be modified by the ui_out implementation. gdb/ChangeLog: * mi/mi-out.c (mi_wrap_hint): Constify argument. * cli-out.c (cli_wrap_hint): Likewise. * ui-out.c (ui_out_wrap_hint, uo_wrap_hint): Likewise. * ui-out.h (ui_out_wrap_hint, wrap_hint_ftype): Likewise. * utils.c (wrap_here): Likewise. (wrap_indent): Constify. * utils.h (wrap_here): Constify argument. --- gdb/ui-out.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/ui-out.h') diff --git a/gdb/ui-out.h b/gdb/ui-out.h index 864048c..569f762 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -123,7 +123,7 @@ extern void ui_out_message (struct ui_out *uiout, int verbosity, const char *format, ...) ATTRIBUTE_PRINTF (3, 4); -extern void ui_out_wrap_hint (struct ui_out *uiout, char *identstring); +extern void ui_out_wrap_hint (struct ui_out *uiout, const char *identstring); extern void ui_out_flush (struct ui_out *uiout); @@ -186,7 +186,7 @@ typedef void (text_ftype) (struct ui_out * uiout, typedef void (message_ftype) (struct ui_out * uiout, int verbosity, const char *format, va_list args) ATTRIBUTE_FPTR_PRINTF(3,0); -typedef void (wrap_hint_ftype) (struct ui_out * uiout, char *identstring); +typedef void (wrap_hint_ftype) (struct ui_out * uiout, const char *identstring); typedef void (flush_ftype) (struct ui_out * uiout); typedef int (redirect_ftype) (struct ui_out * uiout, struct ui_file * outstream); -- cgit v1.1