changeset 32386:7640584e697c

cext: mark constant variables
author Yuya Nishihara <yuya@tcha.org>
date Sun, 21 May 2017 13:41:01 +0900
parents 34bd3cd28dcb
children 655f1e2cfa5a
files mercurial/cext/parsers.c mercurial/cext/util.h
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cext/parsers.c	Sun May 21 13:35:19 2017 +0900
+++ b/mercurial/cext/parsers.c	Sun May 21 13:41:01 2017 +0900
@@ -27,9 +27,9 @@
 #define PyInt_AsLong PyLong_AsLong
 #endif
 
-static char *versionerrortext = "Python minor version mismatch";
+static const char *const versionerrortext = "Python minor version mismatch";
 
-static char lowertable[128] = {
+static const char lowertable[128] = {
 	'\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
 	'\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',
 	'\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
@@ -50,7 +50,7 @@
 	'\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f'
 };
 
-static char uppertable[128] = {
+static const char uppertable[128] = {
 	'\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
 	'\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',
 	'\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
--- a/mercurial/cext/util.h	Sun May 21 13:35:19 2017 +0900
+++ b/mercurial/cext/util.h	Sun May 21 13:41:01 2017 +0900
@@ -42,7 +42,7 @@
 #include <stdbool.h>
 #endif
 
-static int8_t hextable[256] = {
+static const int8_t hextable[256] = {
 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,