+2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ * casefiddle.c, casetab.c, category.c: Use bool for boolean.
+ * casefiddle.c (casify_object, casify_region):
+ * casetab.c (set_case_table):
+ * category.c, category.h (word_boundary_p):
+ * category.h (CHAR_HAS_CATEGORY):
+ Use bool for booleans, instead of int.
+
2012-08-25 Eli Zaretskii <eliz@gnu.org>
* makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
static Lisp_Object
casify_object (enum case_action flag, Lisp_Object obj)
{
- register int c, c1;
- register int inword = flag == CASE_DOWN;
+ int c, c1;
+ bool inword = flag == CASE_DOWN;
/* If the case table is flagged as modified, rescan it. */
if (NILP (XCHAR_TABLE (BVAR (current_buffer, downcase_table))->extras[1]))
int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER
| CHAR_SHIFT | CHAR_CTL | CHAR_META);
int flags = XINT (obj) & flagbits;
- int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
+ bool multibyte = ! NILP (BVAR (current_buffer,
+ enable_multibyte_characters));
/* If the character has higher bits set
above the flags, return it unchanged.
static void
casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
{
- register int c;
- register int inword = flag == CASE_DOWN;
- register int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
+ int c;
+ bool inword = flag == CASE_DOWN;
+ bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
ptrdiff_t start, end;
ptrdiff_t start_byte;
return Vascii_downcase_table;
}
-static Lisp_Object set_case_table (Lisp_Object table, int standard);
+static Lisp_Object set_case_table (Lisp_Object, bool);
DEFUN ("set-case-table", Fset_case_table, Sset_case_table, 1, 1, 0,
doc: /* Select a new case table for the current buffer.
}
static Lisp_Object
-set_case_table (Lisp_Object table, int standard)
+set_case_table (Lisp_Object table, bool standard)
{
Lisp_Object up, canon, eqv;
return Qnil;
}
\f
-/* Return 1 if there is a word boundary between two word-constituent
- characters C1 and C2 if they appear in this order, else return 0.
+/* Return true if there is a word boundary between two word-constituent
+ characters C1 and C2 if they appear in this order.
Use the macro WORD_BOUNDARY_P instead of calling this function
directly. */
-int
+bool
word_boundary_p (int c1, int c2)
{
Lisp_Object category_set1, category_set2;
Lisp_Object tail;
- int default_result;
+ bool default_result;
if (EQ (CHAR_TABLE_REF (Vchar_script_table, c1),
CHAR_TABLE_REF (Vchar_script_table, c2)))
/* 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.
+/* Return true if CATEGORY_SET contains CATEGORY.
The faster version of `!NILP (Faref (category_set, category))'. */
#define CATEGORY_MEMBER(category, category_set) \
((XCATEGORY_SET (category_set)->data[(category) / 8] \
>> ((category) % 8)) & 1)
-/* Return 1 if category set of CH contains CATEGORY, else return 0. */
-CATEGORY_INLINE int
+/* Return true if category set of CH contains CATEGORY. */
+CATEGORY_INLINE bool
CHAR_HAS_CATEGORY (int ch, int category)
{
Lisp_Object category_set = CATEGORY_SET (ch);
#define CATEGORY_TABLE_VERSION (table) \
Fchar_table_extra_slot (table, make_number (1))
-/* Return 1 if there is a word boundary between two word-constituent
- characters C1 and C2 if they appear in this order, else return 0.
+/* Return true if there is a word boundary between two
+ word-constituent characters C1 and C2 if they appear in this order.
There is no word boundary between two word-constituent ASCII and
Latin-1 characters. */
#define WORD_BOUNDARY_P(c1, c2) \
(!(SINGLE_BYTE_CHAR_P (c1) && SINGLE_BYTE_CHAR_P (c2)) \
&& word_boundary_p (c1, c2))
-extern int word_boundary_p (int, int);
+extern bool word_boundary_p (int, int);
INLINE_HEADER_END