aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-09-10 14:29:22 -0600
committerTom Tromey <tom@tromey.com>2017-09-11 15:46:13 -0600
commit2039bd9f0ce667f3f0ee99c18e25de1ea18a2288 (patch)
tree9756ddf7befc8f9b6b32a25ac4105a0a18fb41a8 /gdb
parentf1735a53a63040cc4b4a735bf18a3f20d308e519 (diff)
downloadgdb-2039bd9f0ce667f3f0ee99c18e25de1ea18a2288.zip
gdb-2039bd9f0ce667f3f0ee99c18e25de1ea18a2288.tar.gz
gdb-2039bd9f0ce667f3f0ee99c18e25de1ea18a2288.tar.bz2
Constify language_enum
Change language_enum to take a const argument. ChangeLog 2017-09-11 Tom Tromey <tom@tromey.com> * language.h (language_enum): Make argument const. * language.c (language_enum): Make argument const.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/language.c2
-rw-r--r--gdb/language.h2
3 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fb0de8b..a6238dc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2017-09-11 Tom Tromey <tom@tromey.com>
+ * language.h (language_enum): Make argument const.
+ * language.c (language_enum): Make argument const.
+
+2017-09-11 Tom Tromey <tom@tromey.com>
+
* common/common-utils.h (skip_to_space): Remove macro, redeclare
as function.
(skip_to_space): Rename from skip_to_space_const.
diff --git a/gdb/language.c b/gdb/language.c
index 7f870d8..e92c3c5 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -478,7 +478,7 @@ range_error (const char *string,...)
/* Return the language enum for a given language string. */
enum language
-language_enum (char *str)
+language_enum (const char *str)
{
for (const auto &lang : languages)
if (strcmp (lang->la_name, str) == 0)
diff --git a/gdb/language.h b/gdb/language.h
index 57e48bd..d4ca900 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -562,7 +562,7 @@ extern int value_true (struct value *);
/* Misc: The string representing a particular enum language. */
-extern enum language language_enum (char *str);
+extern enum language language_enum (const char *str);
extern const struct language_defn *language_def (enum language);