bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non const global in mbchar.c


From: Paul Eggert
Subject: Re: Non const global in mbchar.c
Date: Wed, 25 Oct 2006 22:57:18 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

John Darrington <address@hidden> writes:

> One that shows up from gnulib is is_basic_table from mbchar.c
> This symbol should be const?

Makes sense to me.  Here's a proposed patch.

2006-10-25  Paul Eggert  <address@hidden>

        * lib/mbchar.c (is_basic_table): Now const.
        Problem reported by John Darrington.
        * lib/mbchar.h (is_basic_table): Likewise.

--- lib/mbchar.c        14 Sep 2006 14:18:36 -0000      1.2
+++ lib/mbchar.c        26 Oct 2006 05:55:13 -0000
@@ -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,          /* ' '...'#' '%'...'?' */
--- lib/mbchar.h        21 Aug 2006 18:28:02 -0000      1.7
+++ lib/mbchar.h        26 Oct 2006 05:55:13 -0000
@@ -430,7 +430,7 @@ mb_copy (mbchar_t *new, const mbchar_t *
 /* 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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]