From: Nguyễn Thái Ngọc Duy Date: Mon, 15 Oct 2012 06:25:50 +0000 (+0700) Subject: ctype: make sane_ctype[] const array X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ca5ab7d1e813435bbf4ba0615a2adf0cdc35960e;p=git.git ctype: make sane_ctype[] const array Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/ctype.c b/ctype.c index 935327164..faeaf34e6 100644 --- a/ctype.c +++ b/ctype.c @@ -14,7 +14,7 @@ enum { P = GIT_PATHSPEC_MAGIC /* other non-alnum, except for ] and } */ }; -unsigned char sane_ctype[256] = { +const unsigned char sane_ctype[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, S, S, 0, 0, S, 0, 0, /* 0.. 15 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 16.. 31 */ S, P, P, P, R, P, P, P, R, R, G, R, P, P, R, P, /* 32.. 47 */ diff --git a/git-compat-util.h b/git-compat-util.h index 5bd9ad7d2..80767ff3a 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -470,7 +470,7 @@ extern const char tolower_trans_tbl[256]; #undef isupper #undef tolower #undef toupper -extern unsigned char sane_ctype[256]; +extern const unsigned char sane_ctype[256]; #define GIT_SPACE 0x01 #define GIT_DIGIT 0x02 #define GIT_ALPHA 0x04