From 2039bd9f0ce667f3f0ee99c18e25de1ea18a2288 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 10 Sep 2017 14:29:22 -0600 Subject: [PATCH] Constify language_enum Change language_enum to take a const argument. ChangeLog 2017-09-11 Tom Tromey * language.h (language_enum): Make argument const. * language.c (language_enum): Make argument const. --- gdb/ChangeLog | 5 +++++ gdb/language.c | 2 +- gdb/language.h | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fb0de8b3057..a6238dc8da9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-09-11 Tom Tromey + + * language.h (language_enum): Make argument const. + * language.c (language_enum): Make argument const. + 2017-09-11 Tom Tromey * common/common-utils.h (skip_to_space): Remove macro, redeclare diff --git a/gdb/language.c b/gdb/language.c index 7f870d83522..e92c3c55a5e 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 57e48bd19b1..d4ca900834d 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); -- 2.30.2