From: Andrew Burgess Date: Mon, 6 Jul 2015 14:32:11 +0000 (+0100) Subject: gdb: tui_win_name: Make parameter and result const. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f41cbf58f4af65e8612585c45208f3690a39ea28;p=binutils-gdb.git gdb: tui_win_name: Make parameter and result const. This commit makes the parameter and the result for 'tui_win_name' constant. There's one place in the code that is then updated as a result of this change. gdb/ChangeLog: * tui/tui-data.c (tui_partial_win_by_name): Window name is const. (tui_win_name): Make parameter and result const. * tui/tui-data.h (tui_win_name): Make parameter and result const. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5131927b3e8..463665317e1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2015-07-06 Andrew Burgess + + * tui/tui-data.c (tui_partial_win_by_name): Window name is const. + (tui_win_name): Make parameter and result const. + * tui/tui-data.h (tui_win_name): Make parameter and result const. + 2015-07-06 Patrick Palka * i386-tdep.c (i386_mpx_info_bounds): Don't call error, instead diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index ed42c8d9b4e..0c350d85c7b 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -384,7 +384,8 @@ tui_partial_win_by_name (char *name) { if (tui_win_list[i] != 0) { - char *cur_name = tui_win_name (&tui_win_list[i]->generic); + const char *cur_name = + tui_win_name (&tui_win_list[i]->generic); if (strlen (name) <= strlen (cur_name) && startswith (cur_name, name)) @@ -399,8 +400,8 @@ tui_partial_win_by_name (char *name) /* Answer the name of the window. */ -char * -tui_win_name (struct tui_gen_win_info *win_info) +const char * +tui_win_name (const struct tui_gen_win_info *win_info) { char *name = (char *) NULL; diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 05263e318f5..1b9d8320e09 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -320,7 +320,7 @@ extern void tui_free_all_source_wins_content (void); extern void tui_del_window (struct tui_win_info *); extern void tui_del_data_windows (tui_win_content, int); extern struct tui_win_info *tui_partial_win_by_name (char *); -extern char *tui_win_name (struct tui_gen_win_info *); +extern const char *tui_win_name (const struct tui_gen_win_info *); extern enum tui_layout_type tui_current_layout (void); extern void tui_set_current_layout_to (enum tui_layout_type); extern int tui_term_height (void);