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 <yao@codesourcery.com>
* language.c (language_str): Return const char *.
(add_language): Add const to 'language_names'
* language.h (struct language_defn) <la_name>: Add const.
(language_str: Update declaration.
+2013-11-07 Yao Qi <yao@codesourcery.com>
+
+ * language.c (language_str): Return const char *.
+ (add_language): Add const to 'language_names'
+ * language.h (struct language_defn) <la_name>: Add const.
+ (language_str: Update declaration.
+
2013-11-06 Andreas Arnez <arnez@linux.vnet.ibm.com>
* s390-linux-nat.c (s390_read_description): Consider the TE field
}
/* Return the language as a string. */
-char *
+const char *
language_str (enum language lang)
{
int i;
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;
{
/* Name of the language. */
- char *la_name;
+ const char *la_name;
/* its symtab language-enum (defs.h). */
extern const struct language_defn *language_def (enum language);
-extern char *language_str (enum language);
+extern const char *language_str (enum language);
/* Add a language to the set known by GDB (at initialization time). */