emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109768: * casefiddle.c, casetab.c, c


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109768: * casefiddle.c, casetab.c, category.c: Use bool for boolean.
Date: Fri, 24 Aug 2012 23:25:00 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109768
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Fri 2012-08-24 23:25:00 -0700
message:
  * 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.
modified:
  src/ChangeLog
  src/casefiddle.c
  src/casetab.c
  src/category.c
  src/category.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-08-25 05:55:32 +0000
+++ b/src/ChangeLog     2012-08-25 06:25:00 +0000
@@ -1,3 +1,12 @@
+2012-08-25  Paul Eggert  <address@hidden>
+
+       * 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  <address@hidden>
 
        * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.

=== modified file 'src/casefiddle.c'
--- a/src/casefiddle.c  2012-08-03 23:36:11 +0000
+++ b/src/casefiddle.c  2012-08-25 06:25:00 +0000
@@ -35,8 +35,8 @@
 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]))
@@ -47,7 +47,8 @@
       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.
@@ -189,9 +190,9 @@
 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;
 

=== modified file 'src/casetab.c'
--- a/src/casetab.c     2012-08-18 06:06:39 +0000
+++ b/src/casetab.c     2012-08-25 06:25:00 +0000
@@ -79,7 +79,7 @@
   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.
@@ -113,7 +113,7 @@
 }
 
 static Lisp_Object
-set_case_table (Lisp_Object table, int standard)
+set_case_table (Lisp_Object table, bool standard)
 {
   Lisp_Object up, canon, eqv;
 

=== modified file 'src/category.c'
--- a/src/category.c    2012-08-20 08:20:25 +0000
+++ b/src/category.c    2012-08-25 06:25:00 +0000
@@ -406,17 +406,17 @@
   return Qnil;
 }
 
-/* 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)))

=== modified file 'src/category.h'
--- a/src/category.h    2012-08-20 08:20:25 +0000
+++ b/src/category.h    2012-08-25 06:25:00 +0000
@@ -77,14 +77,14 @@
 /* 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);
@@ -108,14 +108,14 @@
 #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


reply via email to

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