(struct charset_lookup): Use `Charset_ID' instead of `Bufbyte'.
authortomo <tomo>
Wed, 7 Jun 2000 09:25:18 +0000 (09:25 +0000)
committertomo <tomo>
Wed, 7 Jun 2000 09:25:18 +0000 (09:25 +0000)
(CHARSET_BY_LEADING_BYTE): Use `Charset_ID' instead of `int'; Use
`MIN_LEADING_BYTE' instead of 128; use `MIN_LEADING_BYTE +
NUM_LEADING_BYTES' instead of 0xFF.

src/mule-charset.h

index 4733004..87fca1e 100644 (file)
@@ -557,8 +557,8 @@ struct charset_lookup {
 
   /* Table of charsets indexed by type/final-byte/direction. */
   Lisp_Object charset_by_attributes[4][128][2];
-  Bufbyte next_allocated_1_byte_leading_byte;
-  Bufbyte next_allocated_2_byte_leading_byte;
+  Charset_ID next_allocated_1_byte_leading_byte;
+  Charset_ID next_allocated_2_byte_leading_byte;
 };
 
 extern struct charset_lookup *chlook;
@@ -567,17 +567,19 @@ extern struct charset_lookup *chlook;
 /* 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
    truncated. */
-INLINE_HEADER Lisp_Object CHARSET_BY_LEADING_BYTE (int lb);
+INLINE_HEADER Lisp_Object CHARSET_BY_LEADING_BYTE (Charset_ID lb);
 INLINE_HEADER Lisp_Object
-CHARSET_BY_LEADING_BYTE (int lb)
+CHARSET_BY_LEADING_BYTE (Charset_ID lb)
 {
-  assert (lb >= 0x80 && lb <= 0xFF);
-  return chlook->charset_by_leading_byte[lb - 128];
+  assert (lb >= MIN_LEADING_BYTE &&
+         lb < MIN_LEADING_BYTE + NUM_LEADING_BYTES);
+  return chlook->charset_by_leading_byte[lb - MIN_LEADING_BYTE];
 }
 
 #else
 
-#define CHARSET_BY_LEADING_BYTE(lb) (chlook->charset_by_leading_byte[(lb) - 128])
+#define CHARSET_BY_LEADING_BYTE(lb) \
+  (chlook->charset_by_leading_byte[(lb) - MIN_LEADING_BYTE])
 
 #endif