diff options
| author | Paul Eggert | 2012-08-24 23:25:00 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-08-24 23:25:00 -0700 |
| commit | 17c05d741e131e630ad83622ae7eceee67897016 (patch) | |
| tree | 88d281b4c3af45a6d805f30c72a5e3212edcd3c6 /src | |
| parent | 391ceac53ab07bc081eecc5a5ab82a044d06edd1 (diff) | |
| download | emacs-17c05d741e131e630ad83622ae7eceee67897016.tar.gz emacs-17c05d741e131e630ad83622ae7eceee67897016.zip | |
* 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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/casefiddle.c | 13 | ||||
| -rw-r--r-- | src/casetab.c | 4 | ||||
| -rw-r--r-- | src/category.c | 8 | ||||
| -rw-r--r-- | src/category.h | 12 |
5 files changed, 28 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1a836543d69..e509b9c315f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2012-08-25 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * casefiddle.c, casetab.c, category.c: Use bool for boolean. | ||
| 4 | * casefiddle.c (casify_object, casify_region): | ||
| 5 | * casetab.c (set_case_table): | ||
| 6 | * category.c, category.h (word_boundary_p): | ||
| 7 | * category.h (CHAR_HAS_CATEGORY): | ||
| 8 | Use bool for booleans, instead of int. | ||
| 9 | |||
| 1 | 2012-08-25 Eli Zaretskii <eliz@gnu.org> | 10 | 2012-08-25 Eli Zaretskii <eliz@gnu.org> |
| 2 | 11 | ||
| 3 | * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h. | 12 | * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h. |
diff --git a/src/casefiddle.c b/src/casefiddle.c index 81e84252b72..1102054b153 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c | |||
| @@ -35,8 +35,8 @@ Lisp_Object Qidentity; | |||
| 35 | static Lisp_Object | 35 | static Lisp_Object |
| 36 | casify_object (enum case_action flag, Lisp_Object obj) | 36 | casify_object (enum case_action flag, Lisp_Object obj) |
| 37 | { | 37 | { |
| 38 | register int c, c1; | 38 | int c, c1; |
| 39 | register int inword = flag == CASE_DOWN; | 39 | bool inword = flag == CASE_DOWN; |
| 40 | 40 | ||
| 41 | /* If the case table is flagged as modified, rescan it. */ | 41 | /* If the case table is flagged as modified, rescan it. */ |
| 42 | if (NILP (XCHAR_TABLE (BVAR (current_buffer, downcase_table))->extras[1])) | 42 | 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 | int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER | 47 | int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER |
| 48 | | CHAR_SHIFT | CHAR_CTL | CHAR_META); | 48 | | CHAR_SHIFT | CHAR_CTL | CHAR_META); |
| 49 | int flags = XINT (obj) & flagbits; | 49 | int flags = XINT (obj) & flagbits; |
| 50 | int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); | 50 | bool multibyte = ! NILP (BVAR (current_buffer, |
| 51 | enable_multibyte_characters)); | ||
| 51 | 52 | ||
| 52 | /* If the character has higher bits set | 53 | /* If the character has higher bits set |
| 53 | above the flags, return it unchanged. | 54 | above the flags, return it unchanged. |
| @@ -189,9 +190,9 @@ The argument object is not altered--the value is a copy. */) | |||
| 189 | static void | 190 | static void |
| 190 | casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e) | 191 | casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e) |
| 191 | { | 192 | { |
| 192 | register int c; | 193 | int c; |
| 193 | register int inword = flag == CASE_DOWN; | 194 | bool inword = flag == CASE_DOWN; |
| 194 | register int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); | 195 | bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 195 | ptrdiff_t start, end; | 196 | ptrdiff_t start, end; |
| 196 | ptrdiff_t start_byte; | 197 | ptrdiff_t start_byte; |
| 197 | 198 | ||
diff --git a/src/casetab.c b/src/casetab.c index a163d5204f8..3e22d0d0b77 100644 --- a/src/casetab.c +++ b/src/casetab.c | |||
| @@ -79,7 +79,7 @@ This is the one used for new buffers. */) | |||
| 79 | return Vascii_downcase_table; | 79 | return Vascii_downcase_table; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | static Lisp_Object set_case_table (Lisp_Object table, int standard); | 82 | static Lisp_Object set_case_table (Lisp_Object, bool); |
| 83 | 83 | ||
| 84 | DEFUN ("set-case-table", Fset_case_table, Sset_case_table, 1, 1, 0, | 84 | DEFUN ("set-case-table", Fset_case_table, Sset_case_table, 1, 1, 0, |
| 85 | doc: /* Select a new case table for the current buffer. | 85 | 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 | } | 113 | } |
| 114 | 114 | ||
| 115 | static Lisp_Object | 115 | static Lisp_Object |
| 116 | set_case_table (Lisp_Object table, int standard) | 116 | set_case_table (Lisp_Object table, bool standard) |
| 117 | { | 117 | { |
| 118 | Lisp_Object up, canon, eqv; | 118 | Lisp_Object up, canon, eqv; |
| 119 | 119 | ||
diff --git a/src/category.c b/src/category.c index 1c9085fd558..80dc6938d8b 100644 --- a/src/category.c +++ b/src/category.c | |||
| @@ -406,17 +406,17 @@ then delete CATEGORY from the category set instead of adding it. */) | |||
| 406 | return Qnil; | 406 | return Qnil; |
| 407 | } | 407 | } |
| 408 | 408 | ||
| 409 | /* Return 1 if there is a word boundary between two word-constituent | 409 | /* Return true if there is a word boundary between two word-constituent |
| 410 | characters C1 and C2 if they appear in this order, else return 0. | 410 | characters C1 and C2 if they appear in this order. |
| 411 | Use the macro WORD_BOUNDARY_P instead of calling this function | 411 | Use the macro WORD_BOUNDARY_P instead of calling this function |
| 412 | directly. */ | 412 | directly. */ |
| 413 | 413 | ||
| 414 | int | 414 | bool |
| 415 | word_boundary_p (int c1, int c2) | 415 | word_boundary_p (int c1, int c2) |
| 416 | { | 416 | { |
| 417 | Lisp_Object category_set1, category_set2; | 417 | Lisp_Object category_set1, category_set2; |
| 418 | Lisp_Object tail; | 418 | Lisp_Object tail; |
| 419 | int default_result; | 419 | bool default_result; |
| 420 | 420 | ||
| 421 | if (EQ (CHAR_TABLE_REF (Vchar_script_table, c1), | 421 | if (EQ (CHAR_TABLE_REF (Vchar_script_table, c1), |
| 422 | CHAR_TABLE_REF (Vchar_script_table, c2))) | 422 | CHAR_TABLE_REF (Vchar_script_table, c2))) |
diff --git a/src/category.h b/src/category.h index 9fb981ed383..17cd203db45 100644 --- a/src/category.h +++ b/src/category.h | |||
| @@ -77,14 +77,14 @@ INLINE_HEADER_BEGIN | |||
| 77 | /* Return the category set of character C in the current category table. */ | 77 | /* Return the category set of character C in the current category table. */ |
| 78 | #define CATEGORY_SET(c) char_category_set (c) | 78 | #define CATEGORY_SET(c) char_category_set (c) |
| 79 | 79 | ||
| 80 | /* Return 1 if CATEGORY_SET contains CATEGORY, else return 0. | 80 | /* Return true if CATEGORY_SET contains CATEGORY. |
| 81 | The faster version of `!NILP (Faref (category_set, category))'. */ | 81 | The faster version of `!NILP (Faref (category_set, category))'. */ |
| 82 | #define CATEGORY_MEMBER(category, category_set) \ | 82 | #define CATEGORY_MEMBER(category, category_set) \ |
| 83 | ((XCATEGORY_SET (category_set)->data[(category) / 8] \ | 83 | ((XCATEGORY_SET (category_set)->data[(category) / 8] \ |
| 84 | >> ((category) % 8)) & 1) | 84 | >> ((category) % 8)) & 1) |
| 85 | 85 | ||
| 86 | /* Return 1 if category set of CH contains CATEGORY, else return 0. */ | 86 | /* Return true if category set of CH contains CATEGORY. */ |
| 87 | CATEGORY_INLINE int | 87 | CATEGORY_INLINE bool |
| 88 | CHAR_HAS_CATEGORY (int ch, int category) | 88 | CHAR_HAS_CATEGORY (int ch, int category) |
| 89 | { | 89 | { |
| 90 | Lisp_Object category_set = CATEGORY_SET (ch); | 90 | Lisp_Object category_set = CATEGORY_SET (ch); |
| @@ -108,14 +108,14 @@ CHAR_HAS_CATEGORY (int ch, int category) | |||
| 108 | #define CATEGORY_TABLE_VERSION (table) \ | 108 | #define CATEGORY_TABLE_VERSION (table) \ |
| 109 | Fchar_table_extra_slot (table, make_number (1)) | 109 | Fchar_table_extra_slot (table, make_number (1)) |
| 110 | 110 | ||
| 111 | /* Return 1 if there is a word boundary between two word-constituent | 111 | /* Return true if there is a word boundary between two |
| 112 | characters C1 and C2 if they appear in this order, else return 0. | 112 | word-constituent characters C1 and C2 if they appear in this order. |
| 113 | There is no word boundary between two word-constituent ASCII and | 113 | There is no word boundary between two word-constituent ASCII and |
| 114 | Latin-1 characters. */ | 114 | Latin-1 characters. */ |
| 115 | #define WORD_BOUNDARY_P(c1, c2) \ | 115 | #define WORD_BOUNDARY_P(c1, c2) \ |
| 116 | (!(SINGLE_BYTE_CHAR_P (c1) && SINGLE_BYTE_CHAR_P (c2)) \ | 116 | (!(SINGLE_BYTE_CHAR_P (c1) && SINGLE_BYTE_CHAR_P (c2)) \ |
| 117 | && word_boundary_p (c1, c2)) | 117 | && word_boundary_p (c1, c2)) |
| 118 | 118 | ||
| 119 | extern int word_boundary_p (int, int); | 119 | extern bool word_boundary_p (int, int); |
| 120 | 120 | ||
| 121 | INLINE_HEADER_END | 121 | INLINE_HEADER_END |