From: Bruno Haible Date: Thu, 26 Oct 2006 11:56:02 +0000 (+0000) Subject: Make read-only array really read-only. Saves a few bytes in the .data segment. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6384ddb72cfa0d13c1126fc5b3aea3b10b921f9c;p=pspp Make read-only array really read-only. Saves a few bytes in the .data segment. --- diff --git a/ChangeLog b/ChangeLog index bf98685800..7b0200f183 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-10-25 Paul Eggert + + * lib/mbchar.h (is_basic_table): Make read-only. + * lib/mbchar.c (is_basic_table): Likewise. + Reported by John Darrington. + 2006-10-25 Bruno Haible * lib/progname.h (set_program_name): Undefine before defining. diff --git a/lib/mbchar.c b/lib/mbchar.c index 590109bd62..95373f58ba 100644 --- a/lib/mbchar.c +++ b/lib/mbchar.c @@ -24,7 +24,7 @@ #if IS_BASIC_ASCII /* Bit table of characters in the ISO C "basic character set". */ -unsigned int is_basic_table [UCHAR_MAX / 32 + 1] = +const unsigned int is_basic_table [UCHAR_MAX / 32 + 1] = { 0x00001a00, /* '\t' '\v' '\f' */ 0xffffffef, /* ' '...'#' '%'...'?' */ diff --git a/lib/mbchar.h b/lib/mbchar.h index bf31027ce4..13578356bd 100644 --- a/lib/mbchar.h +++ b/lib/mbchar.h @@ -430,7 +430,7 @@ mb_copy (mbchar_t *new, const mbchar_t *old) /* The character set is ISO-646, not EBCDIC. */ # define IS_BASIC_ASCII 1 -extern unsigned int is_basic_table[]; +extern const unsigned int is_basic_table[]; static inline bool is_basic (char c)