# HG changeset patch # User Kenichi Handa # Date 857354066 0 # Node ID 124013c4d7b2b8324099da3d11796c5b6b1b81ba # Parent fbdff0d0de3d138be78847830a4420fad8ec3f0f (CATEGORY_SET): Cast arg C to `unsigned char' before indexing category table directly. diff -r fbdff0d0de3d -r 124013c4d7b2 src/category.h --- 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. */