aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog23
-rw-r--r--src/lisp.h2
-rw-r--r--src/lread.c166
-rw-r--r--src/macros.c2
-rw-r--r--src/marker.c16
-rw-r--r--src/menu.c27
-rw-r--r--src/menu.h8
-rw-r--r--src/minibuf.c27
-rw-r--r--src/nsmenu.m9
-rw-r--r--src/nsterm.h4
-rw-r--r--src/xmenu.c25
11 files changed, 161 insertions, 148 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 99caae59cf7..c238af65d2d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,26 @@
12012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2
3 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4 * lread.c (load_each_byte, new_backquote_flag, readchar)
5 (read_filtered_event, lisp_file_lexically_bound_p)
6 (safe_to_load_version, Fload, complete_filename_p, openp)
7 (build_load_history, readevalloop, read_escape, read1)
8 (string_to_number, read_vector, read_list):
9 * macros.c (Fstart_kbd_macro):
10 * marker.c (CONSIDER):
11 * menu.c (parse_single_submenu, digest_single_submenu)
12 (find_and_return_menu_selection, Fx_popup_menu):
13 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
14 (Ftry_completion):
15 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
16 (ns_menu_show):
17 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
18 (xmenu_show, xdialog_show):
19 Use bool for booleans.
20 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
21 as it's not a predicate. All uses changed. Omit unnecessary
22 buffer termination.
23
12012-10-11 Dmitry Antipov <dmantipov@yandex.ru> 242012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
2 25
3 * editfns.c (save_excursion_save): Use nil if mark points to nowhere. 26 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
diff --git a/src/lisp.h b/src/lisp.h
index 1de9ec74d9f..62e287561cd 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3027,7 +3027,7 @@ extern Lisp_Object oblookup (Lisp_Object, const char *, ptrdiff_t, ptrdiff_t);
3027 } while (0) 3027 } while (0)
3028extern int openp (Lisp_Object, Lisp_Object, Lisp_Object, 3028extern int openp (Lisp_Object, Lisp_Object, Lisp_Object,
3029 Lisp_Object *, Lisp_Object); 3029 Lisp_Object *, Lisp_Object);
3030Lisp_Object string_to_number (char const *, int, int); 3030extern Lisp_Object string_to_number (char const *, int, bool);
3031extern void map_obarray (Lisp_Object, void (*) (Lisp_Object, Lisp_Object), 3031extern void map_obarray (Lisp_Object, void (*) (Lisp_Object, Lisp_Object),
3032 Lisp_Object); 3032 Lisp_Object);
3033extern void dir_warning (const char *, Lisp_Object); 3033extern void dir_warning (const char *, Lisp_Object);
diff --git a/src/lread.c b/src/lread.c
index a2b6d1f26d9..dbbde694cf6 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -95,10 +95,10 @@ static Lisp_Object Qload_in_progress;
95 It must be set to nil before all top-level calls to read0. */ 95 It must be set to nil before all top-level calls to read0. */
96static Lisp_Object read_objects; 96static Lisp_Object read_objects;
97 97
98/* Nonzero means READCHAR should read bytes one by one (not character) 98/* True means READCHAR should read bytes one by one (not character)
99 when READCHARFUN is Qget_file_char or Qget_emacs_mule_file_char. 99 when READCHARFUN is Qget_file_char or Qget_emacs_mule_file_char.
100 This is set to 1 by read1 temporarily while handling #@NUMBER. */ 100 This is set by read1 temporarily while handling #@NUMBER. */
101static int load_each_byte; 101static bool load_each_byte;
102 102
103/* List of descriptors now open for Fload. */ 103/* List of descriptors now open for Fload. */
104static Lisp_Object load_descriptor_list; 104static Lisp_Object load_descriptor_list;
@@ -135,11 +135,11 @@ static ptrdiff_t prev_saved_doc_string_length;
135/* This is the file position that string came from. */ 135/* This is the file position that string came from. */
136static file_offset prev_saved_doc_string_position; 136static file_offset prev_saved_doc_string_position;
137 137
138/* Nonzero means inside a new-style backquote 138/* True means inside a new-style backquote
139 with no surrounding parentheses. 139 with no surrounding parentheses.
140 Fread initializes this to zero, so we need not specbind it 140 Fread initializes this to false, so we need not specbind it
141 or worry about what happens to it when there is an error. */ 141 or worry about what happens to it when there is an error. */
142static int new_backquote_flag; 142static bool new_backquote_flag;
143static Lisp_Object Qold_style_backquotes; 143static Lisp_Object Qold_style_backquotes;
144 144
145/* A list of file names for files being loaded in Fload. Used to 145/* A list of file names for files being loaded in Fload. Used to
@@ -150,7 +150,7 @@ static Lisp_Object Vloads_in_progress;
150static int read_emacs_mule_char (int, int (*) (int, Lisp_Object), 150static int read_emacs_mule_char (int, int (*) (int, Lisp_Object),
151 Lisp_Object); 151 Lisp_Object);
152 152
153static void readevalloop (Lisp_Object, FILE*, Lisp_Object, int, 153static void readevalloop (Lisp_Object, FILE *, Lisp_Object, bool,
154 Lisp_Object, Lisp_Object, 154 Lisp_Object, Lisp_Object,
155 Lisp_Object, Lisp_Object); 155 Lisp_Object, Lisp_Object);
156static Lisp_Object load_unwind (Lisp_Object); 156static Lisp_Object load_unwind (Lisp_Object);
@@ -192,7 +192,7 @@ readchar (Lisp_Object readcharfun, bool *multibyte)
192 int (*readbyte) (int, Lisp_Object); 192 int (*readbyte) (int, Lisp_Object);
193 unsigned char buf[MAX_MULTIBYTE_LENGTH]; 193 unsigned char buf[MAX_MULTIBYTE_LENGTH];
194 int i, len; 194 int i, len;
195 int emacs_mule_encoding = 0; 195 bool emacs_mule_encoding = 0;
196 196
197 if (multibyte) 197 if (multibyte)
198 *multibyte = 0; 198 *multibyte = 0;
@@ -546,10 +546,10 @@ read_emacs_mule_char (int c, int (*readbyte) (int, Lisp_Object), Lisp_Object rea
546static Lisp_Object read_internal_start (Lisp_Object, Lisp_Object, 546static Lisp_Object read_internal_start (Lisp_Object, Lisp_Object,
547 Lisp_Object); 547 Lisp_Object);
548static Lisp_Object read0 (Lisp_Object); 548static Lisp_Object read0 (Lisp_Object);
549static Lisp_Object read1 (Lisp_Object, int *, int); 549static Lisp_Object read1 (Lisp_Object, int *, bool);
550 550
551static Lisp_Object read_list (int, Lisp_Object); 551static Lisp_Object read_list (bool, Lisp_Object);
552static Lisp_Object read_vector (Lisp_Object, int); 552static Lisp_Object read_vector (Lisp_Object, bool);
553 553
554static Lisp_Object substitute_object_recurse (Lisp_Object, Lisp_Object, 554static Lisp_Object substitute_object_recurse (Lisp_Object, Lisp_Object,
555 Lisp_Object); 555 Lisp_Object);
@@ -562,28 +562,28 @@ static void substitute_in_interval (INTERVAL, Lisp_Object);
562 562
563/* Read input events until we get one that's acceptable for our purposes. 563/* Read input events until we get one that's acceptable for our purposes.
564 564
565 If NO_SWITCH_FRAME is non-zero, switch-frame events are stashed 565 If NO_SWITCH_FRAME, switch-frame events are stashed
566 until we get a character we like, and then stuffed into 566 until we get a character we like, and then stuffed into
567 unread_switch_frame. 567 unread_switch_frame.
568 568
569 If ASCII_REQUIRED is non-zero, we check function key events to see 569 If ASCII_REQUIRED, check function key events to see
570 if the unmodified version of the symbol has a Qascii_character 570 if the unmodified version of the symbol has a Qascii_character
571 property, and use that character, if present. 571 property, and use that character, if present.
572 572
573 If ERROR_NONASCII is non-zero, we signal an error if the input we 573 If ERROR_NONASCII, signal an error if the input we
574 get isn't an ASCII character with modifiers. If it's zero but 574 get isn't an ASCII character with modifiers. If it's false but
575 ASCII_REQUIRED is non-zero, we just re-read until we get an ASCII 575 ASCII_REQUIRED is true, just re-read until we get an ASCII
576 character. 576 character.
577 577
578 If INPUT_METHOD is nonzero, we invoke the current input method 578 If INPUT_METHOD, invoke the current input method
579 if the character warrants that. 579 if the character warrants that.
580 580
581 If SECONDS is a number, we wait that many seconds for input, and 581 If SECONDS is a number, wait that many seconds for input, and
582 return Qnil if no input arrives within that time. */ 582 return Qnil if no input arrives within that time. */
583 583
584static Lisp_Object 584static Lisp_Object
585read_filtered_event (int no_switch_frame, int ascii_required, 585read_filtered_event (bool no_switch_frame, bool ascii_required,
586 int error_nonascii, int input_method, Lisp_Object seconds) 586 bool error_nonascii, bool input_method, Lisp_Object seconds)
587{ 587{
588 Lisp_Object val, delayed_switch_frame; 588 Lisp_Object val, delayed_switch_frame;
589 EMACS_TIME end_time; 589 EMACS_TIME end_time;
@@ -767,7 +767,7 @@ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,
767 positioned following the first line, if it is a comment or #! line, 767 positioned following the first line, if it is a comment or #! line,
768 otherwise nothing is read. */ 768 otherwise nothing is read. */
769 769
770static int 770static bool
771lisp_file_lexically_bound_p (Lisp_Object readcharfun) 771lisp_file_lexically_bound_p (Lisp_Object readcharfun)
772{ 772{
773 int ch = READCHAR; 773 int ch = READCHAR;
@@ -797,11 +797,11 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
797 else 797 else
798 /* Look for an appropriate file-variable in the first line. */ 798 /* Look for an appropriate file-variable in the first line. */
799 { 799 {
800 int rv = 0; 800 bool rv = 0;
801 enum { 801 enum {
802 NOMINAL, AFTER_FIRST_DASH, AFTER_ASTERIX, 802 NOMINAL, AFTER_FIRST_DASH, AFTER_ASTERIX,
803 } beg_end_state = NOMINAL; 803 } beg_end_state = NOMINAL;
804 int in_file_vars = 0; 804 bool in_file_vars = 0;
805 805
806#define UPDATE_BEG_END_STATE(ch) \ 806#define UPDATE_BEG_END_STATE(ch) \
807 if (beg_end_state == NOMINAL) \ 807 if (beg_end_state == NOMINAL) \
@@ -897,20 +897,17 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
897 because of an incompatible change in the byte compiler. */ 897 because of an incompatible change in the byte compiler. */
898 898
899static int 899static int
900safe_to_load_p (int fd) 900safe_to_load_version (int fd)
901{ 901{
902 char buf[512]; 902 char buf[512];
903 int nbytes, i; 903 int nbytes, i;
904 int safe_p = 1;
905 int version = 1; 904 int version = 1;
906 905
907 /* Read the first few bytes from the file, and look for a line 906 /* Read the first few bytes from the file, and look for a line
908 specifying the byte compiler version used. */ 907 specifying the byte compiler version used. */
909 nbytes = emacs_read (fd, buf, sizeof buf - 1); 908 nbytes = emacs_read (fd, buf, sizeof buf);
910 if (nbytes > 0) 909 if (nbytes > 0)
911 { 910 {
912 buf[nbytes] = '\0';
913
914 /* Skip to the next newline, skipping over the initial `ELC' 911 /* Skip to the next newline, skipping over the initial `ELC'
915 with NUL bytes following it, but note the version. */ 912 with NUL bytes following it, but note the version. */
916 for (i = 0; i < nbytes && buf[i] != '\n'; ++i) 913 for (i = 0; i < nbytes && buf[i] != '\n'; ++i)
@@ -920,13 +917,11 @@ safe_to_load_p (int fd)
920 if (i >= nbytes 917 if (i >= nbytes
921 || fast_c_string_match_ignore_case (Vbytecomp_version_regexp, 918 || fast_c_string_match_ignore_case (Vbytecomp_version_regexp,
922 buf + i, nbytes - i) < 0) 919 buf + i, nbytes - i) < 0)
923 safe_p = 0; 920 version = 0;
924 } 921 }
925 if (safe_p)
926 safe_p = version;
927 922
928 lseek (fd, 0, SEEK_SET); 923 lseek (fd, 0, SEEK_SET);
929 return safe_p; 924 return version;
930} 925}
931 926
932 927
@@ -1030,12 +1025,12 @@ Return t if the file exists and loads successfully. */)
1030 ptrdiff_t count = SPECPDL_INDEX (); 1025 ptrdiff_t count = SPECPDL_INDEX ();
1031 struct gcpro gcpro1, gcpro2, gcpro3; 1026 struct gcpro gcpro1, gcpro2, gcpro3;
1032 Lisp_Object found, efound, hist_file_name; 1027 Lisp_Object found, efound, hist_file_name;
1033 /* 1 means we printed the ".el is newer" message. */ 1028 /* True means we printed the ".el is newer" message. */
1034 int newer = 0; 1029 bool newer = 0;
1035 /* 1 means we are loading a compiled file. */ 1030 /* True means we are loading a compiled file. */
1036 int compiled = 0; 1031 bool compiled = 0;
1037 Lisp_Object handler; 1032 Lisp_Object handler;
1038 int safe_p = 1; 1033 bool safe_p = 1;
1039 const char *fmode = "r"; 1034 const char *fmode = "r";
1040 Lisp_Object tmp[2]; 1035 Lisp_Object tmp[2];
1041 int version; 1036 int version;
@@ -1190,7 +1185,7 @@ Return t if the file exists and loads successfully. */)
1190 record_unwind_protect (load_warn_old_style_backquotes, file); 1185 record_unwind_protect (load_warn_old_style_backquotes, file);
1191 1186
1192 if (!memcmp (SDATA (found) + SBYTES (found) - 4, ".elc", 4) 1187 if (!memcmp (SDATA (found) + SBYTES (found) - 4, ".elc", 4)
1193 || (fd >= 0 && (version = safe_to_load_p (fd)) > 0)) 1188 || (fd >= 0 && (version = safe_to_load_version (fd)) > 0))
1194 /* Load .elc files directly, but not when they are 1189 /* Load .elc files directly, but not when they are
1195 remote and have no handler! */ 1190 remote and have no handler! */
1196 { 1191 {
@@ -1202,7 +1197,7 @@ Return t if the file exists and loads successfully. */)
1202 GCPRO3 (file, found, hist_file_name); 1197 GCPRO3 (file, found, hist_file_name);
1203 1198
1204 if (version < 0 1199 if (version < 0
1205 && ! (version = safe_to_load_p (fd))) 1200 && ! (version = safe_to_load_version (fd)))
1206 { 1201 {
1207 safe_p = 0; 1202 safe_p = 0;
1208 if (!load_dangerous_libraries) 1203 if (!load_dangerous_libraries)
@@ -1394,10 +1389,10 @@ close_load_descs (void)
1394#endif 1389#endif
1395} 1390}
1396 1391
1397static int 1392static bool
1398complete_filename_p (Lisp_Object pathname) 1393complete_filename_p (Lisp_Object pathname)
1399{ 1394{
1400 register const unsigned char *s = SDATA (pathname); 1395 const unsigned char *s = SDATA (pathname);
1401 return (IS_DIRECTORY_SEP (s[0]) 1396 return (IS_DIRECTORY_SEP (s[0])
1402 || (SCHARS (pathname) > 2 1397 || (SCHARS (pathname) > 2
1403 && IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2]))); 1398 && IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2])));
@@ -1447,11 +1442,11 @@ static Lisp_Object Qdir_ok;
1447int 1442int
1448openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *storeptr, Lisp_Object predicate) 1443openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *storeptr, Lisp_Object predicate)
1449{ 1444{
1450 register int fd; 1445 int fd;
1451 ptrdiff_t fn_size = 100; 1446 ptrdiff_t fn_size = 100;
1452 char buf[100]; 1447 char buf[100];
1453 register char *fn = buf; 1448 char *fn = buf;
1454 int absolute = 0; 1449 bool absolute = 0;
1455 ptrdiff_t want_length; 1450 ptrdiff_t want_length;
1456 Lisp_Object filename; 1451 Lisp_Object filename;
1457 struct stat st; 1452 struct stat st;
@@ -1503,7 +1498,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
1503 { 1498 {
1504 ptrdiff_t fnlen, lsuffix = SBYTES (XCAR (tail)); 1499 ptrdiff_t fnlen, lsuffix = SBYTES (XCAR (tail));
1505 Lisp_Object handler; 1500 Lisp_Object handler;
1506 int exists; 1501 bool exists;
1507 1502
1508 /* Concatenate path element/specified name with the suffix. 1503 /* Concatenate path element/specified name with the suffix.
1509 If the directory starts with /:, remove that. */ 1504 If the directory starts with /:, remove that. */
@@ -1588,14 +1583,16 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
1588 the source has an associated file name or not. 1583 the source has an associated file name or not.
1589 1584
1590 FILENAME is the file name that we are loading from. 1585 FILENAME is the file name that we are loading from.
1591 ENTIRE is 1 if loading that entire file, 0 if evaluating part of it. */ 1586
1587 ENTIRE is true if loading that entire file, false if evaluating
1588 part of it. */
1592 1589
1593static void 1590static void
1594build_load_history (Lisp_Object filename, int entire) 1591build_load_history (Lisp_Object filename, bool entire)
1595{ 1592{
1596 register Lisp_Object tail, prev, newelt; 1593 Lisp_Object tail, prev, newelt;
1597 register Lisp_Object tem, tem2; 1594 Lisp_Object tem, tem2;
1598 register int foundit = 0; 1595 bool foundit = 0;
1599 1596
1600 tail = Vload_history; 1597 tail = Vload_history;
1601 prev = Qnil; 1598 prev = Qnil;
@@ -1680,7 +1677,7 @@ static void
1680readevalloop (Lisp_Object readcharfun, 1677readevalloop (Lisp_Object readcharfun,
1681 FILE *stream, 1678 FILE *stream,
1682 Lisp_Object sourcename, 1679 Lisp_Object sourcename,
1683 int printflag, 1680 bool printflag,
1684 Lisp_Object unibyte, Lisp_Object readfun, 1681 Lisp_Object unibyte, Lisp_Object readfun,
1685 Lisp_Object start, Lisp_Object end) 1682 Lisp_Object start, Lisp_Object end)
1686{ 1683{
@@ -1689,12 +1686,12 @@ readevalloop (Lisp_Object readcharfun,
1689 ptrdiff_t count = SPECPDL_INDEX (); 1686 ptrdiff_t count = SPECPDL_INDEX ();
1690 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 1687 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
1691 struct buffer *b = 0; 1688 struct buffer *b = 0;
1692 int continue_reading_p; 1689 bool continue_reading_p;
1693 Lisp_Object lex_bound; 1690 Lisp_Object lex_bound;
1694 /* Nonzero if reading an entire buffer. */ 1691 /* True if reading an entire buffer. */
1695 int whole_buffer = 0; 1692 bool whole_buffer = 0;
1696 /* 1 on the first time around. */ 1693 /* True on the first time around. */
1697 int first_sexp = 1; 1694 bool first_sexp = 1;
1698 Lisp_Object macroexpand = intern ("internal-macroexpand-for-load"); 1695 Lisp_Object macroexpand = intern ("internal-macroexpand-for-load");
1699 1696
1700 if (NILP (Ffboundp (macroexpand)) 1697 if (NILP (Ffboundp (macroexpand))
@@ -2072,9 +2069,9 @@ static char *read_buffer;
2072 If the escape sequence forces unibyte, return eight-bit char. */ 2069 If the escape sequence forces unibyte, return eight-bit char. */
2073 2070
2074static int 2071static int
2075read_escape (Lisp_Object readcharfun, int stringp) 2072read_escape (Lisp_Object readcharfun, bool stringp)
2076{ 2073{
2077 register int c = READCHAR; 2074 int c = READCHAR;
2078 /* \u allows up to four hex digits, \U up to eight. Default to the 2075 /* \u allows up to four hex digits, \U up to eight. Default to the
2079 behavior for \u, and change this value in the case that \U is seen. */ 2076 behavior for \u, and change this value in the case that \U is seen. */
2080 int unicode_hex_count = 4; 2077 int unicode_hex_count = 4;
@@ -2375,10 +2372,10 @@ read_integer (Lisp_Object readcharfun, EMACS_INT radix)
2375 in *PCH and the return value is not interesting. Else, we store 2372 in *PCH and the return value is not interesting. Else, we store
2376 zero in *PCH and we read and return one lisp object. 2373 zero in *PCH and we read and return one lisp object.
2377 2374
2378 FIRST_IN_LIST is nonzero if this is the first element of a list. */ 2375 FIRST_IN_LIST is true if this is the first element of a list. */
2379 2376
2380static Lisp_Object 2377static Lisp_Object
2381read1 (register Lisp_Object readcharfun, int *pch, int first_in_list) 2378read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
2382{ 2379{
2383 int c; 2380 int c;
2384 bool uninterned_symbol = 0; 2381 bool uninterned_symbol = 0;
@@ -2803,10 +2800,11 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2803 else 2800 else
2804 { 2801 {
2805 Lisp_Object value; 2802 Lisp_Object value;
2803 bool saved_new_backquote_flag = new_backquote_flag;
2806 2804
2807 new_backquote_flag++; 2805 new_backquote_flag = 1;
2808 value = read0 (readcharfun); 2806 value = read0 (readcharfun);
2809 new_backquote_flag--; 2807 new_backquote_flag = saved_new_backquote_flag;
2810 2808
2811 return Fcons (Qbackquote, Fcons (value, Qnil)); 2809 return Fcons (Qbackquote, Fcons (value, Qnil));
2812 } 2810 }
@@ -2858,7 +2856,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2858 { 2856 {
2859 int modifiers; 2857 int modifiers;
2860 int next_char; 2858 int next_char;
2861 int ok; 2859 bool ok;
2862 2860
2863 c = READCHAR; 2861 c = READCHAR;
2864 if (c < 0) 2862 if (c < 0)
@@ -2894,14 +2892,14 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2894 { 2892 {
2895 char *p = read_buffer; 2893 char *p = read_buffer;
2896 char *end = read_buffer + read_buffer_size; 2894 char *end = read_buffer + read_buffer_size;
2897 register int ch; 2895 int ch;
2898 /* Nonzero if we saw an escape sequence specifying 2896 /* True if we saw an escape sequence specifying
2899 a multibyte character. */ 2897 a multibyte character. */
2900 int force_multibyte = 0; 2898 bool force_multibyte = 0;
2901 /* Nonzero if we saw an escape sequence specifying 2899 /* True if we saw an escape sequence specifying
2902 a single-byte character. */ 2900 a single-byte character. */
2903 int force_singlebyte = 0; 2901 bool force_singlebyte = 0;
2904 int cancel = 0; 2902 bool cancel = 0;
2905 ptrdiff_t nchars = 0; 2903 ptrdiff_t nchars = 0;
2906 2904
2907 while ((ch = READCHAR) >= 0 2905 while ((ch = READCHAR) >= 0
@@ -3033,7 +3031,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
3033 read_symbol: 3031 read_symbol:
3034 { 3032 {
3035 char *p = read_buffer; 3033 char *p = read_buffer;
3036 int quoted = 0; 3034 bool quoted = 0;
3037 EMACS_INT start_position = readchar_count - 1; 3035 EMACS_INT start_position = readchar_count - 1;
3038 3036
3039 { 3037 {
@@ -3250,17 +3248,17 @@ substitute_in_interval (INTERVAL interval, Lisp_Object arg)
3250/* Convert STRING to a number, assuming base BASE. Return a fixnum if CP has 3248/* Convert STRING to a number, assuming base BASE. Return a fixnum if CP has
3251 integer syntax and fits in a fixnum, else return the nearest float if CP has 3249 integer syntax and fits in a fixnum, else return the nearest float if CP has
3252 either floating point or integer syntax and BASE is 10, else return nil. If 3250 either floating point or integer syntax and BASE is 10, else return nil. If
3253 IGNORE_TRAILING is nonzero, consider just the longest prefix of CP that has 3251 IGNORE_TRAILING, consider just the longest prefix of CP that has
3254 valid floating point syntax. Signal an overflow if BASE is not 10 and the 3252 valid floating point syntax. Signal an overflow if BASE is not 10 and the
3255 number has integer syntax but does not fit. */ 3253 number has integer syntax but does not fit. */
3256 3254
3257Lisp_Object 3255Lisp_Object
3258string_to_number (char const *string, int base, int ignore_trailing) 3256string_to_number (char const *string, int base, bool ignore_trailing)
3259{ 3257{
3260 int state; 3258 int state;
3261 char const *cp = string; 3259 char const *cp = string;
3262 int leading_digit; 3260 int leading_digit;
3263 int float_syntax = 0; 3261 bool float_syntax = 0;
3264 double value = 0; 3262 double value = 0;
3265 3263
3266 /* Compute NaN and infinities using a variable, to cope with compilers that 3264 /* Compute NaN and infinities using a variable, to cope with compilers that
@@ -3270,9 +3268,9 @@ string_to_number (char const *string, int base, int ignore_trailing)
3270 /* Negate the value ourselves. This treats 0, NaNs, and infinity properly on 3268 /* Negate the value ourselves. This treats 0, NaNs, and infinity properly on
3271 IEEE floating point hosts, and works around a formerly-common bug where 3269 IEEE floating point hosts, and works around a formerly-common bug where
3272 atof ("-0.0") drops the sign. */ 3270 atof ("-0.0") drops the sign. */
3273 int negative = *cp == '-'; 3271 bool negative = *cp == '-';
3274 3272
3275 int signedp = negative || *cp == '+'; 3273 bool signedp = negative || *cp == '+';
3276 cp += signedp; 3274 cp += signedp;
3277 3275
3278 state = 0; 3276 state = 0;
@@ -3365,7 +3363,7 @@ string_to_number (char const *string, int base, int ignore_trailing)
3365 uintmax_t n; 3363 uintmax_t n;
3366 3364
3367 /* Fast special case for single-digit integers. This also avoids a 3365 /* Fast special case for single-digit integers. This also avoids a
3368 glitch when BASE is 16 and IGNORE_TRAILING is nonzero, because in that 3366 glitch when BASE is 16 and IGNORE_TRAILING, because in that
3369 case some versions of strtoumax accept numbers like "0x1" that Emacs 3367 case some versions of strtoumax accept numbers like "0x1" that Emacs
3370 does not allow. */ 3368 does not allow. */
3371 if (digit_to_number (string[signedp + 1], base) < 0) 3369 if (digit_to_number (string[signedp + 1], base) < 0)
@@ -3401,12 +3399,12 @@ string_to_number (char const *string, int base, int ignore_trailing)
3401 3399
3402 3400
3403static Lisp_Object 3401static Lisp_Object
3404read_vector (Lisp_Object readcharfun, int bytecodeflag) 3402read_vector (Lisp_Object readcharfun, bool bytecodeflag)
3405{ 3403{
3406 ptrdiff_t i, size; 3404 ptrdiff_t i, size;
3407 register Lisp_Object *ptr; 3405 Lisp_Object *ptr;
3408 register Lisp_Object tem, item, vector; 3406 Lisp_Object tem, item, vector;
3409 register struct Lisp_Cons *otem; 3407 struct Lisp_Cons *otem;
3410 Lisp_Object len; 3408 Lisp_Object len;
3411 3409
3412 tem = read_list (1, readcharfun); 3410 tem = read_list (1, readcharfun);
@@ -3478,13 +3476,13 @@ read_vector (Lisp_Object readcharfun, int bytecodeflag)
3478 return vector; 3476 return vector;
3479} 3477}
3480 3478
3481/* FLAG = 1 means check for ] to terminate rather than ) and . */ 3479/* FLAG means check for ] to terminate rather than ) and . */
3482 3480
3483static Lisp_Object 3481static Lisp_Object
3484read_list (int flag, register Lisp_Object readcharfun) 3482read_list (bool flag, Lisp_Object readcharfun)
3485{ 3483{
3486 Lisp_Object val, tail; 3484 Lisp_Object val, tail;
3487 register Lisp_Object elt, tem; 3485 Lisp_Object elt, tem;
3488 struct gcpro gcpro1, gcpro2; 3486 struct gcpro gcpro1, gcpro2;
3489 /* 0 is the normal case. 3487 /* 0 is the normal case.
3490 1 means this list is a doc reference; replace it with the number 0. 3488 1 means this list is a doc reference; replace it with the number 0.
@@ -3492,7 +3490,7 @@ read_list (int flag, register Lisp_Object readcharfun)
3492 int doc_reference = 0; 3490 int doc_reference = 0;
3493 3491
3494 /* Initialize this to 1 if we are reading a list. */ 3492 /* Initialize this to 1 if we are reading a list. */
3495 int first_in_list = flag <= 0; 3493 bool first_in_list = flag <= 0;
3496 3494
3497 val = Qnil; 3495 val = Qnil;
3498 tail = Qnil; 3496 tail = Qnil;
diff --git a/src/macros.c b/src/macros.c
index a507f12e343..632c851ee8c 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -84,7 +84,7 @@ macro before appending to it. */)
84 { 84 {
85 ptrdiff_t i; 85 ptrdiff_t i;
86 EMACS_INT len; 86 EMACS_INT len;
87 int cvt; 87 bool cvt;
88 88
89 /* Check the type of last-kbd-macro in case Lisp code changed it. */ 89 /* Check the type of last-kbd-macro in case Lisp code changed it. */
90 CHECK_VECTOR_OR_STRING (KVAR (current_kboard, Vlast_kbd_macro)); 90 CHECK_VECTOR_OR_STRING (KVAR (current_kboard, Vlast_kbd_macro));
diff --git a/src/marker.c b/src/marker.c
index 2e2aba579db..69be4faec3a 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -91,7 +91,7 @@ clear_charpos_cache (struct buffer *b)
91#define CONSIDER(CHARPOS, BYTEPOS) \ 91#define CONSIDER(CHARPOS, BYTEPOS) \
92{ \ 92{ \
93 ptrdiff_t this_charpos = (CHARPOS); \ 93 ptrdiff_t this_charpos = (CHARPOS); \
94 int changed = 0; \ 94 bool changed = 0; \
95 \ 95 \
96 if (this_charpos == charpos) \ 96 if (this_charpos == charpos) \
97 { \ 97 { \
@@ -190,7 +190,7 @@ buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos)
190 190
191 if (charpos - best_below < best_above - charpos) 191 if (charpos - best_below < best_above - charpos)
192 { 192 {
193 int record = charpos - best_below > 5000; 193 bool record = charpos - best_below > 5000;
194 194
195 while (best_below != charpos) 195 while (best_below != charpos)
196 { 196 {
@@ -215,7 +215,7 @@ buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos)
215 } 215 }
216 else 216 else
217 { 217 {
218 int record = best_above - charpos > 5000; 218 bool record = best_above - charpos > 5000;
219 219
220 while (best_above != charpos) 220 while (best_above != charpos)
221 { 221 {
@@ -335,7 +335,7 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos)
335 335
336 if (bytepos - best_below_byte < best_above_byte - bytepos) 336 if (bytepos - best_below_byte < best_above_byte - bytepos)
337 { 337 {
338 int record = bytepos - best_below_byte > 5000; 338 bool record = bytepos - best_below_byte > 5000;
339 339
340 while (best_below_byte < bytepos) 340 while (best_below_byte < bytepos)
341 { 341 {
@@ -362,7 +362,7 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos)
362 } 362 }
363 else 363 else
364 { 364 {
365 int record = best_above_byte - bytepos > 5000; 365 bool record = best_above_byte - bytepos > 5000;
366 366
367 while (best_above_byte > bytepos) 367 while (best_above_byte > bytepos)
368 { 368 {
@@ -479,10 +479,10 @@ live_buffer (Lisp_Object buffer)
479 479
480static Lisp_Object 480static Lisp_Object
481set_marker_internal (Lisp_Object marker, Lisp_Object position, 481set_marker_internal (Lisp_Object marker, Lisp_Object position,
482 Lisp_Object buffer, int restricted) 482 Lisp_Object buffer, bool restricted)
483{ 483{
484 register struct Lisp_Marker *m; 484 struct Lisp_Marker *m;
485 register struct buffer *b = live_buffer (buffer); 485 struct buffer *b = live_buffer (buffer);
486 486
487 CHECK_MARKER (marker); 487 CHECK_MARKER (marker);
488 m = XMARKER (marker); 488 m = XMARKER (marker);
diff --git a/src/menu.c b/src/menu.c
index 6e052dc65a9..7cc110ce7e2 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -519,14 +519,15 @@ list_of_panes (Lisp_Object menu)
519/* Set up data in menu_items for a menu bar item 519/* Set up data in menu_items for a menu bar item
520 whose event type is ITEM_KEY (with string ITEM_NAME) 520 whose event type is ITEM_KEY (with string ITEM_NAME)
521 and whose contents come from the list of keymaps MAPS. */ 521 and whose contents come from the list of keymaps MAPS. */
522int 522bool
523parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name, Lisp_Object maps) 523parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name,
524 Lisp_Object maps)
524{ 525{
525 Lisp_Object length; 526 Lisp_Object length;
526 EMACS_INT len; 527 EMACS_INT len;
527 Lisp_Object *mapvec; 528 Lisp_Object *mapvec;
528 ptrdiff_t i; 529 ptrdiff_t i;
529 int top_level_items = 0; 530 bool top_level_items = 0;
530 USE_SAFE_ALLOCA; 531 USE_SAFE_ALLOCA;
531 532
532 length = Flength (maps); 533 length = Flength (maps);
@@ -616,13 +617,13 @@ free_menubar_widget_value_tree (widget_value *wv)
616 in menu_items starting at index START, up to index END. */ 617 in menu_items starting at index START, up to index END. */
617 618
618widget_value * 619widget_value *
619digest_single_submenu (int start, int end, int top_level_items) 620digest_single_submenu (int start, int end, bool top_level_items)
620{ 621{
621 widget_value *wv, *prev_wv, *save_wv, *first_wv; 622 widget_value *wv, *prev_wv, *save_wv, *first_wv;
622 int i; 623 int i;
623 int submenu_depth = 0; 624 int submenu_depth = 0;
624 widget_value **submenu_stack; 625 widget_value **submenu_stack;
625 int panes_seen = 0; 626 bool panes_seen = 0;
626 627
627 submenu_stack = alloca (menu_items_used * sizeof *submenu_stack); 628 submenu_stack = alloca (menu_items_used * sizeof *submenu_stack);
628 wv = xmalloc_widget_value (); 629 wv = xmalloc_widget_value ();
@@ -668,7 +669,7 @@ digest_single_submenu (int start, int end, int top_level_items)
668 Lisp_Object pane_name; 669 Lisp_Object pane_name;
669 const char *pane_string; 670 const char *pane_string;
670 671
671 panes_seen++; 672 panes_seen = 1;
672 673
673 pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); 674 pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME);
674 675
@@ -735,7 +736,7 @@ digest_single_submenu (int start, int end, int top_level_items)
735 Lisp_Object help; 736 Lisp_Object help;
736 737
737 /* All items should be contained in panes. */ 738 /* All items should be contained in panes. */
738 if (panes_seen == 0) 739 if (! panes_seen)
739 emacs_abort (); 740 emacs_abort ();
740 741
741 item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME); 742 item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME);
@@ -957,9 +958,9 @@ find_and_call_menu_selection (FRAME_PTR f, int menu_bar_items_used, Lisp_Object
957 958
958#ifdef HAVE_NS 959#ifdef HAVE_NS
959/* As above, but return the menu selection instead of storing in kb buffer. 960/* As above, but return the menu selection instead of storing in kb buffer.
960 If keymaps==1, return full prefixes to selection. */ 961 If KEYMAPS, return full prefixes to selection. */
961Lisp_Object 962Lisp_Object
962find_and_return_menu_selection (FRAME_PTR f, int keymaps, void *client_data) 963find_and_return_menu_selection (FRAME_PTR f, bool keymaps, void *client_data)
963{ 964{
964 Lisp_Object prefix, entry; 965 Lisp_Object prefix, entry;
965 int i; 966 int i;
@@ -999,7 +1000,7 @@ find_and_return_menu_selection (FRAME_PTR f, int keymaps, void *client_data)
999 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); 1000 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
1000 if (aref_addr (menu_items, i) == client_data) 1001 if (aref_addr (menu_items, i) == client_data)
1001 { 1002 {
1002 if (keymaps != 0) 1003 if (keymaps)
1003 { 1004 {
1004 int j; 1005 int j;
1005 1006
@@ -1071,8 +1072,8 @@ no quit occurs and `x-popup-menu' returns nil. */)
1071 Lisp_Object selection = Qnil; 1072 Lisp_Object selection = Qnil;
1072 FRAME_PTR f = NULL; 1073 FRAME_PTR f = NULL;
1073 Lisp_Object x, y, window; 1074 Lisp_Object x, y, window;
1074 int keymaps = 0; 1075 bool keymaps = 0;
1075 int for_click = 0; 1076 bool for_click = 0;
1076 ptrdiff_t specpdl_count = SPECPDL_INDEX (); 1077 ptrdiff_t specpdl_count = SPECPDL_INDEX ();
1077 struct gcpro gcpro1; 1078 struct gcpro gcpro1;
1078 1079
@@ -1083,7 +1084,7 @@ no quit occurs and `x-popup-menu' returns nil. */)
1083 1084
1084#ifdef HAVE_MENUS 1085#ifdef HAVE_MENUS
1085 { 1086 {
1086 int get_current_pos_p = 0; 1087 bool get_current_pos_p = 0;
1087 /* FIXME!! check_w32 (); or check_x (); or check_ns (); */ 1088 /* FIXME!! check_w32 (); or check_x (); or check_ns (); */
1088 1089
1089 /* Decode the first argument: find the window and the coordinates. */ 1090 /* Decode the first argument: find the window and the coordinates. */
diff --git a/src/menu.h b/src/menu.h
index 3406928a8d5..67934c42d76 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -29,7 +29,7 @@ extern void init_menu_items (void);
29extern void finish_menu_items (void) ATTRIBUTE_CONST; 29extern void finish_menu_items (void) ATTRIBUTE_CONST;
30extern void discard_menu_items (void); 30extern void discard_menu_items (void);
31extern void save_menu_items (void); 31extern void save_menu_items (void);
32extern int parse_single_submenu (Lisp_Object, Lisp_Object, Lisp_Object); 32extern bool parse_single_submenu (Lisp_Object, Lisp_Object, Lisp_Object);
33extern void list_of_panes (Lisp_Object); 33extern void list_of_panes (Lisp_Object);
34#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI) \ 34#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI) \
35 || defined (HAVE_NS) 35 || defined (HAVE_NS)
@@ -38,7 +38,7 @@ extern void update_submenu_strings (widget_value *);
38extern void find_and_call_menu_selection (FRAME_PTR, int, 38extern void find_and_call_menu_selection (FRAME_PTR, int,
39 Lisp_Object, void *); 39 Lisp_Object, void *);
40extern widget_value *xmalloc_widget_value (void); 40extern widget_value *xmalloc_widget_value (void);
41extern widget_value *digest_single_submenu (int, int, int); 41extern widget_value *digest_single_submenu (int, int, bool);
42#endif 42#endif
43 43
44#ifdef HAVE_X_WINDOWS 44#ifdef HAVE_X_WINDOWS
@@ -47,8 +47,8 @@ extern void mouse_position_for_popup (FRAME_PTR f, int *x, int *y);
47 47
48extern Lisp_Object w32_menu_show (FRAME_PTR, int, int, int, int, 48extern Lisp_Object w32_menu_show (FRAME_PTR, int, int, int, int,
49 Lisp_Object, const char **); 49 Lisp_Object, const char **);
50extern Lisp_Object ns_menu_show (FRAME_PTR, int, int, int, int, 50extern Lisp_Object ns_menu_show (FRAME_PTR, int, int, bool, bool,
51 Lisp_Object, const char **); 51 Lisp_Object, const char **);
52extern Lisp_Object xmenu_show (FRAME_PTR, int, int, int, int, 52extern Lisp_Object xmenu_show (FRAME_PTR, int, int, bool, bool,
53 Lisp_Object, const char **, Time); 53 Lisp_Object, const char **, Time);
54#endif /* MENU_H */ 54#endif /* MENU_H */
diff --git a/src/minibuf.c b/src/minibuf.c
index dd4ca34c3fb..2cc89e75680 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -173,17 +173,6 @@ without invoking the usual minibuffer commands. */)
173 173
174static Lisp_Object read_minibuf_unwind (Lisp_Object); 174static Lisp_Object read_minibuf_unwind (Lisp_Object);
175static Lisp_Object run_exit_minibuf_hook (Lisp_Object); 175static Lisp_Object run_exit_minibuf_hook (Lisp_Object);
176static Lisp_Object read_minibuf (Lisp_Object, Lisp_Object,
177 Lisp_Object,
178 int, Lisp_Object,
179 Lisp_Object, Lisp_Object,
180 int, int);
181static Lisp_Object read_minibuf_noninteractive (Lisp_Object, Lisp_Object,
182 Lisp_Object, Lisp_Object,
183 int, Lisp_Object,
184 Lisp_Object, Lisp_Object,
185 int, int);
186static Lisp_Object string_to_object (Lisp_Object, Lisp_Object);
187 176
188 177
189/* Read a Lisp object from VAL and return it. If VAL is an empty 178/* Read a Lisp object from VAL and return it. If VAL is an empty
@@ -233,10 +222,10 @@ string_to_object (Lisp_Object val, Lisp_Object defalt)
233static Lisp_Object 222static Lisp_Object
234read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial, 223read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
235 Lisp_Object prompt, Lisp_Object backup_n, 224 Lisp_Object prompt, Lisp_Object backup_n,
236 int expflag, 225 bool expflag,
237 Lisp_Object histvar, Lisp_Object histpos, 226 Lisp_Object histvar, Lisp_Object histpos,
238 Lisp_Object defalt, 227 Lisp_Object defalt,
239 int allow_props, int inherit_input_method) 228 bool allow_props, bool inherit_input_method)
240{ 229{
241 ptrdiff_t size, len; 230 ptrdiff_t size, len;
242 char *line; 231 char *line;
@@ -376,23 +365,23 @@ If the current buffer is not a minibuffer, return its entire contents. */)
376 beginning of INITIAL if N <= 0. 365 beginning of INITIAL if N <= 0.
377 366
378 Normally return the result as a string (the text that was read), 367 Normally return the result as a string (the text that was read),
379 but if EXPFLAG is nonzero, read it and return the object read. 368 but if EXPFLAG, read it and return the object read.
380 If HISTVAR is given, save the value read on that history only if it doesn't 369 If HISTVAR is given, save the value read on that history only if it doesn't
381 match the front of that history list exactly. The value is pushed onto 370 match the front of that history list exactly. The value is pushed onto
382 the list as the string that was read. 371 the list as the string that was read.
383 372
384 DEFALT specifies the default value for the sake of history commands. 373 DEFALT specifies the default value for the sake of history commands.
385 374
386 If ALLOW_PROPS is nonzero, we do not throw away text properties. 375 If ALLOW_PROPS, do not throw away text properties.
387 376
388 if INHERIT_INPUT_METHOD is nonzero, the minibuffer inherits the 377 if INHERIT_INPUT_METHOD, the minibuffer inherits the
389 current input method. */ 378 current input method. */
390 379
391static Lisp_Object 380static Lisp_Object
392read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, 381read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
393 int expflag, 382 bool expflag,
394 Lisp_Object histvar, Lisp_Object histpos, Lisp_Object defalt, 383 Lisp_Object histvar, Lisp_Object histpos, Lisp_Object defalt,
395 int allow_props, int inherit_input_method) 384 bool allow_props, bool inherit_input_method)
396{ 385{
397 Lisp_Object val; 386 Lisp_Object val;
398 ptrdiff_t count = SPECPDL_INDEX (); 387 ptrdiff_t count = SPECPDL_INDEX ();
@@ -1447,7 +1436,7 @@ is used to further constrain the set of candidates. */)
1447 if (bestmatchsize != SCHARS (eltstring) 1436 if (bestmatchsize != SCHARS (eltstring)
1448 || bestmatchsize != matchsize) 1437 || bestmatchsize != matchsize)
1449 /* Don't count the same string multiple times. */ 1438 /* Don't count the same string multiple times. */
1450 matchcount++; 1439 matchcount += matchcount <= 1;
1451 bestmatchsize = matchsize; 1440 bestmatchsize = matchsize;
1452 if (matchsize <= SCHARS (string) 1441 if (matchsize <= SCHARS (string)
1453 /* If completion-ignore-case is non-nil, don't 1442 /* If completion-ignore-case is non-nil, don't
diff --git a/src/nsmenu.m b/src/nsmenu.m
index a5983c70cdb..d0ea8f5a47a 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -181,7 +181,8 @@ ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
181 /* Fully parse one or more of the submenus. */ 181 /* Fully parse one or more of the submenus. */
182 int n = 0; 182 int n = 0;
183 int *submenu_start, *submenu_end; 183 int *submenu_start, *submenu_end;
184 int *submenu_top_level_items, *submenu_n_panes; 184 bool *submenu_top_level_items;
185 int *submenu_n_panes;
185 struct buffer *prev = current_buffer; 186 struct buffer *prev = current_buffer;
186 Lisp_Object buffer; 187 Lisp_Object buffer;
187 ptrdiff_t specpdl_count = SPECPDL_INDEX (); 188 ptrdiff_t specpdl_count = SPECPDL_INDEX ();
@@ -740,7 +741,7 @@ extern NSString *NSMenuDidBeginTrackingNotification;
740 741
741/* run a menu in popup mode */ 742/* run a menu in popup mode */
742- (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f 743- (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
743 keymaps: (int)keymaps 744 keymaps: (bool)keymaps
744{ 745{
745 EmacsView *view = FRAME_NS_VIEW (f); 746 EmacsView *view = FRAME_NS_VIEW (f);
746 NSEvent *e, *event; 747 NSEvent *e, *event;
@@ -779,7 +780,7 @@ extern NSString *NSMenuDidBeginTrackingNotification;
779 ========================================================================== */ 780 ========================================================================== */
780 781
781Lisp_Object 782Lisp_Object
782ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, 783ns_menu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps,
783 Lisp_Object title, const char **error) 784 Lisp_Object title, const char **error)
784{ 785{
785 EmacsMenu *pmenu; 786 EmacsMenu *pmenu;
@@ -801,7 +802,7 @@ ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
801 802
802#if 0 803#if 0
803 /* FIXME: a couple of one-line differences prevent reuse */ 804 /* FIXME: a couple of one-line differences prevent reuse */
804 wv = digest_single_submenu (0, menu_items_used, Qnil); 805 wv = digest_single_submenu (0, menu_items_used, 0);
805#else 806#else
806 { 807 {
807 widget_value *save_wv = 0, *prev_wv = 0; 808 widget_value *save_wv = 0, *prev_wv = 0;
diff --git a/src/nsterm.h b/src/nsterm.h
index 958d1ce7853..2e868b86caf 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -161,7 +161,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
161- (EmacsMenu *)addSubmenuWithTitle: (const char *)title forFrame: (struct frame *)f; 161- (EmacsMenu *)addSubmenuWithTitle: (const char *)title forFrame: (struct frame *)f;
162- (void) clear; 162- (void) clear;
163- (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f 163- (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
164 keymaps: (int)keymaps; 164 keymaps: (bool)keymaps;
165@end 165@end
166 166
167 167
@@ -792,7 +792,7 @@ extern void free_frame_tool_bar (FRAME_PTR f);
792extern void find_and_call_menu_selection (FRAME_PTR f, 792extern void find_and_call_menu_selection (FRAME_PTR f,
793 int menu_bar_items_used, Lisp_Object vector, void *client_data); 793 int menu_bar_items_used, Lisp_Object vector, void *client_data);
794extern Lisp_Object find_and_return_menu_selection (FRAME_PTR f, 794extern Lisp_Object find_and_return_menu_selection (FRAME_PTR f,
795 int keymaps, 795 bool keymaps,
796 void *client_data); 796 void *client_data);
797extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object contents, 797extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object contents,
798 Lisp_Object header); 798 Lisp_Object header);
diff --git a/src/xmenu.c b/src/xmenu.c
index 96a1ae87fdc..01d932cf8d8 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -111,7 +111,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
111static Lisp_Object Qdebug_on_next_call; 111static Lisp_Object Qdebug_on_next_call;
112 112
113#if defined (USE_X_TOOLKIT) || defined (USE_GTK) 113#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
114static Lisp_Object xdialog_show (FRAME_PTR, int, Lisp_Object, Lisp_Object, 114static Lisp_Object xdialog_show (FRAME_PTR, bool, Lisp_Object, Lisp_Object,
115 const char **); 115 const char **);
116#endif 116#endif
117 117
@@ -930,7 +930,8 @@ set_frame_menubar (FRAME_PTR f, bool first_time, bool deep_p)
930 widget_value *wv, *first_wv, *prev_wv = 0; 930 widget_value *wv, *first_wv, *prev_wv = 0;
931 int i; 931 int i;
932 int *submenu_start, *submenu_end; 932 int *submenu_start, *submenu_end;
933 int *submenu_top_level_items, *submenu_n_panes; 933 bool *submenu_top_level_items;
934 int *submenu_n_panes;
934 935
935 if (! FRAME_X_P (f)) 936 if (! FRAME_X_P (f))
936 emacs_abort (); 937 emacs_abort ();
@@ -1346,8 +1347,8 @@ free_frame_menubar (FRAME_PTR f)
1346/* F is the frame the menu is for. 1347/* F is the frame the menu is for.
1347 X and Y are the frame-relative specified position, 1348 X and Y are the frame-relative specified position,
1348 relative to the inside upper left corner of the frame F. 1349 relative to the inside upper left corner of the frame F.
1349 FOR_CLICK is nonzero if this menu was invoked for a mouse click. 1350 FOR_CLICK is true if this menu was invoked for a mouse click.
1350 KEYMAPS is 1 if this menu was specified with keymaps; 1351 KEYMAPS is true if this menu was specified with keymaps;
1351 in that case, we return a list containing the chosen item's value 1352 in that case, we return a list containing the chosen item's value
1352 and perhaps also the pane's prefix. 1353 and perhaps also the pane's prefix.
1353 TITLE is the specified menu title. 1354 TITLE is the specified menu title.
@@ -1427,14 +1428,14 @@ pop_down_menu (Lisp_Object arg)
1427 menu_item_selection will be set to the selection. */ 1428 menu_item_selection will be set to the selection. */
1428static void 1429static void
1429create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y, 1430create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y,
1430 int for_click, Time timestamp) 1431 bool for_click, Time timestamp)
1431{ 1432{
1432 int i; 1433 int i;
1433 GtkWidget *menu; 1434 GtkWidget *menu;
1434 GtkMenuPositionFunc pos_func = 0; /* Pop up at pointer. */ 1435 GtkMenuPositionFunc pos_func = 0; /* Pop up at pointer. */
1435 struct next_popup_x_y popup_x_y; 1436 struct next_popup_x_y popup_x_y;
1436 ptrdiff_t specpdl_count = SPECPDL_INDEX (); 1437 ptrdiff_t specpdl_count = SPECPDL_INDEX ();
1437 int use_pos_func = ! for_click; 1438 bool use_pos_func = ! for_click;
1438 1439
1439#ifdef HAVE_GTK3 1440#ifdef HAVE_GTK3
1440 /* Always use position function for Gtk3. Otherwise menus may become 1441 /* Always use position function for Gtk3. Otherwise menus may become
@@ -1539,7 +1540,7 @@ pop_down_menu (Lisp_Object arg)
1539 menu_item_selection will be set to the selection. */ 1540 menu_item_selection will be set to the selection. */
1540static void 1541static void
1541create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, 1542create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv,
1542 int x, int y, int for_click, Time timestamp) 1543 int x, int y, bool for_click, Time timestamp)
1543{ 1544{
1544 int i; 1545 int i;
1545 Arg av[2]; 1546 Arg av[2];
@@ -1623,7 +1624,7 @@ cleanup_widget_value_tree (Lisp_Object arg)
1623} 1624}
1624 1625
1625Lisp_Object 1626Lisp_Object
1626xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, 1627xmenu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps,
1627 Lisp_Object title, const char **error_name, Time timestamp) 1628 Lisp_Object title, const char **error_name, Time timestamp)
1628{ 1629{
1629 int i; 1630 int i;
@@ -1878,7 +1879,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
1878 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); 1879 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
1879 if (menu_item_selection == aref_addr (menu_items, i)) 1880 if (menu_item_selection == aref_addr (menu_items, i))
1880 { 1881 {
1881 if (keymaps != 0) 1882 if (keymaps)
1882 { 1883 {
1883 int j; 1884 int j;
1884 1885
@@ -2011,7 +2012,7 @@ static const char * button_names [] = {
2011 2012
2012static Lisp_Object 2013static Lisp_Object
2013xdialog_show (FRAME_PTR f, 2014xdialog_show (FRAME_PTR f,
2014 int keymaps, 2015 bool keymaps,
2015 Lisp_Object title, 2016 Lisp_Object title,
2016 Lisp_Object header, 2017 Lisp_Object header,
2017 const char **error_name) 2018 const char **error_name)
@@ -2277,7 +2278,7 @@ pop_down_menu (Lisp_Object arg)
2277 2278
2278 2279
2279Lisp_Object 2280Lisp_Object
2280xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, 2281xmenu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps,
2281 Lisp_Object title, const char **error_name, Time timestamp) 2282 Lisp_Object title, const char **error_name, Time timestamp)
2282{ 2283{
2283 Window root; 2284 Window root;
@@ -2528,7 +2529,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
2528 { 2529 {
2529 entry 2530 entry
2530 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); 2531 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
2531 if (keymaps != 0) 2532 if (keymaps)
2532 { 2533 {
2533 entry = Fcons (entry, Qnil); 2534 entry = Fcons (entry, Qnil);
2534 if (!NILP (pane_prefix)) 2535 if (!NILP (pane_prefix))