From 6384ddb72cfa0d13c1126fc5b3aea3b10b921f9c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 26 Oct 2006 11:56:02 +0000 Subject: [PATCH] Make read-only array really read-only. Saves a few bytes in the .data segment. --- ChangeLog | 6 ++++++ lib/mbchar.c | 2 +- lib/mbchar.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf9868580..7b0200f18 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 590109bd6..95373f58b 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 bf31027ce..13578356b 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) -- 2.11.0