comparison src/category.h @ 71824:d015c4ec8df4

(CHECK_CATEGORY, CHECK_CATEGORY_SET): Use CHECK_TYPE.
author Kim F. Storm <storm@cua.dk>
date Wed, 12 Jul 2006 13:14:11 +0000
parents 547f2b420666
children 6ee41fdd69ff 8a8e69664178
comparison
equal deleted inserted replaced
71823:6b4b6ba02f17 71824:d015c4ec8df4
52 But, for the moment, we are not using this slot. */ 52 But, for the moment, we are not using this slot. */
53 53
54 #define CATEGORYP(x) \ 54 #define CATEGORYP(x) \
55 (INTEGERP ((x)) && XFASTINT ((x)) >= 0x20 && XFASTINT ((x)) <= 0x7E) 55 (INTEGERP ((x)) && XFASTINT ((x)) >= 0x20 && XFASTINT ((x)) <= 0x7E)
56 56
57 #define CHECK_CATEGORY(x) \ 57 #define CHECK_CATEGORY(x) \
58 do { \ 58 CHECK_TYPE (CATEGORYP (x), Qcategoryp, x)
59 if (!CATEGORYP ((x))) x = wrong_type_argument (Qcategoryp, (x)); \
60 } while (0)
61 59
62 #define XCATEGORY_SET XBOOL_VECTOR 60 #define XCATEGORY_SET XBOOL_VECTOR
63 61
64 #define CATEGORY_SET_P(x) \ 62 #define CATEGORY_SET_P(x) \
65 (BOOL_VECTOR_P ((x)) && (EMACS_INT) (XBOOL_VECTOR ((x))->size) == 128) 63 (BOOL_VECTOR_P ((x)) && (EMACS_INT) (XBOOL_VECTOR ((x))->size) == 128)
70 /* Make CATEGORY_SET includes (if VAL is t) or excludes (if VAL is 68 /* Make CATEGORY_SET includes (if VAL is t) or excludes (if VAL is
71 nil) CATEGORY. */ 69 nil) CATEGORY. */
72 #define SET_CATEGORY_SET(category_set, category, val) \ 70 #define SET_CATEGORY_SET(category_set, category, val) \
73 (Faset (category_set, category, val)) 71 (Faset (category_set, category, val))
74 72
75 #define CHECK_CATEGORY_SET(x) \ 73 #define CHECK_CATEGORY_SET(x) \
76 do { \ 74 CHECK_TYPE (CATEGORY_SET_P (x), Qcategorysetp, x)
77 if (!CATEGORY_SET_P ((x))) x = wrong_type_argument (Qcategorysetp, (x)); \
78 } while (0)
79 75
80 /* Return 1 if CATEGORY_SET contains CATEGORY, else return 0. 76 /* Return 1 if CATEGORY_SET contains CATEGORY, else return 0.
81 The faster version of `!NILP (Faref (category_set, category))'. */ 77 The faster version of `!NILP (Faref (category_set, category))'. */
82 #define CATEGORY_MEMBER(category, category_set) \ 78 #define CATEGORY_MEMBER(category, category_set) \
83 (XCATEGORY_SET (category_set)->data[(category) / 8] \ 79 (XCATEGORY_SET (category_set)->data[(category) / 8] \