summaryrefslogtreecommitdiff
path: root/src/category.h
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>1997-03-03 01:54:26 +0000
committerKenichi Handa <handa@m17n.org>1997-03-03 01:54:26 +0000
commit040df2c773d81cfaa0c3e1314e5f0e19a23563cf (patch)
tree49568beee67fb36296f54c6b58523b10840c9148 /src/category.h
parentbc43b8e83a3fb8b256258582324f1c375eacd58f (diff)
downloademacs-040df2c773d81cfaa0c3e1314e5f0e19a23563cf.tar.gz
(CATEGORY_SET): Cast arg C to
`unsigned char' before indexing category table directly.
Diffstat (limited to 'src/category.h')
-rw-r--r--src/category.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/category.h b/src/category.h
index 956c6284b36..b51cb4d1d5a 100644
--- a/src/category.h
+++ b/src/category.h
@@ -101,8 +101,8 @@ extern Lisp_Object _temp_category_set;
#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 \
@@ -110,9 +110,11 @@ extern Lisp_Object _temp_category_set;
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. */