Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFA 2/3] Constify language_enum
Date: Mon, 11 Sep 2017 00:33:00 -0000	[thread overview]
Message-ID: <20170911003325.3765-3-tom@tromey.com> (raw)
In-Reply-To: <20170911003325.3765-1-tom@tromey.com>

Change language_enum to take a const argument.

ChangeLog
2017-09-10  Tom Tromey  <tom@tromey.com>

	* 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 a906d50..4c2a924 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2017-09-10  Tom Tromey  <tom@tromey.com>
 
+	* language.h (language_enum): Make argument const.
+	* language.c (language_enum): Make argument const.
+
+2017-09-10  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);
 
-- 
2.9.4


  reply	other threads:[~2017-09-11  0:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11  0:33 [RFA 0/3] preparation for command constification; cleanup removal Tom Tromey
2017-09-11  0:33 ` Tom Tromey [this message]
2017-09-11 19:17   ` [RFA 2/3] Constify language_enum Simon Marchi
2017-09-11  0:33 ` [RFA 1/3] Rename _const functions to use overloading instead Tom Tromey
2017-09-11 19:16   ` Simon Marchi
2017-09-11  0:33 ` [RFA 3/3] Make extract_arg return a std::string Tom Tromey
2017-09-11 19:52   ` Simon Marchi
2017-09-11 21:43     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170911003325.3765-3-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox