aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorPaul Eggert2012-08-27 10:23:48 -0700
committerPaul Eggert2012-08-27 10:23:48 -0700
commitde1339b0a8a5b6b8bf784c816b2b974f4610e3ac (patch)
tree2a77a2ce1b781f5cf30c734e9b0919a6ff3264ec /src/data.c
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.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c49
1 files changed, 24 insertions, 25 deletions
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 {