Commit 7cded46f authored by Paul Eggert's avatar Paul Eggert

lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.

* lread.c (load_each_byte, new_backquote_flag, readchar)
(read_filtered_event, lisp_file_lexically_bound_p)
(safe_to_load_version, Fload, complete_filename_p, openp)
(build_load_history, readevalloop, read_escape, read1)
(string_to_number, read_vector, read_list):
* macros.c (Fstart_kbd_macro):
* marker.c (CONSIDER):
* menu.c (parse_single_submenu, digest_single_submenu)
(find_and_return_menu_selection, Fx_popup_menu):
* minibuf.c (read_minibuf_noninteractive, read_minibuf)
(Ftry_completion):
* nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
(ns_menu_show):
* xmenu.c (set_frame_menubar, create_and_show_popup_menu)
(xmenu_show, xdialog_show):
Use bool for booleans.
* lread.c (safe_to_load_version): Rename from safe_to_load_p,
as it's not a predicate.  All uses changed.  Omit unnecessary
buffer termination.
parent 549c3414
2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
* lread.c (load_each_byte, new_backquote_flag, readchar)
(read_filtered_event, lisp_file_lexically_bound_p)
(safe_to_load_version, Fload, complete_filename_p, openp)
(build_load_history, readevalloop, read_escape, read1)
(string_to_number, read_vector, read_list):
* macros.c (Fstart_kbd_macro):
* marker.c (CONSIDER):
* menu.c (parse_single_submenu, digest_single_submenu)
(find_and_return_menu_selection, Fx_popup_menu):
* minibuf.c (read_minibuf_noninteractive, read_minibuf)
(Ftry_completion):
* nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
(ns_menu_show):
* xmenu.c (set_frame_menubar, create_and_show_popup_menu)
(xmenu_show, xdialog_show):
Use bool for booleans.
* lread.c (safe_to_load_version): Rename from safe_to_load_p,
as it's not a predicate. All uses changed. Omit unnecessary
buffer termination.
2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
* editfns.c (save_excursion_save): Use nil if mark points to nowhere.
......
......@@ -3027,7 +3027,7 @@ extern Lisp_Object oblookup (Lisp_Object, const char *, ptrdiff_t, ptrdiff_t);
} while (0)
extern int openp (Lisp_Object, Lisp_Object, Lisp_Object,
Lisp_Object *, Lisp_Object);
Lisp_Object string_to_number (char const *, int, int);
extern Lisp_Object string_to_number (char const *, int, bool);
extern void map_obarray (Lisp_Object, void (*) (Lisp_Object, Lisp_Object),
Lisp_Object);
extern void dir_warning (const char *, Lisp_Object);
......
......@@ -95,10 +95,10 @@ static Lisp_Object Qload_in_progress;
It must be set to nil before all top-level calls to read0. */
static Lisp_Object read_objects;
/* Nonzero means READCHAR should read bytes one by one (not character)
/* True means READCHAR should read bytes one by one (not character)
when READCHARFUN is Qget_file_char or Qget_emacs_mule_file_char.
This is set to 1 by read1 temporarily while handling #@NUMBER. */
static int load_each_byte;
This is set by read1 temporarily while handling #@NUMBER. */
static bool load_each_byte;
/* List of descriptors now open for Fload. */
static Lisp_Object load_descriptor_list;
......@@ -135,11 +135,11 @@ static ptrdiff_t prev_saved_doc_string_length;
/* This is the file position that string came from. */
static file_offset prev_saved_doc_string_position;
/* Nonzero means inside a new-style backquote
/* True means inside a new-style backquote
with no surrounding parentheses.
Fread initializes this to zero, so we need not specbind it
Fread initializes this to false, so we need not specbind it
or worry about what happens to it when there is an error. */
static int new_backquote_flag;
static bool new_backquote_flag;
static Lisp_Object Qold_style_backquotes;
/* A list of file names for files being loaded in Fload. Used to
......@@ -150,7 +150,7 @@ static Lisp_Object Vloads_in_progress;
static int read_emacs_mule_char (int, int (*) (int, Lisp_Object),
Lisp_Object);
static void readevalloop (Lisp_Object, FILE*, Lisp_Object, int,
static void readevalloop (Lisp_Object, FILE *, Lisp_Object, bool,
Lisp_Object, Lisp_Object,
Lisp_Object, Lisp_Object);
static Lisp_Object load_unwind (Lisp_Object);
......@@ -192,7 +192,7 @@ readchar (Lisp_Object readcharfun, bool *multibyte)
int (*readbyte) (int, Lisp_Object);
unsigned char buf[MAX_MULTIBYTE_LENGTH];
int i, len;
int emacs_mule_encoding = 0;
bool emacs_mule_encoding = 0;
if (multibyte)
*multibyte = 0;
......@@ -546,10 +546,10 @@ read_emacs_mule_char (int c, int (*readbyte) (int, Lisp_Object), Lisp_Object rea
static Lisp_Object read_internal_start (Lisp_Object, Lisp_Object,
Lisp_Object);
static Lisp_Object read0 (Lisp_Object);
static Lisp_Object read1 (Lisp_Object, int *, int);
static Lisp_Object read1 (Lisp_Object, int *, bool);
static Lisp_Object read_list (int, Lisp_Object);
static Lisp_Object read_vector (Lisp_Object, int);
static Lisp_Object read_list (bool, Lisp_Object);
static Lisp_Object read_vector (Lisp_Object, bool);
static Lisp_Object substitute_object_recurse (Lisp_Object, Lisp_Object,
Lisp_Object);
......@@ -562,28 +562,28 @@ static void substitute_in_interval (INTERVAL, Lisp_Object);
/* Read input events until we get one that's acceptable for our purposes.
If NO_SWITCH_FRAME is non-zero, switch-frame events are stashed
If NO_SWITCH_FRAME, switch-frame events are stashed
until we get a character we like, and then stuffed into
unread_switch_frame.
If ASCII_REQUIRED is non-zero, we check function key events to see
If ASCII_REQUIRED, check function key events to see
if the unmodified version of the symbol has a Qascii_character
property, and use that character, if present.
If ERROR_NONASCII is non-zero, we signal an error if the input we
get isn't an ASCII character with modifiers. If it's zero but
ASCII_REQUIRED is non-zero, we just re-read until we get an ASCII
If ERROR_NONASCII, signal an error if the input we
get isn't an ASCII character with modifiers. If it's false but
ASCII_REQUIRED is true, just re-read until we get an ASCII
character.
If INPUT_METHOD is nonzero, we invoke the current input method
If INPUT_METHOD, invoke the current input method
if the character warrants that.
If SECONDS is a number, we wait that many seconds for input, and
If SECONDS is a number, wait that many seconds for input, and
return Qnil if no input arrives within that time. */
static Lisp_Object
read_filtered_event (int no_switch_frame, int ascii_required,
int error_nonascii, int input_method, Lisp_Object seconds)
read_filtered_event (bool no_switch_frame, bool ascii_required,
bool error_nonascii, bool input_method, Lisp_Object seconds)
{
Lisp_Object val, delayed_switch_frame;
EMACS_TIME end_time;
......@@ -767,7 +767,7 @@ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,
positioned following the first line, if it is a comment or #! line,
otherwise nothing is read. */
static int
static bool
lisp_file_lexically_bound_p (Lisp_Object readcharfun)
{
int ch = READCHAR;
......@@ -797,11 +797,11 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
else
/* Look for an appropriate file-variable in the first line. */
{
int rv = 0;
bool rv = 0;
enum {
NOMINAL, AFTER_FIRST_DASH, AFTER_ASTERIX,
} beg_end_state = NOMINAL;
int in_file_vars = 0;
bool in_file_vars = 0;
#define UPDATE_BEG_END_STATE(ch) \
if (beg_end_state == NOMINAL) \
......@@ -897,20 +897,17 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
because of an incompatible change in the byte compiler. */
static int
safe_to_load_p (int fd)
safe_to_load_version (int fd)
{
char buf[512];
int nbytes, i;
int safe_p = 1;
int version = 1;
/* Read the first few bytes from the file, and look for a line
specifying the byte compiler version used. */
nbytes = emacs_read (fd, buf, sizeof buf - 1);
nbytes = emacs_read (fd, buf, sizeof buf);
if (nbytes > 0)
{
buf[nbytes] = '\0';
/* Skip to the next newline, skipping over the initial `ELC'
with NUL bytes following it, but note the version. */
for (i = 0; i < nbytes && buf[i] != '\n'; ++i)
......@@ -920,13 +917,11 @@ safe_to_load_p (int fd)
if (i >= nbytes
|| fast_c_string_match_ignore_case (Vbytecomp_version_regexp,
buf + i, nbytes - i) < 0)
safe_p = 0;
version = 0;
}
if (safe_p)
safe_p = version;
lseek (fd, 0, SEEK_SET);
return safe_p;
return version;
}
......@@ -1030,12 +1025,12 @@ Return t if the file exists and loads successfully. */)
ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1, gcpro2, gcpro3;
Lisp_Object found, efound, hist_file_name;
/* 1 means we printed the ".el is newer" message. */
int newer = 0;
/* 1 means we are loading a compiled file. */
int compiled = 0;
/* True means we printed the ".el is newer" message. */
bool newer = 0;
/* True means we are loading a compiled file. */
bool compiled = 0;
Lisp_Object handler;
int safe_p = 1;
bool safe_p = 1;
const char *fmode = "r";
Lisp_Object tmp[2];
int version;
......@@ -1190,7 +1185,7 @@ Return t if the file exists and loads successfully. */)
record_unwind_protect (load_warn_old_style_backquotes, file);
if (!memcmp (SDATA (found) + SBYTES (found) - 4, ".elc", 4)
|| (fd >= 0 && (version = safe_to_load_p (fd)) > 0))
|| (fd >= 0 && (version = safe_to_load_version (fd)) > 0))
/* Load .elc files directly, but not when they are
remote and have no handler! */
{
......@@ -1202,7 +1197,7 @@ Return t if the file exists and loads successfully. */)
GCPRO3 (file, found, hist_file_name);
if (version < 0
&& ! (version = safe_to_load_p (fd)))
&& ! (version = safe_to_load_version (fd)))
{
safe_p = 0;
if (!load_dangerous_libraries)
......@@ -1394,10 +1389,10 @@ close_load_descs (void)
#endif
}
static int
static bool
complete_filename_p (Lisp_Object pathname)
{
register const unsigned char *s = SDATA (pathname);
const unsigned char *s = SDATA (pathname);
return (IS_DIRECTORY_SEP (s[0])
|| (SCHARS (pathname) > 2
&& IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2])));
......@@ -1447,11 +1442,11 @@ static Lisp_Object Qdir_ok;
int
openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *storeptr, Lisp_Object predicate)
{
register int fd;
int fd;
ptrdiff_t fn_size = 100;
char buf[100];
register char *fn = buf;
int absolute = 0;
char *fn = buf;
bool absolute = 0;
ptrdiff_t want_length;
Lisp_Object filename;
struct stat st;
......@@ -1503,7 +1498,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
{
ptrdiff_t fnlen, lsuffix = SBYTES (XCAR (tail));
Lisp_Object handler;
int exists;
bool exists;
/* Concatenate path element/specified name with the suffix.
If the directory starts with /:, remove that. */
......@@ -1588,14 +1583,16 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
the source has an associated file name or not.
FILENAME is the file name that we are loading from.
ENTIRE is 1 if loading that entire file, 0 if evaluating part of it. */
ENTIRE is true if loading that entire file, false if evaluating
part of it. */
static void
build_load_history (Lisp_Object filename, int entire)
build_load_history (Lisp_Object filename, bool entire)
{
register Lisp_Object tail, prev, newelt;
register Lisp_Object tem, tem2;
register int foundit = 0;
Lisp_Object tail, prev, newelt;
Lisp_Object tem, tem2;
bool foundit = 0;
tail = Vload_history;
prev = Qnil;
......@@ -1680,7 +1677,7 @@ static void
readevalloop (Lisp_Object readcharfun,
FILE *stream,
Lisp_Object sourcename,
int printflag,
bool printflag,
Lisp_Object unibyte, Lisp_Object readfun,
Lisp_Object start, Lisp_Object end)
{
......@@ -1689,12 +1686,12 @@ readevalloop (Lisp_Object readcharfun,
ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
struct buffer *b = 0;
int continue_reading_p;
bool continue_reading_p;
Lisp_Object lex_bound;
/* Nonzero if reading an entire buffer. */
int whole_buffer = 0;
/* 1 on the first time around. */
int first_sexp = 1;
/* True if reading an entire buffer. */
bool whole_buffer = 0;
/* True on the first time around. */
bool first_sexp = 1;
Lisp_Object macroexpand = intern ("internal-macroexpand-for-load");
if (NILP (Ffboundp (macroexpand))
......@@ -2072,9 +2069,9 @@ static char *read_buffer;
If the escape sequence forces unibyte, return eight-bit char. */
static int
read_escape (Lisp_Object readcharfun, int stringp)
read_escape (Lisp_Object readcharfun, bool stringp)
{
register int c = READCHAR;
int c = READCHAR;
/* \u allows up to four hex digits, \U up to eight. Default to the
behavior for \u, and change this value in the case that \U is seen. */
int unicode_hex_count = 4;
......@@ -2375,10 +2372,10 @@ read_integer (Lisp_Object readcharfun, EMACS_INT radix)
in *PCH and the return value is not interesting. Else, we store
zero in *PCH and we read and return one lisp object.
FIRST_IN_LIST is nonzero if this is the first element of a list. */
FIRST_IN_LIST is true if this is the first element of a list. */
static Lisp_Object
read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
{
int c;
bool uninterned_symbol = 0;
......@@ -2803,10 +2800,11 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
else
{
Lisp_Object value;
bool saved_new_backquote_flag = new_backquote_flag;
new_backquote_flag++;
new_backquote_flag = 1;
value = read0 (readcharfun);
new_backquote_flag--;
new_backquote_flag = saved_new_backquote_flag;
return Fcons (Qbackquote, Fcons (value, Qnil));
}
......@@ -2858,7 +2856,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
{
int modifiers;
int next_char;
int ok;
bool ok;
c = READCHAR;
if (c < 0)
......@@ -2894,14 +2892,14 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
{
char *p = read_buffer;
char *end = read_buffer + read_buffer_size;
register int ch;
/* Nonzero if we saw an escape sequence specifying
int ch;
/* True if we saw an escape sequence specifying
a multibyte character. */
int force_multibyte = 0;
/* Nonzero if we saw an escape sequence specifying
bool force_multibyte = 0;
/* True if we saw an escape sequence specifying
a single-byte character. */
int force_singlebyte = 0;
int cancel = 0;
bool force_singlebyte = 0;
bool cancel = 0;
ptrdiff_t nchars = 0;
while ((ch = READCHAR) >= 0
......@@ -3033,7 +3031,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
read_symbol:
{
char *p = read_buffer;
int quoted = 0;
bool quoted = 0;
EMACS_INT start_position = readchar_count - 1;
{
......@@ -3250,17 +3248,17 @@ substitute_in_interval (INTERVAL interval, Lisp_Object arg)
/* Convert STRING to a number, assuming base BASE. Return a fixnum if CP has
integer syntax and fits in a fixnum, else return the nearest float if CP has
either floating point or integer syntax and BASE is 10, else return nil. If
IGNORE_TRAILING is nonzero, consider just the longest prefix of CP that has
IGNORE_TRAILING, consider just the longest prefix of CP that has
valid floating point syntax. Signal an overflow if BASE is not 10 and the
number has integer syntax but does not fit. */
Lisp_Object
string_to_number (char const *string, int base, int ignore_trailing)
string_to_number (char const *string, int base, bool ignore_trailing)
{
int state;
char const *cp = string;
int leading_digit;
int float_syntax = 0;
bool float_syntax = 0;
double value = 0;
/* 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)
/* Negate the value ourselves. This treats 0, NaNs, and infinity properly on
IEEE floating point hosts, and works around a formerly-common bug where
atof ("-0.0") drops the sign. */
int negative = *cp == '-';
bool negative = *cp == '-';
int signedp = negative || *cp == '+';
bool signedp = negative || *cp == '+';
cp += signedp;
state = 0;
......@@ -3365,7 +3363,7 @@ string_to_number (char const *string, int base, int ignore_trailing)
uintmax_t n;
/* Fast special case for single-digit integers. This also avoids a
glitch when BASE is 16 and IGNORE_TRAILING is nonzero, because in that
glitch when BASE is 16 and IGNORE_TRAILING, because in that
case some versions of strtoumax accept numbers like "0x1" that Emacs
does not allow. */
if (digit_to_number (string[signedp + 1], base) < 0)
......@@ -3401,12 +3399,12 @@ string_to_number (char const *string, int base, int ignore_trailing)
static Lisp_Object
read_vector (Lisp_Object readcharfun, int bytecodeflag)
read_vector (Lisp_Object readcharfun, bool bytecodeflag)
{
ptrdiff_t i, size;
register Lisp_Object *ptr;
register Lisp_Object tem, item, vector;
register struct Lisp_Cons *otem;
Lisp_Object *ptr;
Lisp_Object tem, item, vector;
struct Lisp_Cons *otem;
Lisp_Object len;
tem = read_list (1, readcharfun);
......@@ -3478,13 +3476,13 @@ read_vector (Lisp_Object readcharfun, int bytecodeflag)
return vector;
}
/* FLAG = 1 means check for ] to terminate rather than ) and . */
/* FLAG means check for ] to terminate rather than ) and . */
static Lisp_Object
read_list (int flag, register Lisp_Object readcharfun)
read_list (bool flag, Lisp_Object readcharfun)
{
Lisp_Object val, tail;
register Lisp_Object elt, tem;
Lisp_Object elt, tem;
struct gcpro gcpro1, gcpro2;
/* 0 is the normal case.
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)
int doc_reference = 0;
/* Initialize this to 1 if we are reading a list. */
int first_in_list = flag <= 0;
bool first_in_list = flag <= 0;
val = Qnil;
tail = Qnil;
......
......@@ -84,7 +84,7 @@ macro before appending to it. */)
{
ptrdiff_t i;
EMACS_INT len;
int cvt;
bool cvt;
/* Check the type of last-kbd-macro in case Lisp code changed it. */
CHECK_VECTOR_OR_STRING (KVAR (current_kboard, Vlast_kbd_macro));
......
......@@ -91,7 +91,7 @@ clear_charpos_cache (struct buffer *b)
#define CONSIDER(CHARPOS, BYTEPOS) \
{ \
ptrdiff_t this_charpos = (CHARPOS); \
int changed = 0; \
bool changed = 0; \
\
if (this_charpos == charpos) \
{ \
......@@ -190,7 +190,7 @@ buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos)
if (charpos - best_below < best_above - charpos)
{
int record = charpos - best_below > 5000;
bool record = charpos - best_below > 5000;
while (best_below != charpos)
{
......@@ -215,7 +215,7 @@ buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos)
}
else
{
int record = best_above - charpos > 5000;
bool record = best_above - charpos > 5000;
while (best_above != charpos)
{
......@@ -335,7 +335,7 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos)
if (bytepos - best_below_byte < best_above_byte - bytepos)
{
int record = bytepos - best_below_byte > 5000;
bool record = bytepos - best_below_byte > 5000;
while (best_below_byte < bytepos)
{
......@@ -362,7 +362,7 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos)
}
else
{
int record = best_above_byte - bytepos > 5000;
bool record = best_above_byte - bytepos > 5000;
while (best_above_byte > bytepos)
{
......@@ -479,10 +479,10 @@ live_buffer (Lisp_Object buffer)
static Lisp_Object
set_marker_internal (Lisp_Object marker, Lisp_Object position,
Lisp_Object buffer, int restricted)
Lisp_Object buffer, bool restricted)
{
register struct Lisp_Marker *m;
register struct buffer *b = live_buffer (buffer);
struct Lisp_Marker *m;
struct buffer *b = live_buffer (buffer);
CHECK_MARKER (marker);
m = XMARKER (marker);
......
......@@ -519,14 +519,15 @@ list_of_panes (Lisp_Object menu)
/* Set up data in menu_items for a menu bar item
whose event type is ITEM_KEY (with string ITEM_NAME)
and whose contents come from the list of keymaps MAPS. */
int
parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name, Lisp_Object maps)
bool
parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name,
Lisp_Object maps)
{
Lisp_Object length;
EMACS_INT len;
Lisp_Object *mapvec;
ptrdiff_t i;
int top_level_items = 0;
bool top_level_items = 0;
USE_SAFE_ALLOCA;
length = Flength (maps);
......@@ -616,13 +617,13 @@ free_menubar_widget_value_tree (widget_value *wv)
in menu_items starting at index START, up to index END. */
widget_value *
digest_single_submenu (int start, int end, int top_level_items)
digest_single_submenu (int start, int end, bool top_level_items)
{
widget_value *wv, *prev_wv, *save_wv, *first_wv;
int i;
int submenu_depth = 0;
widget_value **submenu_stack;
int panes_seen = 0;
bool panes_seen = 0;
submenu_stack = alloca (menu_items_used * sizeof *submenu_stack);
wv = xmalloc_widget_value ();
......@@ -668,7 +669,7 @@ digest_single_submenu (int start, int end, int top_level_items)
Lisp_Object pane_name;
const char *pane_string;
panes_seen++;
panes_seen = 1;
pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME);
......@@ -735,7 +736,7 @@ digest_single_submenu (int start, int end, int top_level_items)
Lisp_Object help;
/* All items should be contained in panes. */
if (panes_seen == 0)
if (! panes_seen)
emacs_abort ();
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
#ifdef HAVE_NS
/* As above, but return the menu selection instead of storing in kb buffer.
If keymaps==1, return full prefixes to selection. */
If KEYMAPS, return full prefixes to selection. */
Lisp_Object
find_and_return_menu_selection (FRAME_PTR f, int keymaps, void *client_data)
find_and_return_menu_selection (FRAME_PTR f, bool keymaps, void *client_data)
{
Lisp_Object prefix, entry;
int i;
......@@ -999,7 +1000,7 @@ find_and_return_menu_selection (FRAME_PTR f, int keymaps, void *client_data)
= AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
if (aref_addr (menu_items, i) == client_data)
{
if (keymaps != 0)
if (keymaps)
{
int j;
......@@ -1071,8 +1072,8 @@ no quit occurs and `x-popup-menu' returns nil. */)
Lisp_Object selection = Qnil;
FRAME_PTR f = NULL;
Lisp_Object x, y, window;
int keymaps = 0;
int for_click = 0;
bool keymaps = 0;
bool for_click = 0;
ptrdiff_t specpdl_count = SPECPDL_INDEX ();
struct gcpro gcpro1;
......@@ -1083,7 +1084,7 @@ no quit occurs and `x-popup-menu' returns nil. */)
#ifdef HAVE_MENUS
{
int get_current_pos_p = 0;
bool get_current_pos_p = 0;
/* FIXME!! check_w32 (); or check_x (); or check_ns (); */
/* Decode the first argument: find the window and the coordinates. */
......
......@@ -29,7 +29,7 @@ extern void init_menu_items (void);
extern void finish_menu_items (void) ATTRIBUTE_CONST;
extern void discard_menu_items (void);
extern void save_menu_items (void);
extern int parse_single_submenu (Lisp_Object, Lisp_Object, Lisp_Object);
extern bool parse_single_submenu (Lisp_Object, Lisp_Object, Lisp_Object);
extern void list_of_panes (Lisp_Object);
#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI) \
|| defined (HAVE_NS)
......@@ -38,7 +38,7 @@ extern void update_submenu_strings (widget_value *);
extern void find_and_call_menu_selection (FRAME_PTR, int,
Lisp_Object, void *);
extern widget_value *xmalloc_widget_value (void);
extern widget_value *digest_single_submenu (int, int, int);
extern widget_value *digest_single_submenu (int, int, bool);
#endif
#ifdef HAVE_X_WINDOWS
......@@ -47,8 +47,8 @@ extern void mouse_position_for_popup (FRAME_PTR f, int *x, int *y);
extern Lisp_Object w32_menu_show (FRAME_PTR, int, int, int, int,
Lisp_Object, const char **);
extern Lisp_Object ns_menu_show (FRAME_PTR, int, int, int, int,
extern Lisp_Object ns_menu_show (FRAME_PTR, int, int, bool, bool,
Lisp_Object, const char **);
extern Lisp_Object xmenu_show (FRAME_PTR, int, int, int, int,
extern Lisp_Object xmenu_show (FRAME_PTR, int, int, bool, bool,
Lisp_Object, const char **, Time);
#endif /* MENU_H */
......@@ -173,17 +173,6 @@ without invoking the usual minibuffer commands. */)
static Lisp_Object read_minibuf_unwind (Lisp_Object);
static Lisp_Object run_exit_minibuf_hook (Lisp_Object);
static Lisp_Object read_minibuf (Lisp_Object, Lisp_Object,
Lisp_Object,
int, Lisp_Object,
Lisp_Object, Lisp_Object,
int, int);