From f1a959923a6ead8f3a3e0590c16fa3114d91dc27 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Mon, 20 Aug 2012 12:20:25 +0400 Subject: [PATCH] Use AREF and ASET for docstrings of category tables. * category.h (CATEGORY_DOCSTRING): Use AREF. (SET_CATEGORY_DOCSTRING): Use ASET. * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING. --- src/ChangeLog | 7 +++++++ src/category.c | 2 +- src/category.h | 8 ++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index cc5b2b2eb77..58fa0de36b2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-08-20 Dmitry Antipov + + Use AREF and ASET for docstrings of category tables. + * category.h (CATEGORY_DOCSTRING): Use AREF. + (SET_CATEGORY_DOCSTRING): Use ASET. + * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING. + 2012-08-20 Dmitry Antipov Inline setter functions for hash table members. diff --git a/src/category.c b/src/category.c index a9bbf596abc..1c9085fd558 100644 --- a/src/category.c +++ b/src/category.c @@ -143,7 +143,7 @@ the current buffer's category table. */) error ("Category `%c' is already defined", (int) XFASTINT (category)); if (!NILP (Vpurify_flag)) docstring = Fpurecopy (docstring); - CATEGORY_DOCSTRING (table, XFASTINT (category)) = docstring; + SET_CATEGORY_DOCSTRING (table, XFASTINT (category), docstring); return Qnil; } diff --git a/src/category.h b/src/category.h index f29034acff1..9fb981ed383 100644 --- a/src/category.h +++ b/src/category.h @@ -96,8 +96,12 @@ CHAR_HAS_CATEGORY (int ch, int category) #define Vstandard_category_table BVAR (&buffer_defaults, category_table) /* Return the doc string of CATEGORY in category table TABLE. */ -#define CATEGORY_DOCSTRING(table, category) \ - XVECTOR (Fchar_table_extra_slot (table, make_number (0)))->contents[(category) - ' '] +#define CATEGORY_DOCSTRING(table, category) \ + AREF (Fchar_table_extra_slot (table, make_number (0)), ((category) - ' ')) + +/* Set the doc string of CATEGORY to VALUE in category table TABLE. */ +#define SET_CATEGORY_DOCSTRING(table, category, value) \ + ASET (Fchar_table_extra_slot (table, make_number (0)), ((category) - ' '), value) /* Return the version number of category table TABLE. Not used for the moment. */ -- 2.39.5