/* 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;
/* 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