aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2012-09-02 00:10:10 -0700
committerPaul Eggert2012-09-02 00:10:10 -0700
commita08d4ba773a70961d153bf213db68dfcc5a50b01 (patch)
tree5af3f41dc48af2352bf903bd613b38aac6c81159 /src
parent6a787d9a30720e20053909e71d8b7bc313d37a94 (diff)
downloademacs-a08d4ba773a70961d153bf213db68dfcc5a50b01.tar.gz
emacs-a08d4ba773a70961d153bf213db68dfcc5a50b01.zip
* doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
* doc.c (read_bytecode_char, get_doc_string, reread_doc_file) (Fdocumentation, Fdocumentation_property, Fsnarf_documentation) (Fsubstitute_command_keys): * editfns.c (region_limit, find_field, Fconstrain_to_field) (save_excursion_save, save_excursion_restore) (disassemble_lisp_time, decode_time_components, emacs_nmemftime) (format_time_string, general_insert_function) (make_buffer_string, make_buffer_string_both) (Fsubst_char_in_region, Ftranslate_region_internal, Fformat): * insdel.c (check_markers, gap_left, adjust_markers_for_insert) (copy_text, insert_1, insert_1_both, insert_from_string) (insert_from_string_before_markers, insert_from_string_1) (insert_from_buffer, insert_from_buffer_1, replace_range) (replace_range_2, del_range_1, del_range_byte, del_range_both) (del_range_2, modify_region): * intervals.c (intervals_equal, balance_possible_root_interval) (adjust_intervals_for_insertion, merge_properties_sticky) (graft_intervals_into_buffer, lookup_char_property) (adjust_for_invis_intang, set_point_both) (get_property_and_range, compare_string_intervals) (set_intervals_multibyte_1, set_intervals_multibyte): * keyboard.c (decode_timer): Use bool for boolean. * intervals.h, lisp.h, systime.h: Reflect above API changes. * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog29
-rw-r--r--src/doc.c39
-rw-r--r--src/editfns.c91
-rw-r--r--src/insdel.c72
-rw-r--r--src/intervals.c58
-rw-r--r--src/intervals.h14
-rw-r--r--src/keyboard.c7
-rw-r--r--src/lisp.h34
-rw-r--r--src/systime.h4
9 files changed, 184 insertions, 164 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index cb1ef00a542..0bcfa6c85f6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,32 @@
12012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2
3 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
5 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6 (Fsubstitute_command_keys):
7 * editfns.c (region_limit, find_field, Fconstrain_to_field)
8 (save_excursion_save, save_excursion_restore)
9 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
10 (format_time_string, general_insert_function)
11 (make_buffer_string, make_buffer_string_both)
12 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
13 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
14 (copy_text, insert_1, insert_1_both, insert_from_string)
15 (insert_from_string_before_markers, insert_from_string_1)
16 (insert_from_buffer, insert_from_buffer_1, replace_range)
17 (replace_range_2, del_range_1, del_range_byte, del_range_both)
18 (del_range_2, modify_region):
19 * intervals.c (intervals_equal, balance_possible_root_interval)
20 (adjust_intervals_for_insertion, merge_properties_sticky)
21 (graft_intervals_into_buffer, lookup_char_property)
22 (adjust_for_invis_intang, set_point_both)
23 (get_property_and_range, compare_string_intervals)
24 (set_intervals_multibyte_1, set_intervals_multibyte):
25 * keyboard.c (decode_timer):
26 Use bool for boolean.
27 * intervals.h, lisp.h, systime.h: Reflect above API changes.
28 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
29
12012-09-02 Chong Yidong <cyd@gnu.org> 302012-09-02 Chong Yidong <cyd@gnu.org>
2 31
3 * keymap.c (push_key_description): Print M-TAB as C-M-i 32 * keymap.c (push_key_description): Print M-TAB as C-M-i
diff --git a/src/doc.c b/src/doc.c
index ed311d918d7..b4eadfff875 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -48,7 +48,7 @@ static unsigned char *read_bytecode_pointer;
48 If UNREADFLAG is 1, we unread a byte. */ 48 If UNREADFLAG is 1, we unread a byte. */
49 49
50int 50int
51read_bytecode_char (int unreadflag) 51read_bytecode_char (bool unreadflag)
52{ 52{
53 if (unreadflag) 53 if (unreadflag)
54 { 54 {
@@ -70,20 +70,18 @@ read_bytecode_char (int unreadflag)
70 (e.g. because the file has been modified and the location is stale), 70 (e.g. because the file has been modified and the location is stale),
71 return nil. 71 return nil.
72 72
73 If UNIBYTE is nonzero, always make a unibyte string. 73 If UNIBYTE, always make a unibyte string.
74 74
75 If DEFINITION is nonzero, assume this is for reading 75 If DEFINITION, assume this is for reading
76 a dynamic function definition; convert the bytestring 76 a dynamic function definition; convert the bytestring
77 and the constants vector with appropriate byte handling, 77 and the constants vector with appropriate byte handling,
78 and return a cons cell. */ 78 and return a cons cell. */
79 79
80Lisp_Object 80Lisp_Object
81get_doc_string (Lisp_Object filepos, int unibyte, int definition) 81get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
82{ 82{
83 char *from, *to; 83 char *from, *to, *name, *p, *p1;
84 register int fd; 84 int fd;
85 register char *name;
86 register char *p, *p1;
87 ptrdiff_t minsize; 85 ptrdiff_t minsize;
88 int offset; 86 int offset;
89 EMACS_INT position; 87 EMACS_INT position;
@@ -302,7 +300,7 @@ read_doc_string (Lisp_Object filepos)
302 return get_doc_string (filepos, 0, 1); 300 return get_doc_string (filepos, 0, 1);
303} 301}
304 302
305static int 303static bool
306reread_doc_file (Lisp_Object file) 304reread_doc_file (Lisp_Object file)
307{ 305{
308#if 0 306#if 0
@@ -335,7 +333,7 @@ string is passed through `substitute-command-keys'. */)
335 Lisp_Object fun; 333 Lisp_Object fun;
336 Lisp_Object funcar; 334 Lisp_Object funcar;
337 Lisp_Object doc; 335 Lisp_Object doc;
338 int try_reload = 1; 336 bool try_reload = 1;
339 337
340 documentation: 338 documentation:
341 339
@@ -467,7 +465,7 @@ This differs from `get' in that it can refer to strings stored in the
467aren't strings. */) 465aren't strings. */)
468 (Lisp_Object symbol, Lisp_Object prop, Lisp_Object raw) 466 (Lisp_Object symbol, Lisp_Object prop, Lisp_Object raw)
469{ 467{
470 int try_reload = 1; 468 bool try_reload = 1;
471 Lisp_Object tem; 469 Lisp_Object tem;
472 470
473 documentation_property: 471 documentation_property:
@@ -562,12 +560,11 @@ the same file name is found in the `doc-directory'. */)
562{ 560{
563 int fd; 561 int fd;
564 char buf[1024 + 1]; 562 char buf[1024 + 1];
565 register int filled; 563 int filled;
566 register EMACS_INT pos; 564 EMACS_INT pos;
567 register char *p;
568 Lisp_Object sym; 565 Lisp_Object sym;
569 char *name; 566 char *p, *name;
570 int skip_file = 0; 567 bool skip_file = 0;
571 568
572 CHECK_STRING (filename); 569 CHECK_STRING (filename);
573 570
@@ -722,9 +719,9 @@ Otherwise, return a new string, without any text properties. */)
722 (Lisp_Object string) 719 (Lisp_Object string)
723{ 720{
724 char *buf; 721 char *buf;
725 int changed = 0; 722 bool changed = 0;
726 register unsigned char *strp; 723 unsigned char *strp;
727 register char *bufp; 724 char *bufp;
728 ptrdiff_t idx; 725 ptrdiff_t idx;
729 ptrdiff_t bsize; 726 ptrdiff_t bsize;
730 Lisp_Object tem; 727 Lisp_Object tem;
@@ -733,7 +730,7 @@ Otherwise, return a new string, without any text properties. */)
733 ptrdiff_t length, length_byte; 730 ptrdiff_t length, length_byte;
734 Lisp_Object name; 731 Lisp_Object name;
735 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 732 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
736 int multibyte; 733 bool multibyte;
737 ptrdiff_t nchars; 734 ptrdiff_t nchars;
738 735
739 if (NILP (string)) 736 if (NILP (string))
@@ -787,7 +784,7 @@ Otherwise, return a new string, without any text properties. */)
787 else if (strp[0] == '\\' && strp[1] == '[') 784 else if (strp[0] == '\\' && strp[1] == '[')
788 { 785 {
789 ptrdiff_t start_idx; 786 ptrdiff_t start_idx;
790 int follow_remap = 1; 787 bool follow_remap = 1;
791 788
792 changed = 1; 789 changed = 1;
793 strp += 2; /* skip \[ */ 790 strp += 2; /* skip \[ */
diff --git a/src/editfns.c b/src/editfns.c
index 7b451e4e443..a14e043c1bf 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -65,7 +65,7 @@ extern Lisp_Object w32_get_internal_run_time (void);
65#endif 65#endif
66 66
67static Lisp_Object format_time_string (char const *, ptrdiff_t, EMACS_TIME, 67static Lisp_Object format_time_string (char const *, ptrdiff_t, EMACS_TIME,
68 int, struct tm *); 68 bool, struct tm *);
69static int tm_diff (struct tm *, struct tm *); 69static int tm_diff (struct tm *, struct tm *);
70static void update_buffer_properties (ptrdiff_t, ptrdiff_t); 70static void update_buffer_properties (ptrdiff_t, ptrdiff_t);
71 71
@@ -246,11 +246,11 @@ The return value is POSITION. */)
246 246
247 247
248/* Return the start or end position of the region. 248/* Return the start or end position of the region.
249 BEGINNINGP non-zero means return the start. 249 BEGINNINGP means return the start.
250 If there is no region active, signal an error. */ 250 If there is no region active, signal an error. */
251 251
252static Lisp_Object 252static Lisp_Object
253region_limit (int beginningp) 253region_limit (bool beginningp)
254{ 254{
255 Lisp_Object m; 255 Lisp_Object m;
256 256
@@ -264,7 +264,7 @@ region_limit (int beginningp)
264 error ("The mark is not set now, so there is no region"); 264 error ("The mark is not set now, so there is no region");
265 265
266 /* Clip to the current narrowing (bug#11770). */ 266 /* Clip to the current narrowing (bug#11770). */
267 return make_number ((PT < XFASTINT (m)) == (beginningp != 0) 267 return make_number ((PT < XFASTINT (m)) == beginningp
268 ? PT 268 ? PT
269 : clip_to_bounds (BEGV, XFASTINT (m), ZV)); 269 : clip_to_bounds (BEGV, XFASTINT (m), ZV));
270} 270}
@@ -435,12 +435,12 @@ get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object o
435 BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned 435 BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned
436 results; they do not effect boundary behavior. 436 results; they do not effect boundary behavior.
437 437
438 If MERGE_AT_BOUNDARY is nonzero, then if POS is at the very first 438 If MERGE_AT_BOUNDARY is non-nil, then if POS is at the very first
439 position of a field, then the beginning of the previous field is 439 position of a field, then the beginning of the previous field is
440 returned instead of the beginning of POS's field (since the end of a 440 returned instead of the beginning of POS's field (since the end of a
441 field is actually also the beginning of the next input field, this 441 field is actually also the beginning of the next input field, this
442 behavior is sometimes useful). Additionally in the MERGE_AT_BOUNDARY 442 behavior is sometimes useful). Additionally in the MERGE_AT_BOUNDARY
443 true case, if two fields are separated by a field with the special 443 non-nil case, if two fields are separated by a field with the special
444 value `boundary', and POS lies within it, then the two separated 444 value `boundary', and POS lies within it, then the two separated
445 fields are considered to be adjacent, and POS between them, when 445 fields are considered to be adjacent, and POS between them, when
446 finding the beginning and ending of the "merged" field. 446 finding the beginning and ending of the "merged" field.
@@ -455,10 +455,10 @@ find_field (Lisp_Object pos, Lisp_Object merge_at_boundary,
455{ 455{
456 /* Fields right before and after the point. */ 456 /* Fields right before and after the point. */
457 Lisp_Object before_field, after_field; 457 Lisp_Object before_field, after_field;
458 /* 1 if POS counts as the start of a field. */ 458 /* True if POS counts as the start of a field. */
459 int at_field_start = 0; 459 bool at_field_start = 0;
460 /* 1 if POS counts as the end of a field. */ 460 /* True if POS counts as the end of a field. */
461 int at_field_end = 0; 461 bool at_field_end = 0;
462 462
463 if (NILP (pos)) 463 if (NILP (pos))
464 XSETFASTINT (pos, PT); 464 XSETFASTINT (pos, PT);
@@ -502,19 +502,19 @@ find_field (Lisp_Object pos, Lisp_Object merge_at_boundary,
502 502
503 xxxx.yyyy 503 xxxx.yyyy
504 504
505 In this situation, if merge_at_boundary is true, we consider the 505 In this situation, if merge_at_boundary is non-nil, consider the
506 `x' and `y' fields as forming one big merged field, and so the end 506 `x' and `y' fields as forming one big merged field, and so the end
507 of the field is the end of `y'. 507 of the field is the end of `y'.
508 508
509 However, if `x' and `y' are separated by a special `boundary' field 509 However, if `x' and `y' are separated by a special `boundary' field
510 (a field with a `field' char-property of 'boundary), then we ignore 510 (a field with a `field' char-property of 'boundary), then ignore
511 this special field when merging adjacent fields. Here's the same 511 this special field when merging adjacent fields. Here's the same
512 situation, but with a `boundary' field between the `x' and `y' fields: 512 situation, but with a `boundary' field between the `x' and `y' fields:
513 513
514 xxx.BBBByyyy 514 xxx.BBBByyyy
515 515
516 Here, if point is at the end of `x', the beginning of `y', or 516 Here, if point is at the end of `x', the beginning of `y', or
517 anywhere in-between (within the `boundary' field), we merge all 517 anywhere in-between (within the `boundary' field), merge all
518 three fields and consider the beginning as being the beginning of 518 three fields and consider the beginning as being the beginning of
519 the `x' field, and the end as being the end of the `y' field. */ 519 the `x' field, and the end as being the end of the `y' field. */
520 520
@@ -658,7 +658,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */)
658{ 658{
659 /* If non-zero, then the original point, before re-positioning. */ 659 /* If non-zero, then the original point, before re-positioning. */
660 ptrdiff_t orig_point = 0; 660 ptrdiff_t orig_point = 0;
661 int fwd; 661 bool fwd;
662 Lisp_Object prev_old, prev_new; 662 Lisp_Object prev_old, prev_new;
663 663
664 if (NILP (new_pos)) 664 if (NILP (new_pos))
@@ -816,8 +816,8 @@ This function does not move point. */)
816Lisp_Object 816Lisp_Object
817save_excursion_save (void) 817save_excursion_save (void)
818{ 818{
819 int visible = (XBUFFER (XWINDOW (selected_window)->buffer) 819 bool visible = (XBUFFER (XWINDOW (selected_window)->buffer)
820 == current_buffer); 820 == current_buffer);
821 821
822 return Fcons (Fpoint_marker (), 822 return Fcons (Fpoint_marker (),
823 Fcons (Fcopy_marker (BVAR (current_buffer, mark), Qnil), 823 Fcons (Fcopy_marker (BVAR (current_buffer, mark), Qnil),
@@ -831,7 +831,7 @@ save_excursion_restore (Lisp_Object info)
831{ 831{
832 Lisp_Object tem, tem1, omark, nmark; 832 Lisp_Object tem, tem1, omark, nmark;
833 struct gcpro gcpro1, gcpro2, gcpro3; 833 struct gcpro gcpro1, gcpro2, gcpro3;
834 int visible_p; 834 bool visible_p;
835 835
836 tem = Fmarker_buffer (XCAR (info)); 836 tem = Fmarker_buffer (XCAR (info));
837 /* If buffer being returned to is now deleted, avoid error */ 837 /* If buffer being returned to is now deleted, avoid error */
@@ -1467,8 +1467,8 @@ make_lisp_time (EMACS_TIME t)
1467 1467
1468/* Decode a Lisp list SPECIFIED_TIME that represents a time. 1468/* Decode a Lisp list SPECIFIED_TIME that represents a time.
1469 Set *PHIGH, *PLOW, *PUSEC, *PPSEC to its parts; do not check their values. 1469 Set *PHIGH, *PLOW, *PUSEC, *PPSEC to its parts; do not check their values.
1470 Return nonzero if successful. */ 1470 Return true if successful. */
1471static int 1471static bool
1472disassemble_lisp_time (Lisp_Object specified_time, Lisp_Object *phigh, 1472disassemble_lisp_time (Lisp_Object specified_time, Lisp_Object *phigh,
1473 Lisp_Object *plow, Lisp_Object *pusec, 1473 Lisp_Object *plow, Lisp_Object *pusec,
1474 Lisp_Object *ppsec) 1474 Lisp_Object *ppsec)
@@ -1511,8 +1511,8 @@ disassemble_lisp_time (Lisp_Object specified_time, Lisp_Object *phigh,
1511 If *DRESULT is not null, store into *DRESULT the number of 1511 If *DRESULT is not null, store into *DRESULT the number of
1512 seconds since the start of the POSIX Epoch. 1512 seconds since the start of the POSIX Epoch.
1513 1513
1514 Return nonzero if successful. */ 1514 Return true if successful. */
1515int 1515bool
1516decode_time_components (Lisp_Object high, Lisp_Object low, Lisp_Object usec, 1516decode_time_components (Lisp_Object high, Lisp_Object low, Lisp_Object usec,
1517 Lisp_Object psec, 1517 Lisp_Object psec,
1518 EMACS_TIME *result, double *dresult) 1518 EMACS_TIME *result, double *dresult)
@@ -1632,7 +1632,7 @@ or (if you need time as a string) `format-time-string'. */)
1632 1632
1633/* Write information into buffer S of size MAXSIZE, according to the 1633/* Write information into buffer S of size MAXSIZE, according to the
1634 FORMAT of length FORMAT_LEN, using time information taken from *TP. 1634 FORMAT of length FORMAT_LEN, using time information taken from *TP.
1635 Default to Universal Time if UT is nonzero, local time otherwise. 1635 Default to Universal Time if UT, local time otherwise.
1636 Use NS as the number of nanoseconds in the %N directive. 1636 Use NS as the number of nanoseconds in the %N directive.
1637 Return the number of bytes written, not including the terminating 1637 Return the number of bytes written, not including the terminating
1638 '\0'. If S is NULL, nothing will be written anywhere; so to 1638 '\0'. If S is NULL, nothing will be written anywhere; so to
@@ -1643,7 +1643,7 @@ or (if you need time as a string) `format-time-string'. */)
1643 bytes in FORMAT and it does not support nanoseconds. */ 1643 bytes in FORMAT and it does not support nanoseconds. */
1644static size_t 1644static size_t
1645emacs_nmemftime (char *s, size_t maxsize, const char *format, 1645emacs_nmemftime (char *s, size_t maxsize, const char *format,
1646 size_t format_len, const struct tm *tp, int ut, int ns) 1646 size_t format_len, const struct tm *tp, bool ut, int ns)
1647{ 1647{
1648 size_t total = 0; 1648 size_t total = 0;
1649 1649
@@ -1748,7 +1748,7 @@ usage: (format-time-string FORMAT-STRING &optional TIME UNIVERSAL) */)
1748 1748
1749static Lisp_Object 1749static Lisp_Object
1750format_time_string (char const *format, ptrdiff_t formatlen, 1750format_time_string (char const *format, ptrdiff_t formatlen,
1751 EMACS_TIME t, int ut, struct tm *tmp) 1751 EMACS_TIME t, bool ut, struct tm *tmp)
1752{ 1752{
1753 char buffer[4000]; 1753 char buffer[4000];
1754 char *buf = buffer; 1754 char *buf = buffer;
@@ -2228,11 +2228,11 @@ general_insert_function (void (*insert_func)
2228 (const char *, ptrdiff_t), 2228 (const char *, ptrdiff_t),
2229 void (*insert_from_string_func) 2229 void (*insert_from_string_func)
2230 (Lisp_Object, ptrdiff_t, ptrdiff_t, 2230 (Lisp_Object, ptrdiff_t, ptrdiff_t,
2231 ptrdiff_t, ptrdiff_t, int), 2231 ptrdiff_t, ptrdiff_t, bool),
2232 int inherit, ptrdiff_t nargs, Lisp_Object *args) 2232 bool inherit, ptrdiff_t nargs, Lisp_Object *args)
2233{ 2233{
2234 ptrdiff_t argnum; 2234 ptrdiff_t argnum;
2235 register Lisp_Object val; 2235 Lisp_Object val;
2236 2236
2237 for (argnum = 0; argnum < nargs; argnum++) 2237 for (argnum = 0; argnum < nargs; argnum++)
2238 { 2238 {
@@ -2455,7 +2455,7 @@ from adjoining text, if those properties are sticky. */)
2455/* Return a Lisp_String containing the text of the current buffer from 2455/* Return a Lisp_String containing the text of the current buffer from
2456 START to END. If text properties are in use and the current buffer 2456 START to END. If text properties are in use and the current buffer
2457 has properties in the range specified, the resulting string will also 2457 has properties in the range specified, the resulting string will also
2458 have them, if PROPS is nonzero. 2458 have them, if PROPS is true.
2459 2459
2460 We don't want to use plain old make_string here, because it calls 2460 We don't want to use plain old make_string here, because it calls
2461 make_uninit_string, which can cause the buffer arena to be 2461 make_uninit_string, which can cause the buffer arena to be
@@ -2466,7 +2466,7 @@ from adjoining text, if those properties are sticky. */)
2466 buffer substrings. */ 2466 buffer substrings. */
2467 2467
2468Lisp_Object 2468Lisp_Object
2469make_buffer_string (ptrdiff_t start, ptrdiff_t end, int props) 2469make_buffer_string (ptrdiff_t start, ptrdiff_t end, bool props)
2470{ 2470{
2471 ptrdiff_t start_byte = CHAR_TO_BYTE (start); 2471 ptrdiff_t start_byte = CHAR_TO_BYTE (start);
2472 ptrdiff_t end_byte = CHAR_TO_BYTE (end); 2472 ptrdiff_t end_byte = CHAR_TO_BYTE (end);
@@ -2479,7 +2479,7 @@ make_buffer_string (ptrdiff_t start, ptrdiff_t end, int props)
2479 2479
2480 If text properties are in use and the current buffer 2480 If text properties are in use and the current buffer
2481 has properties in the range specified, the resulting string will also 2481 has properties in the range specified, the resulting string will also
2482 have them, if PROPS is nonzero. 2482 have them, if PROPS is true.
2483 2483
2484 We don't want to use plain old make_string here, because it calls 2484 We don't want to use plain old make_string here, because it calls
2485 make_uninit_string, which can cause the buffer arena to be 2485 make_uninit_string, which can cause the buffer arena to be
@@ -2491,7 +2491,7 @@ make_buffer_string (ptrdiff_t start, ptrdiff_t end, int props)
2491 2491
2492Lisp_Object 2492Lisp_Object
2493make_buffer_string_both (ptrdiff_t start, ptrdiff_t start_byte, 2493make_buffer_string_both (ptrdiff_t start, ptrdiff_t start_byte,
2494 ptrdiff_t end, ptrdiff_t end_byte, int props) 2494 ptrdiff_t end, ptrdiff_t end_byte, bool props)
2495{ 2495{
2496 Lisp_Object result, tem, tem1; 2496 Lisp_Object result, tem, tem1;
2497 2497
@@ -2842,7 +2842,8 @@ Both characters must have the same length of multi-byte form. */)
2842#define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER) 2842#define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER)
2843 int maybe_byte_combining = COMBINING_NO; 2843 int maybe_byte_combining = COMBINING_NO;
2844 ptrdiff_t last_changed = 0; 2844 ptrdiff_t last_changed = 0;
2845 int multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters)); 2845 bool multibyte_p
2846 = !NILP (BVAR (current_buffer, enable_multibyte_characters));
2846 int fromc, toc; 2847 int fromc, toc;
2847 2848
2848 restart: 2849 restart:
@@ -3078,8 +3079,8 @@ It returns the number of characters changed. */)
3078 int cnt; /* Number of changes made. */ 3079 int cnt; /* Number of changes made. */
3079 ptrdiff_t size; /* Size of translate table. */ 3080 ptrdiff_t size; /* Size of translate table. */
3080 ptrdiff_t pos, pos_byte, end_pos; 3081 ptrdiff_t pos, pos_byte, end_pos;
3081 int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); 3082 bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
3082 int string_multibyte IF_LINT (= 0); 3083 bool string_multibyte IF_LINT (= 0);
3083 3084
3084 validate_region (&start, &end); 3085 validate_region (&start, &end);
3085 if (CHAR_TABLE_P (table)) 3086 if (CHAR_TABLE_P (table))
@@ -3650,9 +3651,9 @@ usage: (format STRING &rest OBJECTS) */)
3650 byte combining problem, i.e., a byte may be combined with a 3651 byte combining problem, i.e., a byte may be combined with a
3651 multibyte character of the previous string. This flag tells if we 3652 multibyte character of the previous string. This flag tells if we
3652 must consider such a situation or not. */ 3653 must consider such a situation or not. */
3653 int maybe_combine_byte; 3654 bool maybe_combine_byte;
3654 Lisp_Object val; 3655 Lisp_Object val;
3655 int arg_intervals = 0; 3656 bool arg_intervals = 0;
3656 USE_SAFE_ALLOCA; 3657 USE_SAFE_ALLOCA;
3657 3658
3658 /* discarded[I] is 1 if byte I of the format 3659 /* discarded[I] is 1 if byte I of the format
@@ -3668,8 +3669,8 @@ usage: (format STRING &rest OBJECTS) */)
3668 struct info 3669 struct info
3669 { 3670 {
3670 ptrdiff_t start, end; 3671 ptrdiff_t start, end;
3671 int converted_to_string; 3672 unsigned converted_to_string : 1;
3672 int intervals; 3673 unsigned intervals : 1;
3673 } *info = 0; 3674 } *info = 0;
3674 3675
3675 /* It should not be necessary to GCPRO ARGS, because 3676 /* It should not be necessary to GCPRO ARGS, because
@@ -3746,13 +3747,13 @@ usage: (format STRING &rest OBJECTS) */)
3746 digits to print after the '.' for floats, or the max. 3747 digits to print after the '.' for floats, or the max.
3747 number of chars to print from a string. */ 3748 number of chars to print from a string. */
3748 3749
3749 int minus_flag = 0; 3750 bool minus_flag = 0;
3750 int plus_flag = 0; 3751 bool plus_flag = 0;
3751 int space_flag = 0; 3752 bool space_flag = 0;
3752 int sharp_flag = 0; 3753 bool sharp_flag = 0;
3753 int zero_flag = 0; 3754 bool zero_flag = 0;
3754 ptrdiff_t field_width; 3755 ptrdiff_t field_width;
3755 int precision_given; 3756 bool precision_given;
3756 uintmax_t precision = UINTMAX_MAX; 3757 uintmax_t precision = UINTMAX_MAX;
3757 char *num_end; 3758 char *num_end;
3758 char conversion; 3759 char conversion;
@@ -4132,7 +4133,7 @@ usage: (format STRING &rest OBJECTS) */)
4132 char *src = sprintf_buf; 4133 char *src = sprintf_buf;
4133 char src0 = src[0]; 4134 char src0 = src[0];
4134 int exponent_bytes = 0; 4135 int exponent_bytes = 0;
4135 int signedp = src0 == '-' || src0 == '+' || src0 == ' '; 4136 bool signedp = src0 == '-' || src0 == '+' || src0 == ' ';
4136 int significand_bytes; 4137 int significand_bytes;
4137 if (zero_flag 4138 if (zero_flag
4138 && ((src[signedp] >= '0' && src[signedp] <= '9') 4139 && ((src[signedp] >= '0' && src[signedp] <= '9')
diff --git a/src/insdel.c b/src/insdel.c
index 8cb98566085..da258c19a1e 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -31,19 +31,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31#include "blockinput.h" 31#include "blockinput.h"
32#include "region-cache.h" 32#include "region-cache.h"
33 33
34static void insert_from_string_1 (Lisp_Object string, 34static void insert_from_string_1 (Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t,
35 ptrdiff_t pos, ptrdiff_t pos_byte, 35 ptrdiff_t, bool, bool);
36 ptrdiff_t nchars, ptrdiff_t nbytes, 36static void insert_from_buffer_1 (struct buffer *, ptrdiff_t, ptrdiff_t, bool);
37 int inherit, int before_markers); 37static void gap_left (ptrdiff_t, ptrdiff_t, bool);
38static void insert_from_buffer_1 (struct buffer *buf, 38static void gap_right (ptrdiff_t, ptrdiff_t);
39 ptrdiff_t from, ptrdiff_t nchars,
40 int inherit);
41static void gap_left (ptrdiff_t charpos, ptrdiff_t bytepos, int newgap);
42static void gap_right (ptrdiff_t charpos, ptrdiff_t bytepos);
43 39
44/* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT) 40/* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT)
45 describing changes which happened while combine_after_change_calls 41 describing changes which happened while combine_after_change_calls
46 was nonzero. We use this to decide how to call them 42 was non-nil. We use this to decide how to call them
47 once the deferral ends. 43 once the deferral ends.
48 44
49 In each element. 45 In each element.
@@ -67,8 +63,8 @@ static void signal_before_change (ptrdiff_t, ptrdiff_t, ptrdiff_t *);
67static void 63static void
68check_markers (void) 64check_markers (void)
69{ 65{
70 register struct Lisp_Marker *tail; 66 struct Lisp_Marker *tail;
71 int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); 67 bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
72 68
73 for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next) 69 for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next)
74 { 70 {
@@ -113,13 +109,13 @@ move_gap_both (ptrdiff_t charpos, ptrdiff_t bytepos)
113/* Move the gap to a position less than the current GPT. 109/* Move the gap to a position less than the current GPT.
114 BYTEPOS describes the new position as a byte position, 110 BYTEPOS describes the new position as a byte position,
115 and CHARPOS is the corresponding char position. 111 and CHARPOS is the corresponding char position.
116 If NEWGAP is nonzero, then don't update beg_unchanged and end_unchanged. */ 112 If NEWGAP, then don't update beg_unchanged and end_unchanged. */
117 113
118static void 114static void
119gap_left (ptrdiff_t charpos, ptrdiff_t bytepos, int newgap) 115gap_left (ptrdiff_t charpos, ptrdiff_t bytepos, bool newgap)
120{ 116{
121 register unsigned char *to, *from; 117 unsigned char *to, *from;
122 register ptrdiff_t i; 118 ptrdiff_t i;
123 ptrdiff_t new_s1; 119 ptrdiff_t new_s1;
124 120
125 if (!newgap) 121 if (!newgap)
@@ -287,10 +283,10 @@ adjust_markers_for_delete (ptrdiff_t from, ptrdiff_t from_byte,
287 283
288static void 284static void
289adjust_markers_for_insert (ptrdiff_t from, ptrdiff_t from_byte, 285adjust_markers_for_insert (ptrdiff_t from, ptrdiff_t from_byte,
290 ptrdiff_t to, ptrdiff_t to_byte, int before_markers) 286 ptrdiff_t to, ptrdiff_t to_byte, bool before_markers)
291{ 287{
292 struct Lisp_Marker *m; 288 struct Lisp_Marker *m;
293 int adjusted = 0; 289 bool adjusted = 0;
294 ptrdiff_t nchars = to - from; 290 ptrdiff_t nchars = to - from;
295 ptrdiff_t nbytes = to_byte - from_byte; 291 ptrdiff_t nbytes = to_byte - from_byte;
296 292
@@ -515,7 +511,7 @@ make_gap (ptrdiff_t nbytes_added)
515 511
516ptrdiff_t 512ptrdiff_t
517copy_text (const unsigned char *from_addr, unsigned char *to_addr, 513copy_text (const unsigned char *from_addr, unsigned char *to_addr,
518 ptrdiff_t nbytes, int from_multibyte, int to_multibyte) 514 ptrdiff_t nbytes, bool from_multibyte, bool to_multibyte)
519{ 515{
520 if (from_multibyte == to_multibyte) 516 if (from_multibyte == to_multibyte)
521 { 517 {
@@ -664,7 +660,7 @@ insert_before_markers_and_inherit (const char *string,
664 660
665void 661void
666insert_1 (const char *string, ptrdiff_t nbytes, 662insert_1 (const char *string, ptrdiff_t nbytes,
667 int inherit, int prepare, int before_markers) 663 bool inherit, bool prepare, bool before_markers)
668{ 664{
669 insert_1_both (string, chars_in_text ((unsigned char *) string, nbytes), 665 insert_1_both (string, chars_in_text ((unsigned char *) string, nbytes),
670 nbytes, inherit, prepare, before_markers); 666 nbytes, inherit, prepare, before_markers);
@@ -790,7 +786,7 @@ count_combining_after (const unsigned char *string,
790void 786void
791insert_1_both (const char *string, 787insert_1_both (const char *string,
792 ptrdiff_t nchars, ptrdiff_t nbytes, 788 ptrdiff_t nchars, ptrdiff_t nbytes,
793 int inherit, int prepare, int before_markers) 789 bool inherit, bool prepare, bool before_markers)
794{ 790{
795 if (nchars == 0) 791 if (nchars == 0)
796 return; 792 return;
@@ -867,7 +863,7 @@ insert_1_both (const char *string,
867 863
868void 864void
869insert_from_string (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, 865insert_from_string (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
870 ptrdiff_t length, ptrdiff_t length_byte, int inherit) 866 ptrdiff_t length, ptrdiff_t length_byte, bool inherit)
871{ 867{
872 ptrdiff_t opoint = PT; 868 ptrdiff_t opoint = PT;
873 869
@@ -887,7 +883,7 @@ void
887insert_from_string_before_markers (Lisp_Object string, 883insert_from_string_before_markers (Lisp_Object string,
888 ptrdiff_t pos, ptrdiff_t pos_byte, 884 ptrdiff_t pos, ptrdiff_t pos_byte,
889 ptrdiff_t length, ptrdiff_t length_byte, 885 ptrdiff_t length, ptrdiff_t length_byte,
890 int inherit) 886 bool inherit)
891{ 887{
892 ptrdiff_t opoint = PT; 888 ptrdiff_t opoint = PT;
893 889
@@ -905,7 +901,7 @@ insert_from_string_before_markers (Lisp_Object string,
905static void 901static void
906insert_from_string_1 (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, 902insert_from_string_1 (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
907 ptrdiff_t nchars, ptrdiff_t nbytes, 903 ptrdiff_t nchars, ptrdiff_t nbytes,
908 int inherit, int before_markers) 904 bool inherit, bool before_markers)
909{ 905{
910 struct gcpro gcpro1; 906 struct gcpro gcpro1;
911 ptrdiff_t outgoing_nbytes = nbytes; 907 ptrdiff_t outgoing_nbytes = nbytes;
@@ -1039,7 +1035,7 @@ insert_from_gap (ptrdiff_t nchars, ptrdiff_t nbytes)
1039 1035
1040void 1036void
1041insert_from_buffer (struct buffer *buf, 1037insert_from_buffer (struct buffer *buf,
1042 ptrdiff_t charpos, ptrdiff_t nchars, int inherit) 1038 ptrdiff_t charpos, ptrdiff_t nchars, bool inherit)
1043{ 1039{
1044 ptrdiff_t opoint = PT; 1040 ptrdiff_t opoint = PT;
1045 1041
@@ -1050,7 +1046,7 @@ insert_from_buffer (struct buffer *buf,
1050 1046
1051static void 1047static void
1052insert_from_buffer_1 (struct buffer *buf, 1048insert_from_buffer_1 (struct buffer *buf,
1053 ptrdiff_t from, ptrdiff_t nchars, int inherit) 1049 ptrdiff_t from, ptrdiff_t nchars, bool inherit)
1054{ 1050{
1055 ptrdiff_t chunk, chunk_expanded; 1051 ptrdiff_t chunk, chunk_expanded;
1056 ptrdiff_t from_byte = buf_charpos_to_bytepos (buf, from); 1052 ptrdiff_t from_byte = buf_charpos_to_bytepos (buf, from);
@@ -1265,7 +1261,7 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte,
1265} 1261}
1266 1262
1267/* Replace the text from character positions FROM to TO with NEW, 1263/* Replace the text from character positions FROM to TO with NEW,
1268 If PREPARE is nonzero, call prepare_to_modify_buffer. 1264 If PREPARE, call prepare_to_modify_buffer.
1269 If INHERIT, the newly inserted text should inherit text properties 1265 If INHERIT, the newly inserted text should inherit text properties
1270 from the surrounding non-deleted text. */ 1266 from the surrounding non-deleted text. */
1271 1267
@@ -1278,7 +1274,7 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte,
1278 1274
1279void 1275void
1280replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, 1276replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new,
1281 int prepare, int inherit, int markers) 1277 bool prepare, bool inherit, bool markers)
1282{ 1278{
1283 ptrdiff_t inschars = SCHARS (new); 1279 ptrdiff_t inschars = SCHARS (new);
1284 ptrdiff_t insbytes = SBYTES (new); 1280 ptrdiff_t insbytes = SBYTES (new);
@@ -1443,7 +1439,7 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new,
1443 1439
1444 Note that this does not yet handle markers quite right. 1440 Note that this does not yet handle markers quite right.
1445 1441
1446 If MARKERS is nonzero, relocate markers. 1442 If MARKERS, relocate markers.
1447 1443
1448 Unlike most functions at this level, never call 1444 Unlike most functions at this level, never call
1449 prepare_to_modify_buffer and never call signal_after_change. */ 1445 prepare_to_modify_buffer and never call signal_after_change. */
@@ -1452,7 +1448,7 @@ void
1452replace_range_2 (ptrdiff_t from, ptrdiff_t from_byte, 1448replace_range_2 (ptrdiff_t from, ptrdiff_t from_byte,
1453 ptrdiff_t to, ptrdiff_t to_byte, 1449 ptrdiff_t to, ptrdiff_t to_byte,
1454 const char *ins, ptrdiff_t inschars, ptrdiff_t insbytes, 1450 const char *ins, ptrdiff_t inschars, ptrdiff_t insbytes,
1455 int markers) 1451 bool markers)
1456{ 1452{
1457 ptrdiff_t nbytes_del, nchars_del; 1453 ptrdiff_t nbytes_del, nchars_del;
1458 1454
@@ -1563,7 +1559,7 @@ del_range (ptrdiff_t from, ptrdiff_t to)
1563 RET_STRING says to return the deleted text. */ 1559 RET_STRING says to return the deleted text. */
1564 1560
1565Lisp_Object 1561Lisp_Object
1566del_range_1 (ptrdiff_t from, ptrdiff_t to, int prepare, int ret_string) 1562del_range_1 (ptrdiff_t from, ptrdiff_t to, bool prepare, bool ret_string)
1567{ 1563{
1568 ptrdiff_t from_byte, to_byte; 1564 ptrdiff_t from_byte, to_byte;
1569 Lisp_Object deletion; 1565 Lisp_Object deletion;
@@ -1599,7 +1595,7 @@ del_range_1 (ptrdiff_t from, ptrdiff_t to, int prepare, int ret_string)
1599/* Like del_range_1 but args are byte positions, not char positions. */ 1595/* Like del_range_1 but args are byte positions, not char positions. */
1600 1596
1601void 1597void
1602del_range_byte (ptrdiff_t from_byte, ptrdiff_t to_byte, int prepare) 1598del_range_byte (ptrdiff_t from_byte, ptrdiff_t to_byte, bool prepare)
1603{ 1599{
1604 ptrdiff_t from, to; 1600 ptrdiff_t from, to;
1605 1601
@@ -1643,7 +1639,7 @@ del_range_byte (ptrdiff_t from_byte, ptrdiff_t to_byte, int prepare)
1643 1639
1644void 1640void
1645del_range_both (ptrdiff_t from, ptrdiff_t from_byte, 1641del_range_both (ptrdiff_t from, ptrdiff_t from_byte,
1646 ptrdiff_t to, ptrdiff_t to_byte, int prepare) 1642 ptrdiff_t to, ptrdiff_t to_byte, bool prepare)
1647{ 1643{
1648 /* Make args be valid */ 1644 /* Make args be valid */
1649 if (from_byte < BEGV_BYTE) 1645 if (from_byte < BEGV_BYTE)
@@ -1685,13 +1681,13 @@ del_range_both (ptrdiff_t from, ptrdiff_t from_byte,
1685/* Delete a range of text, specified both as character positions 1681/* Delete a range of text, specified both as character positions
1686 and byte positions. FROM and TO are character positions, 1682 and byte positions. FROM and TO are character positions,
1687 while FROM_BYTE and TO_BYTE are byte positions. 1683 while FROM_BYTE and TO_BYTE are byte positions.
1688 If RET_STRING is true, the deleted area is returned as a string. */ 1684 If RET_STRING, the deleted area is returned as a string. */
1689 1685
1690Lisp_Object 1686Lisp_Object
1691del_range_2 (ptrdiff_t from, ptrdiff_t from_byte, 1687del_range_2 (ptrdiff_t from, ptrdiff_t from_byte,
1692 ptrdiff_t to, ptrdiff_t to_byte, int ret_string) 1688 ptrdiff_t to, ptrdiff_t to_byte, bool ret_string)
1693{ 1689{
1694 register ptrdiff_t nbytes_del, nchars_del; 1690 ptrdiff_t nbytes_del, nchars_del;
1695 Lisp_Object deletion; 1691 Lisp_Object deletion;
1696 1692
1697 check_markers (); 1693 check_markers ();
@@ -1770,12 +1766,12 @@ del_range_2 (ptrdiff_t from, ptrdiff_t from_byte,
1770 and warns the next redisplay that it should pay attention to that 1766 and warns the next redisplay that it should pay attention to that
1771 area. 1767 area.
1772 1768
1773 If PRESERVE_CHARS_MODIFF is non-zero, do not update CHARS_MODIFF. 1769 If PRESERVE_CHARS_MODIFF, do not update CHARS_MODIFF.
1774 Otherwise set CHARS_MODIFF to the new value of MODIFF. */ 1770 Otherwise set CHARS_MODIFF to the new value of MODIFF. */
1775 1771
1776void 1772void
1777modify_region (struct buffer *buffer, ptrdiff_t start, ptrdiff_t end, 1773modify_region (struct buffer *buffer, ptrdiff_t start, ptrdiff_t end,
1778 int preserve_chars_modiff) 1774 bool preserve_chars_modiff)
1779{ 1775{
1780 struct buffer *old_buffer = current_buffer; 1776 struct buffer *old_buffer = current_buffer;
1781 1777
diff --git a/src/intervals.c b/src/intervals.c
index 0a85e20e5d9..49d61b2f9b0 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -178,14 +178,13 @@ merge_properties (register INTERVAL source, register INTERVAL target)
178 } 178 }
179} 179}
180 180
181/* Return 1 if the two intervals have the same properties, 181/* Return true if the two intervals have the same properties. */
182 0 otherwise. */
183 182
184int 183bool
185intervals_equal (INTERVAL i0, INTERVAL i1) 184intervals_equal (INTERVAL i0, INTERVAL i1)
186{ 185{
187 register Lisp_Object i0_cdr, i0_sym; 186 Lisp_Object i0_cdr, i0_sym;
188 register Lisp_Object i1_cdr, i1_val; 187 Lisp_Object i1_cdr, i1_val;
189 188
190 if (DEFAULT_INTERVAL_P (i0) && DEFAULT_INTERVAL_P (i1)) 189 if (DEFAULT_INTERVAL_P (i0) && DEFAULT_INTERVAL_P (i1))
191 return 1; 190 return 1;
@@ -469,10 +468,10 @@ balance_an_interval (INTERVAL i)
469 Lisp Object. */ 468 Lisp Object. */
470 469
471static inline INTERVAL 470static inline INTERVAL
472balance_possible_root_interval (register INTERVAL interval) 471balance_possible_root_interval (INTERVAL interval)
473{ 472{
474 Lisp_Object parent; 473 Lisp_Object parent;
475 int have_parent = 0; 474 bool have_parent = 0;
476 475
477 if (!INTERVAL_HAS_OBJECT (interval) && !INTERVAL_HAS_PARENT (interval)) 476 if (!INTERVAL_HAS_OBJECT (interval) && !INTERVAL_HAS_PARENT (interval))
478 return interval; 477 return interval;
@@ -845,9 +844,9 @@ static INTERVAL
845adjust_intervals_for_insertion (INTERVAL tree, 844adjust_intervals_for_insertion (INTERVAL tree,
846 ptrdiff_t position, ptrdiff_t length) 845 ptrdiff_t position, ptrdiff_t length)
847{ 846{
848 register INTERVAL i; 847 INTERVAL i;
849 register INTERVAL temp; 848 INTERVAL temp;
850 int eobp = 0; 849 bool eobp = 0;
851 Lisp_Object parent; 850 Lisp_Object parent;
852 ptrdiff_t offset; 851 ptrdiff_t offset;
853 852
@@ -1068,11 +1067,10 @@ FR 8 9 A B
1068static Lisp_Object 1067static Lisp_Object
1069merge_properties_sticky (Lisp_Object pleft, Lisp_Object pright) 1068merge_properties_sticky (Lisp_Object pleft, Lisp_Object pright)
1070{ 1069{
1071 register Lisp_Object props, front, rear; 1070 Lisp_Object props, front, rear;
1072 Lisp_Object lfront, lrear, rfront, rrear; 1071 Lisp_Object lfront, lrear, rfront, rrear;
1073 register Lisp_Object tail1, tail2, sym, lval, rval, cat; 1072 Lisp_Object tail1, tail2, sym, lval, rval, cat;
1074 int use_left, use_right; 1073 bool use_left, use_right, lpresent;
1075 int lpresent;
1076 1074
1077 props = Qnil; 1075 props = Qnil;
1078 front = Qnil; 1076 front = Qnil;
@@ -1610,7 +1608,7 @@ reproduce_tree_obj (INTERVAL source, Lisp_Object parent)
1610void 1608void
1611graft_intervals_into_buffer (INTERVAL source, ptrdiff_t position, 1609graft_intervals_into_buffer (INTERVAL source, ptrdiff_t position,
1612 ptrdiff_t length, struct buffer *buffer, 1610 ptrdiff_t length, struct buffer *buffer,
1613 int inherit) 1611 bool inherit)
1614{ 1612{
1615 INTERVAL tree = buffer_intervals (buffer); 1613 INTERVAL tree = buffer_intervals (buffer);
1616 INTERVAL under, over, this; 1614 INTERVAL under, over, this;
@@ -1753,9 +1751,9 @@ textget (Lisp_Object plist, register Lisp_Object prop)
1753} 1751}
1754 1752
1755Lisp_Object 1753Lisp_Object
1756lookup_char_property (Lisp_Object plist, register Lisp_Object prop, int textprop) 1754lookup_char_property (Lisp_Object plist, Lisp_Object prop, bool textprop)
1757{ 1755{
1758 register Lisp_Object tail, fallback = Qnil; 1756 Lisp_Object tail, fallback = Qnil;
1759 1757
1760 for (tail = plist; CONSP (tail); tail = Fcdr (XCDR (tail))) 1758 for (tail = plist; CONSP (tail); tail = Fcdr (XCDR (tail)))
1761 { 1759 {
@@ -1826,8 +1824,8 @@ set_point (ptrdiff_t charpos)
1826/* If there's an invisible character at position POS + TEST_OFFS in the 1824/* If there's an invisible character at position POS + TEST_OFFS in the
1827 current buffer, and the invisible property has a `stickiness' such that 1825 current buffer, and the invisible property has a `stickiness' such that
1828 inserting a character at position POS would inherit the property it, 1826 inserting a character at position POS would inherit the property it,
1829 return POS + ADJ, otherwise return POS. If TEST_INTANG is non-zero, 1827 return POS + ADJ, otherwise return POS. If TEST_INTANG, intangibility
1830 then intangibility is required as well as invisibility. 1828 is required as well as invisibility.
1831 1829
1832 TEST_OFFS should be either 0 or -1, and ADJ should be either 1 or -1. 1830 TEST_OFFS should be either 0 or -1, and ADJ should be either 1 or -1.
1833 1831
@@ -1836,7 +1834,7 @@ set_point (ptrdiff_t charpos)
1836 1834
1837static ptrdiff_t 1835static ptrdiff_t
1838adjust_for_invis_intang (ptrdiff_t pos, ptrdiff_t test_offs, ptrdiff_t adj, 1836adjust_for_invis_intang (ptrdiff_t pos, ptrdiff_t test_offs, ptrdiff_t adj,
1839 int test_intang) 1837 bool test_intang)
1840{ 1838{
1841 Lisp_Object invis_propval, invis_overlay; 1839 Lisp_Object invis_propval, invis_overlay;
1842 Lisp_Object test_pos; 1840 Lisp_Object test_pos;
@@ -1883,8 +1881,8 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos)
1883 initial position is the same as the destination, in the rare 1881 initial position is the same as the destination, in the rare
1884 instances where this is important, e.g. in line-move-finish 1882 instances where this is important, e.g. in line-move-finish
1885 (simple.el). */ 1883 (simple.el). */
1886 int backwards = (charpos < old_position ? 1 : 0); 1884 bool backwards = charpos < old_position;
1887 int have_overlays; 1885 bool have_overlays;
1888 ptrdiff_t original_position; 1886 ptrdiff_t original_position;
1889 1887
1890 bset_point_before_scroll (current_buffer, Qnil); 1888 bset_point_before_scroll (current_buffer, Qnil);
@@ -2154,12 +2152,12 @@ move_if_not_intangible (ptrdiff_t position)
2154 2152
2155/* If text at position POS has property PROP, set *VAL to the property 2153/* If text at position POS has property PROP, set *VAL to the property
2156 value, *START and *END to the beginning and end of a region that 2154 value, *START and *END to the beginning and end of a region that
2157 has the same property, and return 1. Otherwise return 0. 2155 has the same property, and return true. Otherwise return false.
2158 2156
2159 OBJECT is the string or buffer to look for the property in; 2157 OBJECT is the string or buffer to look for the property in;
2160 nil means the current buffer. */ 2158 nil means the current buffer. */
2161 2159
2162int 2160bool
2163get_property_and_range (ptrdiff_t pos, Lisp_Object prop, Lisp_Object *val, 2161get_property_and_range (ptrdiff_t pos, Lisp_Object prop, Lisp_Object *val,
2164 ptrdiff_t *start, ptrdiff_t *end, Lisp_Object object) 2162 ptrdiff_t *start, ptrdiff_t *end, Lisp_Object object)
2165{ 2163{
@@ -2306,10 +2304,10 @@ copy_intervals_to_string (Lisp_Object string, struct buffer *buffer,
2306 set_string_intervals (string, interval_copy); 2304 set_string_intervals (string, interval_copy);
2307} 2305}
2308 2306
2309/* Return 1 if strings S1 and S2 have identical properties; 0 otherwise. 2307/* Return true if strings S1 and S2 have identical properties.
2310 Assume they have identical characters. */ 2308 Assume they have identical characters. */
2311 2309
2312int 2310bool
2313compare_string_intervals (Lisp_Object s1, Lisp_Object s2) 2311compare_string_intervals (Lisp_Object s1, Lisp_Object s2)
2314{ 2312{
2315 INTERVAL i1, i2; 2313 INTERVAL i1, i2;
@@ -2348,7 +2346,7 @@ compare_string_intervals (Lisp_Object s1, Lisp_Object s2)
2348 START_BYTE ... END_BYTE in bytes. */ 2346 START_BYTE ... END_BYTE in bytes. */
2349 2347
2350static void 2348static void
2351set_intervals_multibyte_1 (INTERVAL i, int multi_flag, 2349set_intervals_multibyte_1 (INTERVAL i, bool multi_flag,
2352 ptrdiff_t start, ptrdiff_t start_byte, 2350 ptrdiff_t start, ptrdiff_t start_byte,
2353 ptrdiff_t end, ptrdiff_t end_byte) 2351 ptrdiff_t end, ptrdiff_t end_byte)
2354{ 2352{
@@ -2456,11 +2454,11 @@ set_intervals_multibyte_1 (INTERVAL i, int multi_flag,
2456} 2454}
2457 2455
2458/* Update the intervals of the current buffer 2456/* Update the intervals of the current buffer
2459 to fit the contents as multibyte (if MULTI_FLAG is 1) 2457 to fit the contents as multibyte (if MULTI_FLAG)
2460 or to fit them as non-multibyte (if MULTI_FLAG is 0). */ 2458 or to fit them as non-multibyte (if not MULTI_FLAG). */
2461 2459
2462void 2460void
2463set_intervals_multibyte (int multi_flag) 2461set_intervals_multibyte (bool multi_flag)
2464{ 2462{
2465 INTERVAL i = buffer_intervals (current_buffer); 2463 INTERVAL i = buffer_intervals (current_buffer);
2466 2464
diff --git a/src/intervals.h b/src/intervals.h
index 01e72d7c9db..2b30101d0fa 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -227,7 +227,7 @@ extern INTERVAL make_interval (void);
227 227
228extern INTERVAL create_root_interval (Lisp_Object); 228extern INTERVAL create_root_interval (Lisp_Object);
229extern void copy_properties (INTERVAL, INTERVAL); 229extern void copy_properties (INTERVAL, INTERVAL);
230extern int intervals_equal (INTERVAL, INTERVAL); 230extern bool intervals_equal (INTERVAL, INTERVAL);
231extern void traverse_intervals (INTERVAL, ptrdiff_t, 231extern void traverse_intervals (INTERVAL, ptrdiff_t,
232 void (*) (INTERVAL, Lisp_Object), 232 void (*) (INTERVAL, Lisp_Object),
233 Lisp_Object); 233 Lisp_Object);
@@ -242,22 +242,22 @@ extern INTERVAL previous_interval (INTERVAL);
242extern INTERVAL merge_interval_left (INTERVAL); 242extern INTERVAL merge_interval_left (INTERVAL);
243extern void offset_intervals (struct buffer *, ptrdiff_t, ptrdiff_t); 243extern void offset_intervals (struct buffer *, ptrdiff_t, ptrdiff_t);
244extern void graft_intervals_into_buffer (INTERVAL, ptrdiff_t, ptrdiff_t, 244extern void graft_intervals_into_buffer (INTERVAL, ptrdiff_t, ptrdiff_t,
245 struct buffer *, int); 245 struct buffer *, bool);
246extern void verify_interval_modification (struct buffer *, 246extern void verify_interval_modification (struct buffer *,
247 ptrdiff_t, ptrdiff_t); 247 ptrdiff_t, ptrdiff_t);
248extern INTERVAL balance_intervals (INTERVAL); 248extern INTERVAL balance_intervals (INTERVAL);
249extern void copy_intervals_to_string (Lisp_Object, struct buffer *, 249extern void copy_intervals_to_string (Lisp_Object, struct buffer *,
250 ptrdiff_t, ptrdiff_t); 250 ptrdiff_t, ptrdiff_t);
251extern INTERVAL copy_intervals (INTERVAL, ptrdiff_t, ptrdiff_t); 251extern INTERVAL copy_intervals (INTERVAL, ptrdiff_t, ptrdiff_t);
252extern int compare_string_intervals (Lisp_Object, Lisp_Object); 252extern bool compare_string_intervals (Lisp_Object, Lisp_Object);
253extern Lisp_Object textget (Lisp_Object, Lisp_Object); 253extern Lisp_Object textget (Lisp_Object, Lisp_Object);
254extern Lisp_Object lookup_char_property (Lisp_Object, Lisp_Object, int); 254extern Lisp_Object lookup_char_property (Lisp_Object, Lisp_Object, bool);
255extern void move_if_not_intangible (ptrdiff_t); 255extern void move_if_not_intangible (ptrdiff_t);
256extern int get_property_and_range (ptrdiff_t, Lisp_Object, Lisp_Object *, 256extern bool get_property_and_range (ptrdiff_t, Lisp_Object, Lisp_Object *,
257 ptrdiff_t *, ptrdiff_t *, Lisp_Object); 257 ptrdiff_t *, ptrdiff_t *, Lisp_Object);
258extern Lisp_Object get_local_map (ptrdiff_t, struct buffer *, Lisp_Object); 258extern Lisp_Object get_local_map (ptrdiff_t, struct buffer *, Lisp_Object);
259extern INTERVAL update_interval (INTERVAL, ptrdiff_t); 259extern INTERVAL update_interval (INTERVAL, ptrdiff_t);
260extern void set_intervals_multibyte (int); 260extern void set_intervals_multibyte (bool);
261extern INTERVAL validate_interval_range (Lisp_Object, Lisp_Object *, 261extern INTERVAL validate_interval_range (Lisp_Object, Lisp_Object *,
262 Lisp_Object *, int); 262 Lisp_Object *, int);
263extern INTERVAL interval_of (ptrdiff_t, Lisp_Object); 263extern INTERVAL interval_of (ptrdiff_t, Lisp_Object);
diff --git a/src/keyboard.c b/src/keyboard.c
index 7b1ea341e7f..ff2b75e351c 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4339,9 +4339,8 @@ struct input_event last_timer_event EXTERNALLY_VISIBLE;
4339 ...). Each element has the form (FUN . ARGS). */ 4339 ...). Each element has the form (FUN . ARGS). */
4340Lisp_Object pending_funcalls; 4340Lisp_Object pending_funcalls;
4341 4341
4342/* If TIMER is a valid timer, return nonzero and place its value into 4342/* Return true if TIMER is a valid timer, placing its value into *RESULT. */
4343 *RESULT. Otherwise return zero. */ 4343static bool
4344static int
4345decode_timer (Lisp_Object timer, EMACS_TIME *result) 4344decode_timer (Lisp_Object timer, EMACS_TIME *result)
4346{ 4345{
4347 Lisp_Object *vector; 4346 Lisp_Object *vector;
@@ -8445,7 +8444,7 @@ append_tool_bar_item (void)
8445 8444
8446 /* Append entries from tool_bar_item_properties to the end of 8445 /* Append entries from tool_bar_item_properties to the end of
8447 tool_bar_items_vector. */ 8446 tool_bar_items_vector. */
8448 vcopy (tool_bar_items_vector, ntool_bar_items, 8447 vcopy (tool_bar_items_vector, ntool_bar_items,
8449 XVECTOR (tool_bar_item_properties)->contents, TOOL_BAR_ITEM_NSLOTS); 8448 XVECTOR (tool_bar_item_properties)->contents, TOOL_BAR_ITEM_NSLOTS);
8450 ntool_bar_items += TOOL_BAR_ITEM_NSLOTS; 8449 ntool_bar_items += TOOL_BAR_ITEM_NSLOTS;
8451} 8450}
diff --git a/src/lisp.h b/src/lisp.h
index 2815a2ae325..b906e4a1dfd 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2720,43 +2720,43 @@ extern void move_gap_both (ptrdiff_t, ptrdiff_t);
2720extern _Noreturn void buffer_overflow (void); 2720extern _Noreturn void buffer_overflow (void);
2721extern void make_gap (ptrdiff_t); 2721extern void make_gap (ptrdiff_t);
2722extern ptrdiff_t copy_text (const unsigned char *, unsigned char *, 2722extern ptrdiff_t copy_text (const unsigned char *, unsigned char *,
2723 ptrdiff_t, int, int); 2723 ptrdiff_t, bool, bool);
2724extern int count_combining_before (const unsigned char *, 2724extern int count_combining_before (const unsigned char *,
2725 ptrdiff_t, ptrdiff_t, ptrdiff_t); 2725 ptrdiff_t, ptrdiff_t, ptrdiff_t);
2726extern int count_combining_after (const unsigned char *, 2726extern int count_combining_after (const unsigned char *,
2727 ptrdiff_t, ptrdiff_t, ptrdiff_t); 2727 ptrdiff_t, ptrdiff_t, ptrdiff_t);
2728extern void insert (const char *, ptrdiff_t); 2728extern void insert (const char *, ptrdiff_t);
2729extern void insert_and_inherit (const char *, ptrdiff_t); 2729extern void insert_and_inherit (const char *, ptrdiff_t);
2730extern void insert_1 (const char *, ptrdiff_t, int, int, int); 2730extern void insert_1 (const char *, ptrdiff_t, bool, bool, bool);
2731extern void insert_1_both (const char *, ptrdiff_t, ptrdiff_t, 2731extern void insert_1_both (const char *, ptrdiff_t, ptrdiff_t,
2732 int, int, int); 2732 bool, bool, bool);
2733extern void insert_from_gap (ptrdiff_t, ptrdiff_t); 2733extern void insert_from_gap (ptrdiff_t, ptrdiff_t);
2734extern void insert_from_string (Lisp_Object, ptrdiff_t, ptrdiff_t, 2734extern void insert_from_string (Lisp_Object, ptrdiff_t, ptrdiff_t,
2735 ptrdiff_t, ptrdiff_t, int); 2735 ptrdiff_t, ptrdiff_t, bool);
2736extern void insert_from_buffer (struct buffer *, ptrdiff_t, ptrdiff_t, int); 2736extern void insert_from_buffer (struct buffer *, ptrdiff_t, ptrdiff_t, bool);
2737extern void insert_char (int); 2737extern void insert_char (int);
2738extern void insert_string (const char *); 2738extern void insert_string (const char *);
2739extern void insert_before_markers (const char *, ptrdiff_t); 2739extern void insert_before_markers (const char *, ptrdiff_t);
2740extern void insert_before_markers_and_inherit (const char *, ptrdiff_t); 2740extern void insert_before_markers_and_inherit (const char *, ptrdiff_t);
2741extern void insert_from_string_before_markers (Lisp_Object, ptrdiff_t, 2741extern void insert_from_string_before_markers (Lisp_Object, ptrdiff_t,
2742 ptrdiff_t, ptrdiff_t, 2742 ptrdiff_t, ptrdiff_t,
2743 ptrdiff_t, int); 2743 ptrdiff_t, bool);
2744extern void del_range (ptrdiff_t, ptrdiff_t); 2744extern void del_range (ptrdiff_t, ptrdiff_t);
2745extern Lisp_Object del_range_1 (ptrdiff_t, ptrdiff_t, int, int); 2745extern Lisp_Object del_range_1 (ptrdiff_t, ptrdiff_t, bool, bool);
2746extern void del_range_byte (ptrdiff_t, ptrdiff_t, int); 2746extern void del_range_byte (ptrdiff_t, ptrdiff_t, bool);
2747extern void del_range_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, int); 2747extern void del_range_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, bool);
2748extern Lisp_Object del_range_2 (ptrdiff_t, ptrdiff_t, 2748extern Lisp_Object del_range_2 (ptrdiff_t, ptrdiff_t,
2749 ptrdiff_t, ptrdiff_t, int); 2749 ptrdiff_t, ptrdiff_t, bool);
2750extern void modify_region (struct buffer *, ptrdiff_t, ptrdiff_t, int); 2750extern void modify_region (struct buffer *, ptrdiff_t, ptrdiff_t, bool);
2751extern void prepare_to_modify_buffer (ptrdiff_t, ptrdiff_t, ptrdiff_t *); 2751extern void prepare_to_modify_buffer (ptrdiff_t, ptrdiff_t, ptrdiff_t *);
2752extern void signal_after_change (ptrdiff_t, ptrdiff_t, ptrdiff_t); 2752extern void signal_after_change (ptrdiff_t, ptrdiff_t, ptrdiff_t);
2753extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t, 2753extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t,
2754 ptrdiff_t, ptrdiff_t); 2754 ptrdiff_t, ptrdiff_t);
2755extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t, 2755extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t,
2756 ptrdiff_t, ptrdiff_t); 2756 ptrdiff_t, ptrdiff_t);
2757extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, int, int, int); 2757extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool, bool);
2758extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, 2758extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
2759 const char *, ptrdiff_t, ptrdiff_t, int); 2759 const char *, ptrdiff_t, ptrdiff_t, bool);
2760extern void syms_of_insdel (void); 2760extern void syms_of_insdel (void);
2761 2761
2762/* Defined in dispnew.c */ 2762/* Defined in dispnew.c */
@@ -3094,9 +3094,9 @@ extern Lisp_Object save_restriction_save (void);
3094extern Lisp_Object save_excursion_restore (Lisp_Object); 3094extern Lisp_Object save_excursion_restore (Lisp_Object);
3095extern Lisp_Object save_restriction_restore (Lisp_Object); 3095extern Lisp_Object save_restriction_restore (Lisp_Object);
3096extern _Noreturn void time_overflow (void); 3096extern _Noreturn void time_overflow (void);
3097extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, int); 3097extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, bool);
3098extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, 3098extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t,
3099 ptrdiff_t, int); 3099 ptrdiff_t, bool);
3100extern void init_editfns (void); 3100extern void init_editfns (void);
3101const char *get_system_name (void); 3101const char *get_system_name (void);
3102extern void syms_of_editfns (void); 3102extern void syms_of_editfns (void);
@@ -3332,9 +3332,9 @@ extern void syms_of_callproc (void);
3332/* Defined in doc.c */ 3332/* Defined in doc.c */
3333extern Lisp_Object Qfunction_documentation; 3333extern Lisp_Object Qfunction_documentation;
3334extern Lisp_Object read_doc_string (Lisp_Object); 3334extern Lisp_Object read_doc_string (Lisp_Object);
3335extern Lisp_Object get_doc_string (Lisp_Object, int, int); 3335extern Lisp_Object get_doc_string (Lisp_Object, bool, bool);
3336extern void syms_of_doc (void); 3336extern void syms_of_doc (void);
3337extern int read_bytecode_char (int); 3337extern int read_bytecode_char (bool);
3338 3338
3339/* Defined in bytecode.c */ 3339/* Defined in bytecode.c */
3340extern Lisp_Object Qbytecode; 3340extern Lisp_Object Qbytecode;
diff --git a/src/systime.h b/src/systime.h
index d3bdeb83019..9ce7ce646fb 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -154,8 +154,8 @@ extern void set_waiting_for_input (EMACS_TIME *);
154#ifdef GCPRO1 154#ifdef GCPRO1
155/* defined in editfns.c */ 155/* defined in editfns.c */
156extern Lisp_Object make_lisp_time (EMACS_TIME); 156extern Lisp_Object make_lisp_time (EMACS_TIME);
157extern int decode_time_components (Lisp_Object, Lisp_Object, Lisp_Object, 157extern bool decode_time_components (Lisp_Object, Lisp_Object, Lisp_Object,
158 Lisp_Object, EMACS_TIME *, double *); 158 Lisp_Object, EMACS_TIME *, double *);
159extern EMACS_TIME lisp_time_argument (Lisp_Object); 159extern EMACS_TIME lisp_time_argument (Lisp_Object);
160#endif 160#endif
161 161