aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-08-27 10:23:48 -0700
committerPaul Eggert2012-08-27 10:23:48 -0700
commitde1339b0a8a5b6b8bf784c816b2b974f4610e3ac (patch)
tree2a77a2ce1b781f5cf30c734e9b0919a6ff3264ec
parentf10fe38f772c29031a23ef7aa92d2de1b3675461 (diff)
downloademacs-de1339b0a8a5b6b8bf784c816b2b974f4610e3ac.tar.gz
emacs-de1339b0a8a5b6b8bf784c816b2b974f4610e3ac.zip
* composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
* composite.c (find_composition, composition_gstring_p) (composition_reseat_it, find_automatic_composition): * data.c (let_shadows_buffer_binding_p) (let_shadows_global_binding_p, set_internal, make_blv) (Fmake_variable_buffer_local, Fmake_local_variable) (Fmake_variable_frame_local, arithcompare, cons_to_unsigned) (cons_to_signed, arith_driver): * dbusbind.c (xd_in_read_queued_messages): * dired.c (directory_files_internal, file_name_completion): Use bool for booleans. * dired.c (file_name_completion): * process.h (fd_callback): Omit int (actually boolean) argument. It wasn't being used. All uses changed. * composite.h, lisp.h: Reflect above API changes.
-rw-r--r--src/ChangeLog17
-rw-r--r--src/composite.c22
-rw-r--r--src/composite.h13
-rw-r--r--src/data.c49
-rw-r--r--src/dbusbind.c7
-rw-r--r--src/dired.c30
-rw-r--r--src/lisp.h4
-rw-r--r--src/process.c16
-rw-r--r--src/process.h2
-rw-r--r--src/xsmfns.c2
10 files changed, 89 insertions, 73 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7be88c568e2..15d5211efd9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,22 @@
12012-08-27 Paul Eggert <eggert@cs.ucla.edu> 12012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4 * composite.c (find_composition, composition_gstring_p)
5 (composition_reseat_it, find_automatic_composition):
6 * data.c (let_shadows_buffer_binding_p)
7 (let_shadows_global_binding_p, set_internal, make_blv)
8 (Fmake_variable_buffer_local, Fmake_local_variable)
9 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
10 (cons_to_signed, arith_driver):
11 * dbusbind.c (xd_in_read_queued_messages):
12 * dired.c (directory_files_internal, file_name_completion):
13 Use bool for booleans.
14 * dired.c (file_name_completion):
15 * process.h (fd_callback):
16 Omit int (actually boolean) argument. It wasn't being used.
17 All uses changed.
18 * composite.h, lisp.h: Reflect above API changes.
19
3 * cmds.c, coding.c: Use bool for booleans. 20 * cmds.c, coding.c: Use bool for booleans.
4 * cmds.c (move_point, Fself_insert_command): 21 * cmds.c (move_point, Fself_insert_command):
5 * coding.h (struct composition status, struct coding_system): 22 * coding.h (struct composition status, struct coding_system):
diff --git a/src/composite.c b/src/composite.c
index 4e90e9bb914..eddabb66d33 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -428,7 +428,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars,
428 428
429 This doesn't check the validity of composition. */ 429 This doesn't check the validity of composition. */
430 430
431int 431bool
432find_composition (ptrdiff_t pos, ptrdiff_t limit, 432find_composition (ptrdiff_t pos, ptrdiff_t limit,
433 ptrdiff_t *start, ptrdiff_t *end, 433 ptrdiff_t *start, ptrdiff_t *end,
434 Lisp_Object *prop, Lisp_Object object) 434 Lisp_Object *prop, Lisp_Object object)
@@ -709,7 +709,7 @@ static Lisp_Object fill_gstring_header (Lisp_Object, Lisp_Object,
709 Lisp_Object, Lisp_Object, 709 Lisp_Object, Lisp_Object,
710 Lisp_Object); 710 Lisp_Object);
711 711
712int 712bool
713composition_gstring_p (Lisp_Object gstring) 713composition_gstring_p (Lisp_Object gstring)
714{ 714{
715 Lisp_Object header; 715 Lisp_Object header;
@@ -1212,11 +1212,13 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos,
1212 string. In that case, FACE must not be NULL. 1212 string. In that case, FACE must not be NULL.
1213 1213
1214 If the character is composed, setup members of CMP_IT (id, nglyphs, 1214 If the character is composed, setup members of CMP_IT (id, nglyphs,
1215 from, to, reversed_p), and return 1. Otherwise, update 1215 from, to, reversed_p), and return true. Otherwise, update
1216 CMP_IT->stop_pos, and return 0. */ 1216 CMP_IT->stop_pos, and return false. */
1217 1217
1218int 1218bool
1219composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t endpos, struct window *w, struct face *face, Lisp_Object string) 1219composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos,
1220 ptrdiff_t bytepos, ptrdiff_t endpos, struct window *w,
1221 struct face *face, Lisp_Object string)
1220{ 1222{
1221 if (endpos < 0) 1223 if (endpos < 0)
1222 endpos = NILP (string) ? BEGV : 0; 1224 endpos = NILP (string) ? BEGV : 0;
@@ -1482,10 +1484,10 @@ struct position_record
1482/* This is like find_composition, but find an automatic composition 1484/* This is like find_composition, but find an automatic composition
1483 instead. It is assured that POS is not within a static 1485 instead. It is assured that POS is not within a static
1484 composition. If found, set *GSTRING to the glyph-string 1486 composition. If found, set *GSTRING to the glyph-string
1485 representing the composition, and return 1. Otherwise, *GSTRING to 1487 representing the composition, and return true. Otherwise, *GSTRING to
1486 Qnil, and return 0. */ 1488 Qnil, and return false. */
1487 1489
1488static int 1490static bool
1489find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit, 1491find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit,
1490 ptrdiff_t *start, ptrdiff_t *end, 1492 ptrdiff_t *start, ptrdiff_t *end,
1491 Lisp_Object *gstring, Lisp_Object string) 1493 Lisp_Object *gstring, Lisp_Object string)
@@ -1498,7 +1500,7 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit,
1498 int c; 1500 int c;
1499 Lisp_Object window; 1501 Lisp_Object window;
1500 struct window *w; 1502 struct window *w;
1501 int need_adjustment = 0; 1503 bool need_adjustment = 0;
1502 1504
1503 window = Fget_buffer_window (Fcurrent_buffer (), Qnil); 1505 window = Fget_buffer_window (Fcurrent_buffer (), Qnil);
1504 if (NILP (window)) 1506 if (NILP (window))
diff --git a/src/composite.h b/src/composite.h
index 6a7e0a5e2c7..68f5b27ee42 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -223,8 +223,8 @@ extern Lisp_Object Qcomposition;
223extern Lisp_Object composition_hash_table; 223extern Lisp_Object composition_hash_table;
224extern ptrdiff_t get_composition_id (ptrdiff_t, ptrdiff_t, ptrdiff_t, 224extern ptrdiff_t get_composition_id (ptrdiff_t, ptrdiff_t, ptrdiff_t,
225 Lisp_Object, Lisp_Object); 225 Lisp_Object, Lisp_Object);
226extern int find_composition (ptrdiff_t, ptrdiff_t, ptrdiff_t *, ptrdiff_t *, 226extern bool find_composition (ptrdiff_t, ptrdiff_t, ptrdiff_t *, ptrdiff_t *,
227 Lisp_Object *, Lisp_Object); 227 Lisp_Object *, Lisp_Object);
228extern void update_compositions (ptrdiff_t, ptrdiff_t, int); 228extern void update_compositions (ptrdiff_t, ptrdiff_t, int);
229extern void make_composition_value_copy (Lisp_Object); 229extern void make_composition_value_copy (Lisp_Object);
230extern void compose_region (int, int, Lisp_Object, Lisp_Object, 230extern void compose_region (int, int, Lisp_Object, Lisp_Object,
@@ -310,17 +310,16 @@ struct font_metrics;
310 310
311extern Lisp_Object composition_gstring_put_cache (Lisp_Object, ptrdiff_t); 311extern Lisp_Object composition_gstring_put_cache (Lisp_Object, ptrdiff_t);
312extern Lisp_Object composition_gstring_from_id (ptrdiff_t); 312extern Lisp_Object composition_gstring_from_id (ptrdiff_t);
313extern int composition_gstring_p (Lisp_Object); 313extern bool composition_gstring_p (Lisp_Object);
314extern int composition_gstring_width (Lisp_Object, ptrdiff_t, ptrdiff_t, 314extern int composition_gstring_width (Lisp_Object, ptrdiff_t, ptrdiff_t,
315 struct font_metrics *); 315 struct font_metrics *);
316 316
317extern void composition_compute_stop_pos (struct composition_it *, 317extern void composition_compute_stop_pos (struct composition_it *,
318 ptrdiff_t, ptrdiff_t, ptrdiff_t, 318 ptrdiff_t, ptrdiff_t, ptrdiff_t,
319 Lisp_Object); 319 Lisp_Object);
320extern int composition_reseat_it (struct composition_it *, 320extern bool composition_reseat_it (struct composition_it *, ptrdiff_t,
321 ptrdiff_t, ptrdiff_t, ptrdiff_t, 321 ptrdiff_t, ptrdiff_t, struct window *,
322 struct window *, struct face *, 322 struct face *, Lisp_Object);
323 Lisp_Object);
324extern int composition_update_it (struct composition_it *, 323extern int composition_update_it (struct composition_it *,
325 ptrdiff_t, ptrdiff_t, Lisp_Object); 324 ptrdiff_t, ptrdiff_t, Lisp_Object);
326 325
diff --git a/src/data.c b/src/data.c
index f121d8772c6..d8b7f42ea3f 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1080,10 +1080,10 @@ DEFUN ("set", Fset, Sset, 2, 2, 0,
1080 return newval; 1080 return newval;
1081} 1081}
1082 1082
1083/* Return 1 if SYMBOL currently has a let-binding 1083/* Return true if SYMBOL currently has a let-binding
1084 which was made in the buffer that is now current. */ 1084 which was made in the buffer that is now current. */
1085 1085
1086static int 1086static bool
1087let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol) 1087let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
1088{ 1088{
1089 struct specbinding *p; 1089 struct specbinding *p;
@@ -1102,7 +1102,7 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
1102 return 0; 1102 return 0;
1103} 1103}
1104 1104
1105static int 1105static bool
1106let_shadows_global_binding_p (Lisp_Object symbol) 1106let_shadows_global_binding_p (Lisp_Object symbol)
1107{ 1107{
1108 struct specbinding *p; 1108 struct specbinding *p;
@@ -1118,14 +1118,15 @@ let_shadows_global_binding_p (Lisp_Object symbol)
1118 If buffer/frame-locality is an issue, WHERE specifies which context to use. 1118 If buffer/frame-locality is an issue, WHERE specifies which context to use.
1119 (nil stands for the current buffer/frame). 1119 (nil stands for the current buffer/frame).
1120 1120
1121 If BINDFLAG is zero, then if this symbol is supposed to become 1121 If BINDFLAG is false, then if this symbol is supposed to become
1122 local in every buffer where it is set, then we make it local. 1122 local in every buffer where it is set, then we make it local.
1123 If BINDFLAG is nonzero, we don't do that. */ 1123 If BINDFLAG is true, we don't do that. */
1124 1124
1125void 1125void
1126set_internal (register Lisp_Object symbol, register Lisp_Object newval, register Lisp_Object where, int bindflag) 1126set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where,
1127 bool bindflag)
1127{ 1128{
1128 int voide = EQ (newval, Qunbound); 1129 bool voide = EQ (newval, Qunbound);
1129 struct Lisp_Symbol *sym; 1130 struct Lisp_Symbol *sym;
1130 Lisp_Object tem1; 1131 Lisp_Object tem1;
1131 1132
@@ -1464,7 +1465,8 @@ union Lisp_Val_Fwd
1464 }; 1465 };
1465 1466
1466static struct Lisp_Buffer_Local_Value * 1467static struct Lisp_Buffer_Local_Value *
1467make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents) 1468make_blv (struct Lisp_Symbol *sym, bool forwarded,
1469 union Lisp_Val_Fwd valcontents)
1468{ 1470{
1469 struct Lisp_Buffer_Local_Value *blv = xmalloc (sizeof *blv); 1471 struct Lisp_Buffer_Local_Value *blv = xmalloc (sizeof *blv);
1470 Lisp_Object symbol; 1472 Lisp_Object symbol;
@@ -1508,7 +1510,7 @@ The function `default-value' gets the default value and `set-default' sets it.
1508 struct Lisp_Symbol *sym; 1510 struct Lisp_Symbol *sym;
1509 struct Lisp_Buffer_Local_Value *blv = NULL; 1511 struct Lisp_Buffer_Local_Value *blv = NULL;
1510 union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO}); 1512 union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO});
1511 int forwarded IF_LINT (= 0); 1513 bool forwarded IF_LINT (= 0);
1512 1514
1513 CHECK_SYMBOL (variable); 1515 CHECK_SYMBOL (variable);
1514 sym = XSYMBOL (variable); 1516 sym = XSYMBOL (variable);
@@ -1580,10 +1582,10 @@ See also `make-variable-buffer-local'.
1580 1582
1581Do not use `make-local-variable' to make a hook variable buffer-local. 1583Do not use `make-local-variable' to make a hook variable buffer-local.
1582Instead, use `add-hook' and specify t for the LOCAL argument. */) 1584Instead, use `add-hook' and specify t for the LOCAL argument. */)
1583 (register Lisp_Object variable) 1585 (Lisp_Object variable)
1584{ 1586{
1585 register Lisp_Object tem; 1587 Lisp_Object tem;
1586 int forwarded IF_LINT (= 0); 1588 bool forwarded IF_LINT (= 0);
1587 union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO}); 1589 union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO});
1588 struct Lisp_Symbol *sym; 1590 struct Lisp_Symbol *sym;
1589 struct Lisp_Buffer_Local_Value *blv = NULL; 1591 struct Lisp_Buffer_Local_Value *blv = NULL;
@@ -1767,9 +1769,9 @@ is to set the VARIABLE frame parameter of that frame. See
1767Note that since Emacs 23.1, variables cannot be both buffer-local and 1769Note that since Emacs 23.1, variables cannot be both buffer-local and
1768frame-local any more (buffer-local bindings used to take precedence over 1770frame-local any more (buffer-local bindings used to take precedence over
1769frame-local bindings). */) 1771frame-local bindings). */)
1770 (register Lisp_Object variable) 1772 (Lisp_Object variable)
1771{ 1773{
1772 int forwarded; 1774 bool forwarded;
1773 union Lisp_Val_Fwd valcontents; 1775 union Lisp_Val_Fwd valcontents;
1774 struct Lisp_Symbol *sym; 1776 struct Lisp_Symbol *sym;
1775 struct Lisp_Buffer_Local_Value *blv = NULL; 1777 struct Lisp_Buffer_Local_Value *blv = NULL;
@@ -2225,7 +2227,7 @@ static Lisp_Object
2225arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison) 2227arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison)
2226{ 2228{
2227 double f1 = 0, f2 = 0; 2229 double f1 = 0, f2 = 0;
2228 int floatp = 0; 2230 bool floatp = 0;
2229 2231
2230 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num1); 2232 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num1);
2231 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num2); 2233 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num2);
@@ -2342,7 +2344,7 @@ DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0,
2342uintmax_t 2344uintmax_t
2343cons_to_unsigned (Lisp_Object c, uintmax_t max) 2345cons_to_unsigned (Lisp_Object c, uintmax_t max)
2344{ 2346{
2345 int valid = 0; 2347 bool valid = 0;
2346 uintmax_t val IF_LINT (= 0); 2348 uintmax_t val IF_LINT (= 0);
2347 if (INTEGERP (c)) 2349 if (INTEGERP (c))
2348 { 2350 {
@@ -2395,7 +2397,7 @@ cons_to_unsigned (Lisp_Object c, uintmax_t max)
2395intmax_t 2397intmax_t
2396cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max) 2398cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max)
2397{ 2399{
2398 int valid = 0; 2400 bool valid = 0;
2399 intmax_t val IF_LINT (= 0); 2401 intmax_t val IF_LINT (= 0);
2400 if (INTEGERP (c)) 2402 if (INTEGERP (c))
2401 { 2403 {
@@ -2513,14 +2515,11 @@ static Lisp_Object float_arith_driver (double, ptrdiff_t, enum arithop,
2513static Lisp_Object 2515static Lisp_Object
2514arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args) 2516arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args)
2515{ 2517{
2516 register Lisp_Object val; 2518 Lisp_Object val;
2517 ptrdiff_t argnum; 2519 ptrdiff_t argnum, ok_args;
2518 register EMACS_INT accum = 0; 2520 EMACS_INT accum = 0;
2519 register EMACS_INT next; 2521 EMACS_INT next, ok_accum;
2520 2522 bool overflow = 0;
2521 int overflow = 0;
2522 ptrdiff_t ok_args;
2523 EMACS_INT ok_accum;
2524 2523
2525 switch (code) 2524 switch (code)
2526 { 2525 {
diff --git a/src/dbusbind.c b/src/dbusbind.c
index f63f2948304..901820648cb 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -70,7 +70,7 @@ static Lisp_Object QCdbus_registered_signal;
70static Lisp_Object xd_registered_buses; 70static Lisp_Object xd_registered_buses;
71 71
72/* Whether we are reading a D-Bus event. */ 72/* Whether we are reading a D-Bus event. */
73static int xd_in_read_queued_messages = 0; 73static bool xd_in_read_queued_messages = 0;
74 74
75 75
76/* We use "xd_" and "XD_" as prefix for all internal symbols, because 76/* We use "xd_" and "XD_" as prefix for all internal symbols, because
@@ -997,8 +997,7 @@ xd_find_watch_fd (DBusWatch *watch)
997} 997}
998 998
999/* Prototype. */ 999/* Prototype. */
1000static void 1000static void xd_read_queued_messages (int fd, void *data);
1001xd_read_queued_messages (int fd, void *data, int for_read);
1002 1001
1003/* Start monitoring WATCH for possible I/O. */ 1002/* Start monitoring WATCH for possible I/O. */
1004static dbus_bool_t 1003static dbus_bool_t
@@ -1686,7 +1685,7 @@ xd_read_message (Lisp_Object bus)
1686 1685
1687/* Callback called when something is ready to read or write. */ 1686/* Callback called when something is ready to read or write. */
1688static void 1687static void
1689xd_read_queued_messages (int fd, void *data, int for_read) 1688xd_read_queued_messages (int fd, void *data)
1690{ 1689{
1691 Lisp_Object busp = xd_registered_buses; 1690 Lisp_Object busp = xd_registered_buses;
1692 Lisp_Object bus = Qnil; 1691 Lisp_Object bus = Qnil;
diff --git a/src/dired.c b/src/dired.c
index 771230717e3..206f370ed63 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -109,18 +109,20 @@ directory_files_internal_unwind (Lisp_Object dh)
109} 109}
110 110
111/* Function shared by Fdirectory_files and Fdirectory_files_and_attributes. 111/* Function shared by Fdirectory_files and Fdirectory_files_and_attributes.
112 When ATTRS is zero, return a list of directory filenames; when 112 If not ATTRS, return a list of directory filenames;
113 non-zero, return a list of directory filenames and their attributes. 113 if ATTRS, return a list of directory filenames and their attributes.
114 In the latter case, ID_FORMAT is passed to Ffile_attributes. */ 114 In the latter case, ID_FORMAT is passed to Ffile_attributes. */
115 115
116Lisp_Object 116Lisp_Object
117directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, int attrs, Lisp_Object id_format) 117directory_files_internal (Lisp_Object directory, Lisp_Object full,
118 Lisp_Object match, Lisp_Object nosort, bool attrs,
119 Lisp_Object id_format)
118{ 120{
119 DIR *d; 121 DIR *d;
120 ptrdiff_t directory_nbytes; 122 ptrdiff_t directory_nbytes;
121 Lisp_Object list, dirfilename, encoded_directory; 123 Lisp_Object list, dirfilename, encoded_directory;
122 struct re_pattern_buffer *bufp = NULL; 124 struct re_pattern_buffer *bufp = NULL;
123 int needsep = 0; 125 bool needsep = 0;
124 ptrdiff_t count = SPECPDL_INDEX (); 126 ptrdiff_t count = SPECPDL_INDEX ();
125 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 127 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
126 DIRENTRY *dp; 128 DIRENTRY *dp;
@@ -227,7 +229,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
227 if (DIRENTRY_NONEMPTY (dp)) 229 if (DIRENTRY_NONEMPTY (dp))
228 { 230 {
229 ptrdiff_t len; 231 ptrdiff_t len;
230 int wanted = 0; 232 bool wanted = 0;
231 Lisp_Object name, finalname; 233 Lisp_Object name, finalname;
232 struct gcpro gcpro1, gcpro2; 234 struct gcpro gcpro1, gcpro2;
233 235
@@ -381,9 +383,8 @@ which see. */)
381} 383}
382 384
383 385
384static Lisp_Object file_name_completion 386static Lisp_Object file_name_completion (Lisp_Object, Lisp_Object, bool,
385 (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, 387 Lisp_Object);
386 Lisp_Object predicate);
387 388
388DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion, 389DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion,
389 2, 3, 0, 390 2, 3, 0,
@@ -415,7 +416,7 @@ determined by the variable `completion-ignored-extensions', which see. */)
415 if (!NILP (handler)) 416 if (!NILP (handler))
416 return call4 (handler, Qfile_name_completion, file, directory, predicate); 417 return call4 (handler, Qfile_name_completion, file, directory, predicate);
417 418
418 return file_name_completion (file, directory, 0, 0, predicate); 419 return file_name_completion (file, directory, 0, predicate);
419} 420}
420 421
421DEFUN ("file-name-all-completions", Ffile_name_all_completions, 422DEFUN ("file-name-all-completions", Ffile_name_all_completions,
@@ -439,14 +440,15 @@ These are all file names in directory DIRECTORY which begin with FILE. */)
439 if (!NILP (handler)) 440 if (!NILP (handler))
440 return call3 (handler, Qfile_name_all_completions, file, directory); 441 return call3 (handler, Qfile_name_all_completions, file, directory);
441 442
442 return file_name_completion (file, directory, 1, 0, Qnil); 443 return file_name_completion (file, directory, 1, Qnil);
443} 444}
444 445
445static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr); 446static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr);
446static Lisp_Object Qdefault_directory; 447static Lisp_Object Qdefault_directory;
447 448
448static Lisp_Object 449static Lisp_Object
449file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, Lisp_Object predicate) 450file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
451 Lisp_Object predicate)
450{ 452{
451 DIR *d; 453 DIR *d;
452 ptrdiff_t bestmatchsize = 0; 454 ptrdiff_t bestmatchsize = 0;
@@ -459,10 +461,10 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
459 Lisp_Object encoded_dir; 461 Lisp_Object encoded_dir;
460 struct stat st; 462 struct stat st;
461 int directoryp; 463 int directoryp;
462 /* If includeall is zero, exclude files in completion-ignored-extensions as 464 /* If not INCLUDEALL, exclude files in completion-ignored-extensions as
463 well as "." and "..". Until shown otherwise, assume we can't exclude 465 well as "." and "..". Until shown otherwise, assume we can't exclude
464 anything. */ 466 anything. */
465 int includeall = 1; 467 bool includeall = 1;
466 ptrdiff_t count = SPECPDL_INDEX (); 468 ptrdiff_t count = SPECPDL_INDEX ();
467 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 469 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
468 470
@@ -500,7 +502,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
500 { 502 {
501 DIRENTRY *dp; 503 DIRENTRY *dp;
502 ptrdiff_t len; 504 ptrdiff_t len;
503 int canexclude = 0; 505 bool canexclude = 0;
504 506
505 errno = 0; 507 errno = 0;
506 dp = readdir (d); 508 dp = readdir (d);
diff --git a/src/lisp.h b/src/lisp.h
index 9ae24998aa2..127177e44c7 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2620,7 +2620,7 @@ extern _Noreturn void args_out_of_range_3 (Lisp_Object, Lisp_Object,
2620 Lisp_Object); 2620 Lisp_Object);
2621extern _Noreturn Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object); 2621extern _Noreturn Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object);
2622extern Lisp_Object do_symval_forwarding (union Lisp_Fwd *); 2622extern Lisp_Object do_symval_forwarding (union Lisp_Fwd *);
2623extern void set_internal (Lisp_Object, Lisp_Object, Lisp_Object, int); 2623extern void set_internal (Lisp_Object, Lisp_Object, Lisp_Object, bool);
2624extern void syms_of_data (void); 2624extern void syms_of_data (void);
2625extern void init_data (void); 2625extern void init_data (void);
2626extern void swap_in_global_binding (struct Lisp_Symbol *); 2626extern void swap_in_global_binding (struct Lisp_Symbol *);
@@ -3434,7 +3434,7 @@ extern void syms_of_ccl (void);
3434extern void syms_of_dired (void); 3434extern void syms_of_dired (void);
3435extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object, 3435extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object,
3436 Lisp_Object, Lisp_Object, 3436 Lisp_Object, Lisp_Object,
3437 int, Lisp_Object); 3437 bool, Lisp_Object);
3438 3438
3439/* Defined in term.c */ 3439/* Defined in term.c */
3440extern int *char_ins_del_vector; 3440extern int *char_ins_del_vector;
diff --git a/src/process.c b/src/process.c
index 7f6f6bafbea..64c70c49590 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4870,15 +4870,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4870 for (channel = 0; channel <= max_input_desc; ++channel) 4870 for (channel = 0; channel <= max_input_desc; ++channel)
4871 { 4871 {
4872 struct fd_callback_data *d = &fd_callback_info[channel]; 4872 struct fd_callback_data *d = &fd_callback_info[channel];
4873 if (FD_ISSET (channel, &Available) 4873 if (d->func
4874 && d->func != 0 4874 && ((d->condition & FOR_READ
4875 && (d->condition & FOR_READ) != 0) 4875 && FD_ISSET (channel, &Available))
4876 d->func (channel, d->data, 1); 4876 || (d->condition & FOR_WRITE
4877 if (FD_ISSET (channel, &write_mask) 4877 && FD_ISSET (channel, &write_mask))))
4878 && d->func != 0 4878 d->func (channel, d->data);
4879 && (d->condition & FOR_WRITE) != 0) 4879 }
4880 d->func (channel, d->data, 0);
4881 }
4882 4880
4883 for (channel = 0; channel <= max_process_desc; channel++) 4881 for (channel = 0; channel <= max_process_desc; channel++)
4884 { 4882 {
diff --git a/src/process.h b/src/process.h
index b963f4ca05c..ce3d2e702cc 100644
--- a/src/process.h
+++ b/src/process.h
@@ -219,7 +219,7 @@ extern void hold_keyboard_input (void);
219extern void unhold_keyboard_input (void); 219extern void unhold_keyboard_input (void);
220extern int kbd_on_hold_p (void); 220extern int kbd_on_hold_p (void);
221 221
222typedef void (*fd_callback)(int fd, void *data, int for_read); 222typedef void (*fd_callback) (int fd, void *data);
223 223
224extern void add_read_fd (int fd, fd_callback func, void *data); 224extern void add_read_fd (int fd, fd_callback func, void *data);
225extern void delete_read_fd (int fd); 225extern void delete_read_fd (int fd);
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 1f6eb84260e..cddbb2aae86 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -97,7 +97,7 @@ ice_connection_closed (void)
97 open to a session manager, just return. */ 97 open to a session manager, just return. */
98 98
99static void 99static void
100x_session_check_input (int fd, void *data, int for_read) 100x_session_check_input (int fd, void *data)
101{ 101{
102 int ret; 102 int ret;
103 103