#define CATEGORY_SET(c) \
({ Lisp_Object table = current_buffer->category_table; \
Lisp_Object temp; \
- if (c < CHAR_TABLE_ORDINARY_SLOTS) \
- while (NILP (temp = XCHAR_TABLE (table)->contents[c]) \
+ if ((c) < CHAR_TABLE_ORDINARY_SLOTS) \
+ while (NILP (temp = XCHAR_TABLE (table)->contents[(unsigned char) c]) \
&& NILP (temp = XCHAR_TABLE (table)->defalt)) \
table = XCHAR_TABLE (table)->parent; \
else \
COMPOSITE_CHAR_P (c) ? cmpchar_component (c, 0) : (c)); \
temp; })
#else
-#define CATEGORY_SET(c) \
- Faref (current_buffer->category_table, \
- COMPOSITE_CHAR_P (c) ? cmpchar_component (c, 0) : (c))
+#define CATEGORY_SET(c) \
+ ((c) < CHAR_TABLE_ORDINARY_SLOTS \
+ ? Faref (current_buffer->category_table, make_number ((unsigned char) c)) \
+ : Faref (current_buffer->category_table, \
+ COMPOSITE_CHAR_P (c) ? cmpchar_component ((c), 0) : (c))
#endif
/* Return the doc string of CATEGORY in category table TABLE. */