diff src/mule-charset.h @ 438:84b14dcb0985 r21-2-27

Import from CVS: tag r21-2-27
author cvs
date Mon, 13 Aug 2007 11:32:25 +0200
parents 3ecd8885ac67
children 8de8e3f6228a
line wrap: on
line diff
--- a/src/mule-charset.h	Mon Aug 13 11:31:26 2007 +0200
+++ b/src/mule-charset.h	Mon Aug 13 11:32:25 2007 +0200
@@ -239,7 +239,7 @@
 
    Character set		Encoding (PC == position-code)
    -------------		-------- (LB == leading-byte)
-   ASCII			PC1 |
+   ASCII			PC1  |
    Control-1			LB   | PC1 + 0xA0
    Dimension-1 official		LB   | PC1 + 0x80
    Dimension-1 private		0x9E | LB         | PC1 + 0x80
@@ -557,17 +557,6 @@
 
 extern struct charset_lookup *chlook;
 
-/* Table of number of bytes in the string representation of a character
-   indexed by the first byte of that representation.
-
-   This value can be derived other ways -- e.g. something like
-
-   (BYTE_ASCII_P (first_byte) ? 1 :
-    XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (first_byte)))
-
-   but it's faster this way. */
-extern Bytecount rep_bytes_by_first_byte[0xA0];
-
 #ifdef ERROR_CHECK_TYPECHECK
 /* int not Bufbyte even though that is the actual type of a leading byte.
    This way, out-ot-range values will get caught rather than automatically
@@ -589,21 +578,26 @@
 #define CHARSET_BY_ATTRIBUTES(type, final, dir) \
   (chlook->charset_by_attributes[type][final][dir])
 
-#ifdef ERROR_CHECK_TYPECHECK
+
+/* Table of number of bytes in the string representation of a character
+   indexed by the first byte of that representation.
 
-/* Number of bytes in the string representation of a character */
+   This value can be derived in other ways -- e.g. something like
+   XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (first_byte))
+   but it's faster this way. */
+extern const Bytecount rep_bytes_by_first_byte[0xA0];
+
+/* Number of bytes in the string representation of a character. */
 INLINE int REP_BYTES_BY_FIRST_BYTE (int fb);
 INLINE int
 REP_BYTES_BY_FIRST_BYTE (int fb)
 {
-  assert (fb >= 0 && fb < 0xA0);
+#ifdef ERROR_CHECK_TYPECHECK
+  assert (0 <= fb && fb < 0xA0);
+#endif
   return rep_bytes_by_first_byte[fb];
 }
 
-#else
-#define REP_BYTES_BY_FIRST_BYTE(fb) (rep_bytes_by_first_byte[fb])
-#endif
-
 
 /************************************************************************/
 /*                        Dealing with characters                       */