Commit 17c05d74 authored by Paul Eggert's avatar Paul Eggert
Browse files

* 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.
parent 391ceac5
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> 2012-08-25 Eli Zaretskii <eliz@gnu.org>
   
* makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h. * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
......
...@@ -35,8 +35,8 @@ Lisp_Object Qidentity; ...@@ -35,8 +35,8 @@ Lisp_Object Qidentity;
static Lisp_Object static Lisp_Object
casify_object (enum case_action flag, Lisp_Object obj) casify_object (enum case_action flag, Lisp_Object obj)
{ {
register int c, c1; int c, c1;
register int inword = flag == CASE_DOWN; bool inword = flag == CASE_DOWN;
/* If the case table is flagged as modified, rescan it. */ /* If the case table is flagged as modified, rescan it. */
if (NILP (XCHAR_TABLE (BVAR (current_buffer, downcase_table))->extras[1])) if (NILP (XCHAR_TABLE (BVAR (current_buffer, downcase_table))->extras[1]))
...@@ -47,7 +47,8 @@ casify_object (enum case_action flag, Lisp_Object obj) ...@@ -47,7 +47,8 @@ casify_object (enum case_action flag, Lisp_Object obj)
int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER
| CHAR_SHIFT | CHAR_CTL | CHAR_META); | CHAR_SHIFT | CHAR_CTL | CHAR_META);
int flags = XINT (obj) & flagbits; 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 /* If the character has higher bits set
above the flags, return it unchanged. above the flags, return it unchanged.
...@@ -189,9 +190,9 @@ The argument object is not altered--the value is a copy. */) ...@@ -189,9 +190,9 @@ The argument object is not altered--the value is a copy. */)
static void static void
casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e) casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
{ {
register int c; int c;
register int inword = flag == CASE_DOWN; bool inword = flag == CASE_DOWN;
register int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
ptrdiff_t start, end; ptrdiff_t start, end;
ptrdiff_t start_byte; ptrdiff_t start_byte;
......
...@@ -79,7 +79,7 @@ This is the one used for new buffers. */) ...@@ -79,7 +79,7 @@ This is the one used for new buffers. */)
return Vascii_downcase_table; 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, DEFUN ("set-case-table", Fset_case_table, Sset_case_table, 1, 1, 0,
doc: /* Select a new case table for the current buffer. doc: /* Select a new case table for the current buffer.
...@@ -113,7 +113,7 @@ See `set-case-table' for more info on case tables. */) ...@@ -113,7 +113,7 @@ See `set-case-table' for more info on case tables. */)
} }
static Lisp_Object static Lisp_Object
set_case_table (Lisp_Object table, int standard) set_case_table (Lisp_Object table, bool standard)
{ {
Lisp_Object up, canon, eqv; Lisp_Object up, canon, eqv;
......
...@@ -406,17 +406,17 @@ then delete CATEGORY from the category set instead of adding it. */) ...@@ -406,17 +406,17 @@ then delete CATEGORY from the category set instead of adding it. */)
return Qnil; return Qnil;
} }
/* Return 1 if there is a word boundary between two word-constituent /* Return true if there is a word boundary between two word-constituent
characters C1 and C2 if they appear in this order, else return 0. characters C1 and C2 if they appear in this order.
Use the macro WORD_BOUNDARY_P instead of calling this function Use the macro WORD_BOUNDARY_P instead of calling this function
directly. */ directly. */
int bool
word_boundary_p (int c1, int c2) word_boundary_p (int c1, int c2)
{ {
Lisp_Object category_set1, category_set2; Lisp_Object category_set1, category_set2;
Lisp_Object tail; Lisp_Object tail;
int default_result; bool default_result;
if (EQ (CHAR_TABLE_REF (Vchar_script_table, c1), if (EQ (CHAR_TABLE_REF (Vchar_script_table, c1),
CHAR_TABLE_REF (Vchar_script_table, c2))) CHAR_TABLE_REF (Vchar_script_table, c2)))
......
...@@ -77,14 +77,14 @@ INLINE_HEADER_BEGIN ...@@ -77,14 +77,14 @@ INLINE_HEADER_BEGIN
/* Return the category set of character C in the current category table. */ /* Return the category set of character C in the current category table. */
#define CATEGORY_SET(c) char_category_set (c) #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))'. */ The faster version of `!NILP (Faref (category_set, category))'. */
#define CATEGORY_MEMBER(category, category_set) \ #define CATEGORY_MEMBER(category, category_set) \
((XCATEGORY_SET (category_set)->data[(category) / 8] \ ((XCATEGORY_SET (category_set)->data[(category) / 8] \
>> ((category) % 8)) & 1) >> ((category) % 8)) & 1)
/* Return 1 if category set of CH contains CATEGORY, else return 0. */ /* Return true if category set of CH contains CATEGORY. */
CATEGORY_INLINE int CATEGORY_INLINE bool
CHAR_HAS_CATEGORY (int ch, int category) CHAR_HAS_CATEGORY (int ch, int category)
{ {
Lisp_Object category_set = CATEGORY_SET (ch); Lisp_Object category_set = CATEGORY_SET (ch);
...@@ -108,14 +108,14 @@ CHAR_HAS_CATEGORY (int ch, int category) ...@@ -108,14 +108,14 @@ CHAR_HAS_CATEGORY (int ch, int category)
#define CATEGORY_TABLE_VERSION (table) \ #define CATEGORY_TABLE_VERSION (table) \
Fchar_table_extra_slot (table, make_number (1)) Fchar_table_extra_slot (table, make_number (1))
/* Return 1 if there is a word boundary between two word-constituent /* Return true if there is a word boundary between two
characters C1 and C2 if they appear in this order, else return 0. word-constituent characters C1 and C2 if they appear in this order.
There is no word boundary between two word-constituent ASCII and There is no word boundary between two word-constituent ASCII and
Latin-1 characters. */ Latin-1 characters. */
#define WORD_BOUNDARY_P(c1, c2) \ #define WORD_BOUNDARY_P(c1, c2) \
(!(SINGLE_BYTE_CHAR_P (c1) && SINGLE_BYTE_CHAR_P (c2)) \ (!(SINGLE_BYTE_CHAR_P (c1) && SINGLE_BYTE_CHAR_P (c2)) \
&& word_boundary_p (c1, c2)) && word_boundary_p (c1, c2))
extern int word_boundary_p (int, int); extern bool word_boundary_p (int, int);
INLINE_HEADER_END INLINE_HEADER_END
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment