# HG changeset patch # User Bruno Haible # Date 1161863762 0 # Node ID 2d7222ab82dc83d5a549bd3feb33f7ae0f52c385 # Parent 4aea3bda39c7eec2f4f1c3a96464f37812ca1f9e Make read-only array really read-only. Saves a few bytes in the .data segment. diff --git a/ChangeLog b/ChangeLog --- 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 --- 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 --- a/lib/mbchar.h +++ b/lib/mbchar.h @@ -430,7 +430,7 @@ /* 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)