This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] sim: cgen: constify mode_names


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4c171e25a8c83fc26b78430fa632fa9e64f61050

commit 4c171e25a8c83fc26b78430fa632fa9e64f61050
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Fri Aug 12 22:11:26 2016 +0800

    sim: cgen: constify mode_names

Diff:
---
 sim/common/ChangeLog    | 5 +++++
 sim/common/cgen-types.h | 2 +-
 sim/common/cgen-utils.c | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 868553b..e8da2b1 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,10 @@
 2016-08-13  Mike Frysinger  <vapier@gentoo.org>
 
+	* cgen-types.h (mode_names): Mark const.
+	* cgen-utils.c (mode_names): Likewise.
+
+2016-08-13  Mike Frysinger  <vapier@gentoo.org>
+
 	* cgen-defs.h (struct cgen_state): Delete argv and envp.
 	(STATE_ARGV, STATE_ENVP): Delete.
 
diff --git a/sim/common/cgen-types.h b/sim/common/cgen-types.h
index e71fb1b..94d6933 100644
--- a/sim/common/cgen-types.h
+++ b/sim/common/cgen-types.h
@@ -56,7 +56,7 @@ typedef enum mode_type {
 #define MAX_TARGET_MODES ((int) MODE_TARGET_MAX)
 #define MAX_MODES ((int) MODE_MAX)
 
-extern const char *mode_names[];
+extern const char * const mode_names[];
 #define MODE_NAME(m) (mode_names[m])
 
 typedef void VOID;
diff --git a/sim/common/cgen-utils.c b/sim/common/cgen-utils.c
index d17fb42..13de592 100644
--- a/sim/common/cgen-utils.c
+++ b/sim/common/cgen-utils.c
@@ -28,7 +28,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #define SEMOPS_DEFINE_INLINE
 #include "cgen-ops.h"
 
-const char *mode_names[] = {
+const char * const mode_names[] = {
   "VOID",
   "BI",
   "QI",


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]