From 27cd387b7c3e45685db2f0dae4e9188f562cb7f0 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Sat, 26 Oct 2013 15:37:15 +0800 Subject: Constify 'la_name' in struct language_defn Hi, When I add another name of language, I find field 'la_name' can be 'const char *'. This patch is to constify it. gdb: 2013-11-07 Yao Qi * language.c (language_str): Return const char *. (add_language): Add const to 'language_names' * language.h (struct language_defn) : Add const. (language_str: Update declaration. --- gdb/language.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/language.c') diff --git a/gdb/language.c b/gdb/language.c index dcad5f3..aa708b9 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -485,7 +485,7 @@ language_def (enum language lang) } /* Return the language as a string. */ -char * +const char * language_str (enum language lang) { int i; @@ -520,7 +520,7 @@ void add_language (const struct language_defn *lang) { /* For the "set language" command. */ - static char **language_names = NULL; + static const char **language_names = NULL; /* For the "help set language" command. */ char *language_set_doc = NULL; -- cgit v1.1