From da5132d379d3e1bbda3411de63b1a40c16614809 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 10 Jan 2013 21:15:51 +0000 Subject: [PATCH] gdb/ Code cleanup. * psymtab.c (psymtab_to_fullname, psymtab_to_fullname): Make the return type const char *. * tui/tui-source.c (tui_source_is_displayed): Make the parameter fname const char *. * tui/tui-source.h (tui_source_is_displayed): Likewise. --- gdb/ChangeLog | 9 +++++++++ gdb/psymtab.c | 4 ++-- gdb/tui/tui-source.c | 2 +- gdb/tui/tui-source.h | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fe5bb9dd922..6f4ad13f54f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2013-01-10 Jan Kratochvil + + Code cleanup. + * psymtab.c (psymtab_to_fullname, psymtab_to_fullname): Make the return + type const char *. + * tui/tui-source.c (tui_source_is_displayed): Make the parameter fname + const char *. + * tui/tui-source.h (tui_source_is_displayed): Likewise. + 2013-01-09 Anthony Green * cp-abi.c (cplus_print_vtable): Don't return value from void diff --git a/gdb/psymtab.c b/gdb/psymtab.c index acbdd6a8761..c6adb971e82 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -58,7 +58,7 @@ static struct partial_symbol *lookup_partial_symbol (struct objfile *, const char *, int, domain_enum); -static char *psymtab_to_fullname (struct partial_symtab *ps); +static const char *psymtab_to_fullname (struct partial_symtab *ps); static struct partial_symbol *find_pc_sect_psymbol (struct objfile *, struct partial_symtab *, @@ -1174,7 +1174,7 @@ map_symbol_filenames_psymtab (struct objfile *objfile, If this function fails to find the file that this partial_symtab represents, NULL will be returned and ps->fullname will be set to NULL. */ -static char * +static const char * psymtab_to_fullname (struct partial_symtab *ps) { int r; diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index eb7879c268c..fb60fd463ef 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -332,7 +332,7 @@ tui_show_symtab_source (struct gdbarch *gdbarch, struct symtab *s, /* Answer whether the source is currently displayed in the source window. */ int -tui_source_is_displayed (char *fname) +tui_source_is_displayed (const char *fname) { return (TUI_SRC_WIN != NULL && TUI_SRC_WIN->generic.content_in_use diff --git a/gdb/tui/tui-source.h b/gdb/tui/tui-source.h index f5f31edc37c..8870268875a 100644 --- a/gdb/tui/tui-source.h +++ b/gdb/tui/tui-source.h @@ -35,7 +35,7 @@ extern enum tui_status tui_set_source_content (struct symtab *, extern void tui_show_symtab_source (struct gdbarch *, struct symtab *, struct tui_line_or_address, int); -extern int tui_source_is_displayed (char *); +extern int tui_source_is_displayed (const char *); extern void tui_vertical_source_scroll (enum tui_scroll_direction, int); -- 2.30.2