emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108620: * category.h (CHAR_HAS_CATEG


From: Andreas Schwab
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108620: * category.h (CHAR_HAS_CATEGORY): Define as inline.
Date: Sat, 16 Jun 2012 10:20:19 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108620
committer: Andreas Schwab <address@hidden>
branch nick: emacs
timestamp: Sat 2012-06-16 10:20:19 +0200
message:
  * category.h (CHAR_HAS_CATEGORY): Define as inline.
  (CATEGORY_MEMBER): Enforce 1/0 value.
  * category.c (_temp_category_set): Remove.
modified:
  src/ChangeLog
  src/category.c
  src/category.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-06-16 07:18:44 +0000
+++ b/src/ChangeLog     2012-06-16 08:20:19 +0000
@@ -1,3 +1,9 @@
+2012-06-16  Andreas Schwab  <address@hidden>
+
+       * category.h (CHAR_HAS_CATEGORY): Define as inline.
+       (CATEGORY_MEMBER): Enforce 1/0 value.
+       * category.c (_temp_category_set): Remove.
+
 2012-06-16  Eli Zaretskii  <address@hidden>
 
        * window.c (Fdelete_other_windows_internal)

=== modified file 'src/category.c'
--- a/src/category.c    2012-02-10 18:58:48 +0000
+++ b/src/category.c    2012-06-16 08:20:19 +0000
@@ -50,9 +50,6 @@
 
 static Lisp_Object Qcategory_table, Qcategoryp, Qcategorysetp, 
Qcategory_table_p;
 
-/* Temporary internal variable used in macro CHAR_HAS_CATEGORY.  */
-Lisp_Object _temp_category_set;
-
 /* Make CATEGORY_SET includes (if VAL is t) or excludes (if VAL is
    nil) CATEGORY.  */
 #define SET_CATEGORY_SET(category_set, category, val) \

=== modified file 'src/category.h'
--- a/src/category.h    2011-09-21 17:41:20 +0000
+++ b/src/category.h    2012-06-16 08:20:19 +0000
@@ -1,6 +1,6 @@
 /* Declarations having to do with Emacs category tables.
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-     2005, 2006, 2007, 2008, 2009, 2010, 2011
+     2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H14PRO021
    Copyright (C) 2003
@@ -69,27 +69,27 @@
 #define CHECK_CATEGORY_SET(x) \
   CHECK_TYPE (CATEGORY_SET_P (x), Qcategorysetp, x)
 
+/* Return the category set of character C in the current category table.  */
+#define CATEGORY_SET(c) char_category_set (c)
+
 /* Return 1 if CATEGORY_SET contains CATEGORY, else return 0.
    The faster version of `!NILP (Faref (category_set, category))'.  */
 #define CATEGORY_MEMBER(category, category_set)                                
\
-  (XCATEGORY_SET (category_set)->data[(category) / 8]                  \
-   & (1 << ((category) % 8)))
-
-/* Temporary internal variable used in macro CHAR_HAS_CATEGORY.  */
-extern Lisp_Object _temp_category_set;
-
-/* Return 1 if category set of CH contains CATEGORY, elt return 0.  */
-#define CHAR_HAS_CATEGORY(ch, category)        \
-  (_temp_category_set = CATEGORY_SET (ch),     \
-   CATEGORY_MEMBER (category, _temp_category_set))
+  ((XCATEGORY_SET (category_set)->data[(category) / 8]                 \
+    >> ((category) % 8)) & 1)
+
+/* Return 1 if category set of CH contains CATEGORY, else return 0.  */
+static inline int
+CHAR_HAS_CATEGORY (int ch, int category)
+{
+  Lisp_Object category_set = CATEGORY_SET (ch);
+  return CATEGORY_MEMBER (category, category_set);
+}
 
 /* The standard category table is stored where it will automatically
    be used in all new buffers.  */
 #define Vstandard_category_table BVAR (&buffer_defaults, category_table)
 
-/* Return the category set of character C in the current category table.  */
-#define CATEGORY_SET(c) char_category_set (c)
-
 /* 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) - ' ']


reply via email to

[Prev in Thread] Current Thread [Next in Thread]