Make read-only array really read-only. Saves a few bytes in the .data segment.
authorBruno Haible <bruno@clisp.org>
Thu, 26 Oct 2006 11:56:02 +0000 (11:56 +0000)
committerBruno Haible <bruno@clisp.org>
Thu, 26 Oct 2006 11:56:02 +0000 (11:56 +0000)
ChangeLog
lib/mbchar.c
lib/mbchar.h

index bf98685..7b0200f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-25  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * 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  <bruno@clisp.org>
 
        * lib/progname.h (set_program_name): Undefine before defining.
index 590109b..95373f5 100644 (file)
@@ -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,          /* ' '...'#' '%'...'?' */
index bf31027..1357835 100644 (file)
@@ -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)