Mercurial > emacs
changeset 17134:124013c4d7b2
(CATEGORY_SET): Cast arg C to
`unsigned char' before indexing category table directly.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 03 Mar 1997 01:54:26 +0000 |
parents | fbdff0d0de3d |
children | 1814adcc2648 |
files | src/category.h |
diffstat | 1 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/category.h Sun Mar 02 01:01:13 1997 +0000 +++ b/src/category.h Mon Mar 03 01:54:26 1997 +0000 @@ -101,8 +101,8 @@ #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 @@ 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. */