aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2012-09-05 00:18:46 -0700
committerPaul Eggert2012-09-05 00:18:46 -0700
commitf75d7a913dd0fae7a739d12f704fca024c065c3e (patch)
tree5f7d36acdd831dcc0f377f39866bb33804ce741a /src
parent7e570fbf3ef8ccd31df2651f5d2775c5697d5950 (diff)
downloademacs-f75d7a913dd0fae7a739d12f704fca024c065c3e.tar.gz
emacs-f75d7a913dd0fae7a739d12f704fca024c065c3e.zip
* fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
* fileio.c (auto_saving, auto_save_error_occurred, make_temp_name) (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file) (file_name_absolute_p, Fsubstitute_in_file_name): (check_executable, check_writable, Ffile_accessible_directory_p) (Fset_file_selinux_context, Fdefault_file_modes) (Finsert_file_contents, choose_write_coding_system) (Fwrite_region, build_annotations, a_write, e_write) (Fdo_auto_save): * filelock.c (boot_time_initialized, get_boot_time) (get_boot_time_1, lock_file_1, within_one_second): * floatfns.c (in_float): * fns.c (concat, internal_equal, Frequire, base64_encode_1) (base64_decode_1, cmpfn_eql, cmpfn_user_defined) (sweep_weak_table, sweep_weak_hash_tables, secure_hash): * lisp.h (struct Lisp_Hash_Table.cmpfn): * window.c (compare_window_configurations): Use bool for booleans. * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits) (Fdefault_file_modes): Now mode_t, not int, for modes. (Fdo_auto_save): Set a boolean to 1 rather than using ++. (internal_delete_file): Now returns void, not a (boolean) int, since nobody was looking at the return value. * lisp.h, window.h: Adjust to above API changes.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog25
-rw-r--r--src/fileio.c199
-rw-r--r--src/filelock.c24
-rw-r--r--src/floatfns.c4
-rw-r--r--src/fns.c70
-rw-r--r--src/lisp.h10
-rw-r--r--src/window.c8
-rw-r--r--src/window.h2
8 files changed, 178 insertions, 164 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5ff49aadd87..cb4f1071c70 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,30 @@
12012-09-05 Paul Eggert <eggert@cs.ucla.edu> 12012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
4 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
5 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6 (file_name_absolute_p, Fsubstitute_in_file_name):
7 (check_executable, check_writable, Ffile_accessible_directory_p)
8 (Fset_file_selinux_context, Fdefault_file_modes)
9 (Finsert_file_contents, choose_write_coding_system)
10 (Fwrite_region, build_annotations, a_write, e_write)
11 (Fdo_auto_save):
12 * filelock.c (boot_time_initialized, get_boot_time)
13 (get_boot_time_1, lock_file_1, within_one_second):
14 * floatfns.c (in_float):
15 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
16 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
17 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
18 * lisp.h (struct Lisp_Hash_Table.cmpfn):
19 * window.c (compare_window_configurations):
20 Use bool for booleans.
21 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
22 (Fdefault_file_modes): Now mode_t, not int, for modes.
23 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
24 (internal_delete_file): Now returns void, not a (boolean) int,
25 since nobody was looking at the return value.
26 * lisp.h, window.h: Adjust to above API changes.
27
3 * xdisp.c (set_message): Simplify and reindent last change. 28 * xdisp.c (set_message): Simplify and reindent last change.
4 29
52012-09-05 Juanma Barranquero <lekktu@gmail.com> 302012-09-05 Juanma Barranquero <lekktu@gmail.com>
diff --git a/src/fileio.c b/src/fileio.c
index d193d2ed19f..f0b3f0cc2fd 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -85,18 +85,18 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
85 85
86#include "commands.h" 86#include "commands.h"
87 87
88/* Nonzero during writing of auto-save files. */ 88/* True during writing of auto-save files. */
89static int auto_saving; 89static bool auto_saving;
90 90
91/* Nonzero umask during creation of auto-save directories. */ 91/* Nonzero umask during creation of auto-save directories. */
92static int auto_saving_dir_umask; 92static mode_t auto_saving_dir_umask;
93 93
94/* Set by auto_save_1 to mode of original file so Fwrite_region will create 94/* Set by auto_save_1 to mode of original file so Fwrite_region will create
95 a new file with the same mode as the original. */ 95 a new file with the same mode as the original. */
96static int auto_save_mode_bits; 96static mode_t auto_save_mode_bits;
97 97
98/* Set by auto_save_1 if an error occurred during the last auto-save. */ 98/* Set by auto_save_1 if an error occurred during the last auto-save. */
99static int auto_save_error_occurred; 99static bool auto_save_error_occurred;
100 100
101/* The symbol bound to coding-system-for-read when 101/* The symbol bound to coding-system-for-read when
102 insert-file-contents is called for recovering a file. This is not 102 insert-file-contents is called for recovering a file. This is not
@@ -145,10 +145,10 @@ Lisp_Object Qfile_name_history;
145 145
146static Lisp_Object Qcar_less_than_car; 146static Lisp_Object Qcar_less_than_car;
147 147
148static int a_write (int, Lisp_Object, ptrdiff_t, ptrdiff_t, 148static bool a_write (int, Lisp_Object, ptrdiff_t, ptrdiff_t,
149 Lisp_Object *, struct coding_system *); 149 Lisp_Object *, struct coding_system *);
150static int e_write (int, Lisp_Object, ptrdiff_t, ptrdiff_t, 150static bool e_write (int, Lisp_Object, ptrdiff_t, ptrdiff_t,
151 struct coding_system *); 151 struct coding_system *);
152 152
153 153
154void 154void
@@ -595,7 +595,7 @@ static unsigned make_temp_name_count, make_temp_name_count_initialized_p;
595 which has no existing file. To make this work, PREFIX should be 595 which has no existing file. To make this work, PREFIX should be
596 an absolute file name. 596 an absolute file name.
597 597
598 BASE64_P non-zero means add the pid as 3 characters in base64 598 BASE64_P means add the pid as 3 characters in base64
599 encoding. In this case, 6 characters will be added to PREFIX to 599 encoding. In this case, 6 characters will be added to PREFIX to
600 form the file name. Otherwise, if Emacs is running on a system 600 form the file name. Otherwise, if Emacs is running on a system
601 with long file names, add the pid as a decimal number. 601 with long file names, add the pid as a decimal number.
@@ -604,7 +604,7 @@ static unsigned make_temp_name_count, make_temp_name_count_initialized_p;
604 generated. */ 604 generated. */
605 605
606Lisp_Object 606Lisp_Object
607make_temp_name (Lisp_Object prefix, int base64_p) 607make_temp_name (Lisp_Object prefix, bool base64_p)
608{ 608{
609 Lisp_Object val; 609 Lisp_Object val;
610 int len, clen; 610 int len, clen;
@@ -761,8 +761,8 @@ filesystem tree, not (expand-file-name ".." dirname). */)
761 struct passwd *pw; 761 struct passwd *pw;
762#ifdef DOS_NT 762#ifdef DOS_NT
763 int drive = 0; 763 int drive = 0;
764 int collapse_newdir = 1; 764 bool collapse_newdir = 1;
765 int is_escaped = 0; 765 bool is_escaped = 0;
766#endif /* DOS_NT */ 766#endif /* DOS_NT */
767 ptrdiff_t length; 767 ptrdiff_t length;
768 Lisp_Object handler, result, handled_name; 768 Lisp_Object handler, result, handled_name;
@@ -920,10 +920,9 @@ filesystem tree, not (expand-file-name ".." dirname). */)
920 /* If it turns out that the filename we want to return is just a 920 /* If it turns out that the filename we want to return is just a
921 suffix of FILENAME, we don't need to go through and edit 921 suffix of FILENAME, we don't need to go through and edit
922 things; we just need to construct a new string using data 922 things; we just need to construct a new string using data
923 starting at the middle of FILENAME. If we set lose to a 923 starting at the middle of FILENAME. If we set LOSE, that
924 non-zero value, that means we've discovered that we can't do 924 means we've discovered that we can't do that cool trick. */
925 that cool trick. */ 925 bool lose = 0;
926 int lose = 0;
927 char *p = nm; 926 char *p = nm;
928 927
929 while (*p) 928 while (*p)
@@ -1360,7 +1359,6 @@ See also the function `substitute-in-file-name'.")
1360 ptrdiff_t tlen; 1359 ptrdiff_t tlen;
1361 unsigned char *target; 1360 unsigned char *target;
1362 struct passwd *pw; 1361 struct passwd *pw;
1363 int lose;
1364 1362
1365 CHECK_STRING (name); 1363 CHECK_STRING (name);
1366 nm = SDATA (name); 1364 nm = SDATA (name);
@@ -1369,8 +1367,8 @@ See also the function `substitute-in-file-name'.")
1369 If no /./ or /../ we can return right away. */ 1367 If no /./ or /../ we can return right away. */
1370 if (nm[0] == '/') 1368 if (nm[0] == '/')
1371 { 1369 {
1370 bool lose = 0;
1372 p = nm; 1371 p = nm;
1373 lose = 0;
1374 while (*p) 1372 while (*p)
1375 { 1373 {
1376 if (p[0] == '/' && p[1] == '/' 1374 if (p[0] == '/' && p[1] == '/'
@@ -1494,7 +1492,7 @@ See also the function `substitute-in-file-name'.")
1494#endif 1492#endif
1495 1493
1496/* If /~ or // appears, discard everything through first slash. */ 1494/* If /~ or // appears, discard everything through first slash. */
1497static int 1495static bool
1498file_name_absolute_p (const char *filename) 1496file_name_absolute_p (const char *filename)
1499{ 1497{
1500 return 1498 return
@@ -1560,12 +1558,10 @@ If `//' appears, everything up to and including the first of
1560those `/' is discarded. */) 1558those `/' is discarded. */)
1561 (Lisp_Object filename) 1559 (Lisp_Object filename)
1562{ 1560{
1563 char *nm; 1561 char *nm, *s, *p, *o, *x, *endp;
1564
1565 register char *s, *p, *o, *x, *endp;
1566 char *target = NULL; 1562 char *target = NULL;
1567 int total = 0; 1563 int total = 0;
1568 int substituted = 0; 1564 bool substituted = 0;
1569 bool multibyte; 1565 bool multibyte;
1570 char *xnm; 1566 char *xnm;
1571 Lisp_Object handler; 1567 Lisp_Object handler;
@@ -1780,7 +1776,7 @@ expand_and_dir_to_file (Lisp_Object filename, Lisp_Object defdir)
1780} 1776}
1781 1777
1782/* Signal an error if the file ABSNAME already exists. 1778/* Signal an error if the file ABSNAME already exists.
1783 If INTERACTIVE is nonzero, ask the user whether to proceed, 1779 If INTERACTIVE, ask the user whether to proceed,
1784 and bypass the error if the user says to go ahead. 1780 and bypass the error if the user says to go ahead.
1785 QUERYSTRING is a name for the action that is being considered 1781 QUERYSTRING is a name for the action that is being considered
1786 to alter the file. 1782 to alter the file.
@@ -1789,13 +1785,14 @@ expand_and_dir_to_file (Lisp_Object filename, Lisp_Object defdir)
1789 If the file does not exist, STATPTR->st_mode is set to 0. 1785 If the file does not exist, STATPTR->st_mode is set to 0.
1790 If STATPTR is null, we don't store into it. 1786 If STATPTR is null, we don't store into it.
1791 1787
1792 If QUICK is nonzero, we ask for y or n, not yes or no. */ 1788 If QUICK, ask for y or n, not yes or no. */
1793 1789
1794static void 1790static void
1795barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring, 1791barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring,
1796 int interactive, struct stat *statptr, int quick) 1792 bool interactive, struct stat *statptr,
1793 bool quick)
1797{ 1794{
1798 register Lisp_Object tem, encoded_filename; 1795 Lisp_Object tem, encoded_filename;
1799 struct stat statbuf; 1796 struct stat statbuf;
1800 struct gcpro gcpro1; 1797 struct gcpro gcpro1;
1801 1798
@@ -1869,11 +1866,11 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
1869 Lisp_Object handler; 1866 Lisp_Object handler;
1870 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 1867 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
1871 ptrdiff_t count = SPECPDL_INDEX (); 1868 ptrdiff_t count = SPECPDL_INDEX ();
1872 int input_file_statable_p; 1869 bool input_file_statable_p;
1873 Lisp_Object encoded_file, encoded_newname; 1870 Lisp_Object encoded_file, encoded_newname;
1874#if HAVE_LIBSELINUX 1871#if HAVE_LIBSELINUX
1875 security_context_t con; 1872 security_context_t con;
1876 int fail, conlength = 0; 1873 int conlength = 0;
1877#endif 1874#endif
1878 1875
1879 encoded_file = encoded_newname = Qnil; 1876 encoded_file = encoded_newname = Qnil;
@@ -1988,7 +1985,7 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
1988 S_IREAD | S_IWRITE); 1985 S_IREAD | S_IWRITE);
1989#else /* not MSDOS */ 1986#else /* not MSDOS */
1990 { 1987 {
1991 int new_mask = 0666; 1988 mode_t new_mask = 0666;
1992 if (input_file_statable_p) 1989 if (input_file_statable_p)
1993 { 1990 {
1994 if (!NILP (preserve_uid_gid)) 1991 if (!NILP (preserve_uid_gid))
@@ -2018,7 +2015,7 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
2018 owner and group. */ 2015 owner and group. */
2019 if (input_file_statable_p) 2016 if (input_file_statable_p)
2020 { 2017 {
2021 int mode_mask = 07777; 2018 mode_t mode_mask = 07777;
2022 if (!NILP (preserve_uid_gid)) 2019 if (!NILP (preserve_uid_gid))
2023 { 2020 {
2024 /* Attempt to change owner and group. If that doesn't work 2021 /* Attempt to change owner and group. If that doesn't work
@@ -2041,7 +2038,7 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
2041 if (conlength > 0) 2038 if (conlength > 0)
2042 { 2039 {
2043 /* Set the modified context back to the file. */ 2040 /* Set the modified context back to the file. */
2044 fail = fsetfilecon (ofd, con); 2041 bool fail = fsetfilecon (ofd, con) != 0;
2045 /* See http://debbugs.gnu.org/11245 for ENOTSUP. */ 2042 /* See http://debbugs.gnu.org/11245 for ENOTSUP. */
2046 if (fail && errno != ENOTSUP) 2043 if (fail && errno != ENOTSUP)
2047 report_file_error ("Doing fsetfilecon", Fcons (newname, Qnil)); 2044 report_file_error ("Doing fsetfilecon", Fcons (newname, Qnil));
@@ -2184,17 +2181,14 @@ internal_delete_file_1 (Lisp_Object ignore)
2184 return Qt; 2181 return Qt;
2185} 2182}
2186 2183
2187/* Delete file FILENAME, returning 1 if successful and 0 if failed. 2184/* Delete file FILENAME.
2188 This ignores `delete-by-moving-to-trash'. */ 2185 This ignores `delete-by-moving-to-trash'. */
2189 2186
2190int 2187void
2191internal_delete_file (Lisp_Object filename) 2188internal_delete_file (Lisp_Object filename)
2192{ 2189{
2193 Lisp_Object tem; 2190 internal_condition_case_2 (Fdelete_file, filename, Qnil,
2194 2191 Qt, internal_delete_file_1);
2195 tem = internal_condition_case_2 (Fdelete_file, filename, Qnil,
2196 Qt, internal_delete_file_1);
2197 return NILP (tem);
2198} 2192}
2199 2193
2200DEFUN ("rename-file", Frename_file, Srename_file, 2, 3, 2194DEFUN ("rename-file", Frename_file, Srename_file, 2, 3,
@@ -2430,9 +2424,9 @@ On Unix, this is a name starting with a `/' or a `~'. */)
2430 return file_name_absolute_p (SSDATA (filename)) ? Qt : Qnil; 2424 return file_name_absolute_p (SSDATA (filename)) ? Qt : Qnil;
2431} 2425}
2432 2426
2433/* Return nonzero if file FILENAME exists and can be executed. */ 2427/* Return true if file FILENAME exists and can be executed. */
2434 2428
2435static int 2429static bool
2436check_executable (char *filename) 2430check_executable (char *filename)
2437{ 2431{
2438#ifdef DOS_NT 2432#ifdef DOS_NT
@@ -2452,9 +2446,9 @@ check_executable (char *filename)
2452#endif /* not DOS_NT */ 2446#endif /* not DOS_NT */
2453} 2447}
2454 2448
2455/* Return nonzero if file FILENAME exists and can be written. */ 2449/* Return true if file FILENAME exists and can be written. */
2456 2450
2457static int 2451static bool
2458check_writable (const char *filename) 2452check_writable (const char *filename)
2459{ 2453{
2460#ifdef MSDOS 2454#ifdef MSDOS
@@ -2464,7 +2458,7 @@ check_writable (const char *filename)
2464 return (st.st_mode & S_IWRITE || S_ISDIR (st.st_mode)); 2458 return (st.st_mode & S_IWRITE || S_ISDIR (st.st_mode));
2465#else /* not MSDOS */ 2459#else /* not MSDOS */
2466#ifdef HAVE_EUIDACCESS 2460#ifdef HAVE_EUIDACCESS
2467 int res = (euidaccess (filename, 2) >= 0); 2461 bool res = (euidaccess (filename, 2) >= 0);
2468#ifdef CYGWIN 2462#ifdef CYGWIN
2469 /* euidaccess may have returned failure because Cygwin couldn't 2463 /* euidaccess may have returned failure because Cygwin couldn't
2470 determine the file's UID or GID; if so, we return success. */ 2464 determine the file's UID or GID; if so, we return success. */
@@ -2732,7 +2726,7 @@ searchable directory. */)
2732 (Lisp_Object filename) 2726 (Lisp_Object filename)
2733{ 2727{
2734 Lisp_Object handler; 2728 Lisp_Object handler;
2735 int tem; 2729 bool tem;
2736 struct gcpro gcpro1; 2730 struct gcpro gcpro1;
2737 2731
2738 /* If the file name has special constructs in it, 2732 /* If the file name has special constructs in it,
@@ -2868,7 +2862,8 @@ compiled with SELinux support. */)
2868 Lisp_Object type = CAR_SAFE (CDR_SAFE (CDR_SAFE (context))); 2862 Lisp_Object type = CAR_SAFE (CDR_SAFE (CDR_SAFE (context)));
2869 Lisp_Object range = CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (context)))); 2863 Lisp_Object range = CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (context))));
2870 security_context_t con; 2864 security_context_t con;
2871 int fail, conlength; 2865 bool fail;
2866 int conlength;
2872 context_t parsed_con; 2867 context_t parsed_con;
2873#endif 2868#endif
2874 2869
@@ -2912,8 +2907,9 @@ compiled with SELinux support. */)
2912 } 2907 }
2913 2908
2914 /* Set the modified context back to the file. */ 2909 /* Set the modified context back to the file. */
2915 fail = lsetfilecon (SSDATA (encoded_absname), 2910 fail = (lsetfilecon (SSDATA (encoded_absname),
2916 context_str (parsed_con)); 2911 context_str (parsed_con))
2912 != 0);
2917 /* See http://debbugs.gnu.org/11245 for ENOTSUP. */ 2913 /* See http://debbugs.gnu.org/11245 for ENOTSUP. */
2918 if (fail && errno != ENOTSUP) 2914 if (fail && errno != ENOTSUP)
2919 report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil)); 2915 report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil));
@@ -3004,7 +3000,7 @@ DEFUN ("default-file-modes", Fdefault_file_modes, Sdefault_file_modes, 0, 0, 0,
3004The value is an integer. */) 3000The value is an integer. */)
3005 (void) 3001 (void)
3006{ 3002{
3007 int realmask; 3003 mode_t realmask;
3008 Lisp_Object value; 3004 Lisp_Object value;
3009 3005
3010 BLOCK_INPUT; 3006 BLOCK_INPUT;
@@ -3246,29 +3242,29 @@ variable `last-coding-system-used' to the coding system actually used. */)
3246 struct stat st; 3242 struct stat st;
3247 int file_status; 3243 int file_status;
3248 EMACS_TIME mtime; 3244 EMACS_TIME mtime;
3249 register int fd; 3245 int fd;
3250 ptrdiff_t inserted = 0; 3246 ptrdiff_t inserted = 0;
3251 int nochange = 0; 3247 bool nochange = 0;
3252 register ptrdiff_t how_much; 3248 ptrdiff_t how_much;
3253 off_t beg_offset, end_offset; 3249 off_t beg_offset, end_offset;
3254 register int unprocessed; 3250 int unprocessed;
3255 ptrdiff_t count = SPECPDL_INDEX (); 3251 ptrdiff_t count = SPECPDL_INDEX ();
3256 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 3252 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
3257 Lisp_Object handler, val, insval, orig_filename, old_undo; 3253 Lisp_Object handler, val, insval, orig_filename, old_undo;
3258 Lisp_Object p; 3254 Lisp_Object p;
3259 ptrdiff_t total = 0; 3255 ptrdiff_t total = 0;
3260 int not_regular = 0; 3256 bool not_regular = 0;
3261 int save_errno = 0; 3257 int save_errno = 0;
3262 char read_buf[READ_BUF_SIZE]; 3258 char read_buf[READ_BUF_SIZE];
3263 struct coding_system coding; 3259 struct coding_system coding;
3264 char buffer[1 << 14]; 3260 char buffer[1 << 14];
3265 int replace_handled = 0; 3261 bool replace_handled = 0;
3266 int set_coding_system = 0; 3262 bool set_coding_system = 0;
3267 Lisp_Object coding_system; 3263 Lisp_Object coding_system;
3268 int read_quit = 0; 3264 bool read_quit = 0;
3269 Lisp_Object old_Vdeactivate_mark = Vdeactivate_mark; 3265 Lisp_Object old_Vdeactivate_mark = Vdeactivate_mark;
3270 int we_locked_file = 0; 3266 bool we_locked_file = 0;
3271 int deferred_remove_unwind_protect = 0; 3267 bool deferred_remove_unwind_protect = 0;
3272 3268
3273 if (current_buffer->base_buffer && ! NILP (visit)) 3269 if (current_buffer->base_buffer && ! NILP (visit))
3274 error ("Cannot do file visiting in an indirect buffer"); 3270 error ("Cannot do file visiting in an indirect buffer");
@@ -3569,9 +3565,9 @@ variable `last-coding-system-used' to the coding system actually used. */)
3569 ptrdiff_t same_at_end = ZV_BYTE; 3565 ptrdiff_t same_at_end = ZV_BYTE;
3570 ptrdiff_t overlap; 3566 ptrdiff_t overlap;
3571 /* There is still a possibility we will find the need to do code 3567 /* There is still a possibility we will find the need to do code
3572 conversion. If that happens, we set this variable to 1 to 3568 conversion. If that happens, set this variable to
3573 give up on handling REPLACE in the optimized way. */ 3569 give up on handling REPLACE in the optimized way. */
3574 int giveup_match_end = 0; 3570 bool giveup_match_end = 0;
3575 3571
3576 if (beg_offset != 0) 3572 if (beg_offset != 0)
3577 { 3573 {
@@ -4427,8 +4423,8 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
4427 If it is not set locally, we anyway have to convert EOL 4423 If it is not set locally, we anyway have to convert EOL
4428 format if the default value of `buffer-file-coding-system' 4424 format if the default value of `buffer-file-coding-system'
4429 tells that it is not Unix-like (LF only) format. */ 4425 tells that it is not Unix-like (LF only) format. */
4430 int using_default_coding = 0; 4426 bool using_default_coding = 0;
4431 int force_raw_text = 0; 4427 bool force_raw_text = 0;
4432 4428
4433 val = BVAR (current_buffer, buffer_file_coding_system); 4429 val = BVAR (current_buffer, buffer_file_coding_system);
4434 if (NILP (val) 4430 if (NILP (val)
@@ -4537,8 +4533,8 @@ This calls `write-region-annotate-functions' at the start, and
4537`write-region-post-annotation-function' at the end. */) 4533`write-region-post-annotation-function' at the end. */)
4538 (Lisp_Object start, Lisp_Object end, Lisp_Object filename, Lisp_Object append, Lisp_Object visit, Lisp_Object lockname, Lisp_Object mustbenew) 4534 (Lisp_Object start, Lisp_Object end, Lisp_Object filename, Lisp_Object append, Lisp_Object visit, Lisp_Object lockname, Lisp_Object mustbenew)
4539{ 4535{
4540 register int desc; 4536 int desc;
4541 int failure; 4537 bool ok;
4542 int save_errno = 0; 4538 int save_errno = 0;
4543 const char *fn; 4539 const char *fn;
4544 struct stat st; 4540 struct stat st;
@@ -4548,8 +4544,8 @@ This calls `write-region-annotate-functions' at the start, and
4548 Lisp_Object visit_file; 4544 Lisp_Object visit_file;
4549 Lisp_Object annotations; 4545 Lisp_Object annotations;
4550 Lisp_Object encoded_filename; 4546 Lisp_Object encoded_filename;
4551 int visiting = (EQ (visit, Qt) || STRINGP (visit)); 4547 bool visiting = (EQ (visit, Qt) || STRINGP (visit));
4552 int quietly = !NILP (visit); 4548 bool quietly = !NILP (visit);
4553 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 4549 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
4554 struct buffer *given_buffer; 4550 struct buffer *given_buffer;
4555 struct coding_system coding; 4551 struct coding_system coding;
@@ -4713,37 +4709,27 @@ This calls `write-region-annotate-functions' at the start, and
4713 4709
4714 UNGCPRO; 4710 UNGCPRO;
4715 4711
4716 failure = 0;
4717 immediate_quit = 1; 4712 immediate_quit = 1;
4718 4713
4719 if (STRINGP (start)) 4714 if (STRINGP (start))
4720 { 4715 ok = a_write (desc, start, 0, SCHARS (start), &annotations, &coding);
4721 failure = 0 > a_write (desc, start, 0, SCHARS (start),
4722 &annotations, &coding);
4723 save_errno = errno;
4724 }
4725 else if (XINT (start) != XINT (end)) 4716 else if (XINT (start) != XINT (end))
4726 { 4717 ok = a_write (desc, Qnil, XINT (start), XINT (end) - XINT (start),
4727 failure = 0 > a_write (desc, Qnil, 4718 &annotations, &coding);
4728 XINT (start), XINT (end) - XINT (start),
4729 &annotations, &coding);
4730 save_errno = errno;
4731 }
4732 else 4719 else
4733 { 4720 {
4734 /* If file was empty, still need to write the annotations */ 4721 /* If file was empty, still need to write the annotations. */
4735 coding.mode |= CODING_MODE_LAST_BLOCK; 4722 coding.mode |= CODING_MODE_LAST_BLOCK;
4736 failure = 0 > a_write (desc, Qnil, XINT (end), 0, &annotations, &coding); 4723 ok = a_write (desc, Qnil, XINT (end), 0, &annotations, &coding);
4737 save_errno = errno;
4738 } 4724 }
4725 save_errno = errno;
4739 4726
4740 if (CODING_REQUIRE_FLUSHING (&coding) 4727 if (ok && CODING_REQUIRE_FLUSHING (&coding)
4741 && !(coding.mode & CODING_MODE_LAST_BLOCK) 4728 && !(coding.mode & CODING_MODE_LAST_BLOCK))
4742 && ! failure)
4743 { 4729 {
4744 /* We have to flush out a data. */ 4730 /* We have to flush out a data. */
4745 coding.mode |= CODING_MODE_LAST_BLOCK; 4731 coding.mode |= CODING_MODE_LAST_BLOCK;
4746 failure = 0 > e_write (desc, Qnil, 1, 1, &coding); 4732 ok = e_write (desc, Qnil, 1, 1, &coding);
4747 save_errno = errno; 4733 save_errno = errno;
4748 } 4734 }
4749 4735
@@ -4760,13 +4746,13 @@ This calls `write-region-annotate-functions' at the start, and
4760 ignore EINVAL which happens when fsync is not supported on this 4746 ignore EINVAL which happens when fsync is not supported on this
4761 file. */ 4747 file. */
4762 if (errno != EINTR && errno != EINVAL) 4748 if (errno != EINTR && errno != EINVAL)
4763 failure = 1, save_errno = errno; 4749 ok = 0, save_errno = errno;
4764 } 4750 }
4765#endif 4751#endif
4766 4752
4767 /* NFS can report a write failure now. */ 4753 /* NFS can report a write failure now. */
4768 if (emacs_close (desc) < 0) 4754 if (emacs_close (desc) < 0)
4769 failure = 1, save_errno = errno; 4755 ok = 0, save_errno = errno;
4770 4756
4771 stat (fn, &st); 4757 stat (fn, &st);
4772 4758
@@ -4803,7 +4789,7 @@ This calls `write-region-annotate-functions' at the start, and
4803 current_buffer->modtime_size = st.st_size; 4789 current_buffer->modtime_size = st.st_size;
4804 } 4790 }
4805 4791
4806 if (failure) 4792 if (! ok)
4807 error ("IO error writing %s: %s", SDATA (filename), 4793 error ("IO error writing %s: %s", SDATA (filename),
4808 emacs_strerror (save_errno)); 4794 emacs_strerror (save_errno));
4809 4795
@@ -4859,7 +4845,8 @@ build_annotations (Lisp_Object start, Lisp_Object end)
4859 Lisp_Object p, res; 4845 Lisp_Object p, res;
4860 struct gcpro gcpro1, gcpro2; 4846 struct gcpro gcpro1, gcpro2;
4861 Lisp_Object original_buffer; 4847 Lisp_Object original_buffer;
4862 int i, used_global = 0; 4848 int i;
4849 bool used_global = 0;
4863 4850
4864 XSETBUFFER (original_buffer, current_buffer); 4851 XSETBUFFER (original_buffer, current_buffer);
4865 4852
@@ -4939,11 +4926,11 @@ build_annotations (Lisp_Object start, Lisp_Object end)
4939 4926
4940 We modify *ANNOT by discarding elements as we use them up. 4927 We modify *ANNOT by discarding elements as we use them up.
4941 4928
4942 The return value is negative in case of system call failure. */ 4929 Return true if successful. */
4943 4930
4944static int 4931static bool
4945a_write (int desc, Lisp_Object string, ptrdiff_t pos, 4932a_write (int desc, Lisp_Object string, ptrdiff_t pos,
4946 register ptrdiff_t nchars, Lisp_Object *annot, 4933 ptrdiff_t nchars, Lisp_Object *annot,
4947 struct coding_system *coding) 4934 struct coding_system *coding)
4948{ 4935{
4949 Lisp_Object tem; 4936 Lisp_Object tem;
@@ -4965,29 +4952,29 @@ a_write (int desc, Lisp_Object string, ptrdiff_t pos,
4965 /* Output buffer text up to the next annotation's position. */ 4952 /* Output buffer text up to the next annotation's position. */
4966 if (nextpos > pos) 4953 if (nextpos > pos)
4967 { 4954 {
4968 if (0 > e_write (desc, string, pos, nextpos, coding)) 4955 if (!e_write (desc, string, pos, nextpos, coding))
4969 return -1; 4956 return 0;
4970 pos = nextpos; 4957 pos = nextpos;
4971 } 4958 }
4972 /* Output the annotation. */ 4959 /* Output the annotation. */
4973 tem = Fcdr (Fcar (*annot)); 4960 tem = Fcdr (Fcar (*annot));
4974 if (STRINGP (tem)) 4961 if (STRINGP (tem))
4975 { 4962 {
4976 if (0 > e_write (desc, tem, 0, SCHARS (tem), coding)) 4963 if (!e_write (desc, tem, 0, SCHARS (tem), coding))
4977 return -1; 4964 return 0;
4978 } 4965 }
4979 *annot = Fcdr (*annot); 4966 *annot = Fcdr (*annot);
4980 } 4967 }
4981 return 0; 4968 return 1;
4982} 4969}
4983 4970
4984 4971
4985/* Write text in the range START and END into descriptor DESC, 4972/* Write text in the range START and END into descriptor DESC,
4986 encoding them with coding system CODING. If STRING is nil, START 4973 encoding them with coding system CODING. If STRING is nil, START
4987 and END are character positions of the current buffer, else they 4974 and END are character positions of the current buffer, else they
4988 are indexes to the string STRING. */ 4975 are indexes to the string STRING. Return true if successful. */
4989 4976
4990static int 4977static bool
4991e_write (int desc, Lisp_Object string, ptrdiff_t start, ptrdiff_t end, 4978e_write (int desc, Lisp_Object string, ptrdiff_t start, ptrdiff_t end,
4992 struct coding_system *coding) 4979 struct coding_system *coding)
4993{ 4980{
@@ -5056,12 +5043,12 @@ e_write (int desc, Lisp_Object string, ptrdiff_t start, ptrdiff_t end,
5056 coding->produced); 5043 coding->produced);
5057 5044
5058 if (coding->produced) 5045 if (coding->produced)
5059 return -1; 5046 return 0;
5060 } 5047 }
5061 start += coding->consumed_char; 5048 start += coding->consumed_char;
5062 } 5049 }
5063 5050
5064 return 0; 5051 return 1;
5065} 5052}
5066 5053
5067DEFUN ("verify-visited-file-modtime", Fverify_visited_file_modtime, 5054DEFUN ("verify-visited-file-modtime", Fverify_visited_file_modtime,
@@ -5300,12 +5287,12 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5300{ 5287{
5301 struct buffer *old = current_buffer, *b; 5288 struct buffer *old = current_buffer, *b;
5302 Lisp_Object tail, buf, hook; 5289 Lisp_Object tail, buf, hook;
5303 int auto_saved = 0; 5290 bool auto_saved = 0;
5304 int do_handled_files; 5291 int do_handled_files;
5305 Lisp_Object oquit; 5292 Lisp_Object oquit;
5306 FILE *stream = NULL; 5293 FILE *stream = NULL;
5307 ptrdiff_t count = SPECPDL_INDEX (); 5294 ptrdiff_t count = SPECPDL_INDEX ();
5308 int orig_minibuffer_auto_raise = minibuffer_auto_raise; 5295 bool orig_minibuffer_auto_raise = minibuffer_auto_raise;
5309 bool old_message_p = 0; 5296 bool old_message_p = 0;
5310 struct gcpro gcpro1, gcpro2; 5297 struct gcpro gcpro1, gcpro2;
5311 5298
@@ -5452,7 +5439,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5452 if (!auto_saved && NILP (no_message)) 5439 if (!auto_saved && NILP (no_message))
5453 message1 ("Auto-saving..."); 5440 message1 ("Auto-saving...");
5454 internal_condition_case (auto_save_1, Qt, auto_save_error); 5441 internal_condition_case (auto_save_1, Qt, auto_save_error);
5455 auto_saved++; 5442 auto_saved = 1;
5456 BUF_AUTOSAVE_MODIFF (b) = BUF_MODIFF (b); 5443 BUF_AUTOSAVE_MODIFF (b) = BUF_MODIFF (b);
5457 XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG); 5444 XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
5458 set_buffer_internal (old); 5445 set_buffer_internal (old);
diff --git a/src/filelock.c b/src/filelock.c
index d21d8e7ba02..1f599c68912 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -100,10 +100,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
100/* Return the time of the last system boot. */ 100/* Return the time of the last system boot. */
101 101
102static time_t boot_time; 102static time_t boot_time;
103static int boot_time_initialized; 103static bool boot_time_initialized;
104 104
105#ifdef BOOT_TIME 105#ifdef BOOT_TIME
106static void get_boot_time_1 (const char *, int); 106static void get_boot_time_1 (const char *, bool);
107#endif 107#endif
108 108
109static time_t 109static time_t
@@ -170,7 +170,7 @@ get_boot_time (void)
170 { 170 {
171 char cmd_string[sizeof WTMP_FILE ".19.gz"]; 171 char cmd_string[sizeof WTMP_FILE ".19.gz"];
172 Lisp_Object tempname, filename; 172 Lisp_Object tempname, filename;
173 int delete_flag = 0; 173 bool delete_flag = 0;
174 174
175 filename = Qnil; 175 filename = Qnil;
176 176
@@ -225,13 +225,13 @@ get_boot_time (void)
225 225
226 If FILENAME is zero, use the same file as before; 226 If FILENAME is zero, use the same file as before;
227 if no FILENAME has ever been specified, this is the utmp file. 227 if no FILENAME has ever been specified, this is the utmp file.
228 Use the newest reboot record if NEWEST is nonzero, 228 Use the newest reboot record if NEWEST,
229 the first reboot record otherwise. 229 the first reboot record otherwise.
230 Ignore all reboot records on or before BOOT_TIME. 230 Ignore all reboot records on or before BOOT_TIME.
231 Success is indicated by setting BOOT_TIME to a larger value. */ 231 Success is indicated by setting BOOT_TIME to a larger value. */
232 232
233void 233void
234get_boot_time_1 (const char *filename, int newest) 234get_boot_time_1 (const char *filename, bool newest)
235{ 235{
236 struct utmp ut, *utp; 236 struct utmp ut, *utp;
237 int desc; 237 int desc;
@@ -331,11 +331,11 @@ fill_in_lock_file_name (register char *lockfile, register Lisp_Object fn)
331} 331}
332 332
333/* Lock the lock file named LFNAME. 333/* Lock the lock file named LFNAME.
334 If FORCE is nonzero, we do so even if it is already locked. 334 If FORCE, do so even if it is already locked.
335 Return 1 if successful, 0 if not. */ 335 Return true if successful. */
336 336
337static int 337static bool
338lock_file_1 (char *lfname, int force) 338lock_file_1 (char *lfname, bool force)
339{ 339{
340 int err; 340 int err;
341 int symlink_errno; 341 int symlink_errno;
@@ -370,9 +370,9 @@ lock_file_1 (char *lfname, int force)
370 return err == 0; 370 return err == 0;
371} 371}
372 372
373/* Return 1 if times A and B are no more than one second apart. */ 373/* Return true if times A and B are no more than one second apart. */
374 374
375static int 375static bool
376within_one_second (time_t a, time_t b) 376within_one_second (time_t a, time_t b)
377{ 377{
378 return (a - b >= -1 && a - b <= 1); 378 return (a - b >= -1 && a - b <= 1);
@@ -491,7 +491,7 @@ current_lock_owner (lock_info_type *owner, char *lfname)
491static int 491static int
492lock_if_free (lock_info_type *clasher, register char *lfname) 492lock_if_free (lock_info_type *clasher, register char *lfname)
493{ 493{
494 while (lock_file_1 (lfname, 0) == 0) 494 while (! lock_file_1 (lfname, 0))
495 { 495 {
496 int locker; 496 int locker;
497 497
diff --git a/src/floatfns.c b/src/floatfns.c
index cad071f1e15..706fe7ae1a0 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -103,10 +103,10 @@ extern double logb (double);
103static void float_error (); 103static void float_error ();
104#endif 104#endif
105 105
106/* Nonzero while executing in floating point. 106/* True while executing in floating point.
107 This tells float_error what to do. */ 107 This tells float_error what to do. */
108 108
109static int in_float; 109static bool in_float;
110 110
111/* If an argument is out of range for a mathematical function, 111/* If an argument is out of range for a mathematical function,
112 here is the actual argument value to use in the error message. 112 here is the actual argument value to use in the error message.
diff --git a/src/fns.c b/src/fns.c
index fc0044106cd..20770af67d4 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -51,7 +51,7 @@ static Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper;
51 51
52static Lisp_Object Qmd5, Qsha1, Qsha224, Qsha256, Qsha384, Qsha512; 52static Lisp_Object Qmd5, Qsha1, Qsha224, Qsha256, Qsha384, Qsha512;
53 53
54static int internal_equal (Lisp_Object , Lisp_Object, int, int); 54static bool internal_equal (Lisp_Object, Lisp_Object, int, bool);
55 55
56DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0, 56DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0,
57 doc: /* Return the argument unchanged. */) 57 doc: /* Return the argument unchanged. */)
@@ -352,7 +352,7 @@ Symbols are also allowed; their print names are used instead. */)
352} 352}
353 353
354static Lisp_Object concat (ptrdiff_t nargs, Lisp_Object *args, 354static Lisp_Object concat (ptrdiff_t nargs, Lisp_Object *args,
355 enum Lisp_Type target_type, int last_special); 355 enum Lisp_Type target_type, bool last_special);
356 356
357/* ARGSUSED */ 357/* ARGSUSED */
358Lisp_Object 358Lisp_Object
@@ -450,19 +450,19 @@ struct textprop_rec
450 450
451static Lisp_Object 451static Lisp_Object
452concat (ptrdiff_t nargs, Lisp_Object *args, 452concat (ptrdiff_t nargs, Lisp_Object *args,
453 enum Lisp_Type target_type, int last_special) 453 enum Lisp_Type target_type, bool last_special)
454{ 454{
455 Lisp_Object val; 455 Lisp_Object val;
456 register Lisp_Object tail; 456 Lisp_Object tail;
457 register Lisp_Object this; 457 Lisp_Object this;
458 ptrdiff_t toindex; 458 ptrdiff_t toindex;
459 ptrdiff_t toindex_byte = 0; 459 ptrdiff_t toindex_byte = 0;
460 register EMACS_INT result_len; 460 EMACS_INT result_len;
461 register EMACS_INT result_len_byte; 461 EMACS_INT result_len_byte;
462 ptrdiff_t argnum; 462 ptrdiff_t argnum;
463 Lisp_Object last_tail; 463 Lisp_Object last_tail;
464 Lisp_Object prev; 464 Lisp_Object prev;
465 int some_multibyte; 465 bool some_multibyte;
466 /* When we make a multibyte string, we can't copy text properties 466 /* When we make a multibyte string, we can't copy text properties
467 while concatenating each string because the length of resulting 467 while concatenating each string because the length of resulting
468 string can't be decided until we finish the whole concatenation. 468 string can't be decided until we finish the whole concatenation.
@@ -1988,10 +1988,10 @@ of strings. (`equal' ignores text properties.) */)
1988 1988
1989/* DEPTH is current depth of recursion. Signal an error if it 1989/* DEPTH is current depth of recursion. Signal an error if it
1990 gets too deep. 1990 gets too deep.
1991 PROPS, if non-nil, means compare string text properties too. */ 1991 PROPS means compare string text properties too. */
1992 1992
1993static int 1993static bool
1994internal_equal (register Lisp_Object o1, register Lisp_Object o2, int depth, int props) 1994internal_equal (Lisp_Object o1, Lisp_Object o2, int depth, bool props)
1995{ 1995{
1996 if (depth > 200) 1996 if (depth > 200)
1997 error ("Stack overflow in equal"); 1997 error ("Stack overflow in equal");
@@ -2589,9 +2589,9 @@ Normally the return value is FEATURE.
2589The normal messages at start and end of loading FILENAME are suppressed. */) 2589The normal messages at start and end of loading FILENAME are suppressed. */)
2590 (Lisp_Object feature, Lisp_Object filename, Lisp_Object noerror) 2590 (Lisp_Object feature, Lisp_Object filename, Lisp_Object noerror)
2591{ 2591{
2592 register Lisp_Object tem; 2592 Lisp_Object tem;
2593 struct gcpro gcpro1, gcpro2; 2593 struct gcpro gcpro1, gcpro2;
2594 int from_file = load_in_progress; 2594 bool from_file = load_in_progress;
2595 2595
2596 CHECK_SYMBOL (feature); 2596 CHECK_SYMBOL (feature);
2597 2597
@@ -2917,8 +2917,8 @@ static const short base64_char_to_value[128] =
2917 base64 characters. */ 2917 base64 characters. */
2918 2918
2919 2919
2920static ptrdiff_t base64_encode_1 (const char *, char *, ptrdiff_t, int, int); 2920static ptrdiff_t base64_encode_1 (const char *, char *, ptrdiff_t, bool, bool);
2921static ptrdiff_t base64_decode_1 (const char *, char *, ptrdiff_t, int, 2921static ptrdiff_t base64_decode_1 (const char *, char *, ptrdiff_t, bool,
2922 ptrdiff_t *); 2922 ptrdiff_t *);
2923 2923
2924DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region, 2924DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region,
@@ -3026,7 +3026,7 @@ into shorter lines. */)
3026 3026
3027static ptrdiff_t 3027static ptrdiff_t
3028base64_encode_1 (const char *from, char *to, ptrdiff_t length, 3028base64_encode_1 (const char *from, char *to, ptrdiff_t length,
3029 int line_break, int multibyte) 3029 bool line_break, bool multibyte)
3030{ 3030{
3031 int counter = 0; 3031 int counter = 0;
3032 ptrdiff_t i = 0; 3032 ptrdiff_t i = 0;
@@ -3133,7 +3133,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
3133 ptrdiff_t old_pos = PT; 3133 ptrdiff_t old_pos = PT;
3134 ptrdiff_t decoded_length; 3134 ptrdiff_t decoded_length;
3135 ptrdiff_t inserted_chars; 3135 ptrdiff_t inserted_chars;
3136 int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); 3136 bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
3137 USE_SAFE_ALLOCA; 3137 USE_SAFE_ALLOCA;
3138 3138
3139 validate_region (&beg, &end); 3139 validate_region (&beg, &end);
@@ -3218,13 +3218,13 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string,
3218} 3218}
3219 3219
3220/* Base64-decode the data at FROM of LENGTH bytes into TO. If 3220/* Base64-decode the data at FROM of LENGTH bytes into TO. If
3221 MULTIBYTE is nonzero, the decoded result should be in multibyte 3221 MULTIBYTE, the decoded result should be in multibyte
3222 form. If NCHARS_RETURN is not NULL, store the number of produced 3222 form. If NCHARS_RETURN is not NULL, store the number of produced
3223 characters in *NCHARS_RETURN. */ 3223 characters in *NCHARS_RETURN. */
3224 3224
3225static ptrdiff_t 3225static ptrdiff_t
3226base64_decode_1 (const char *from, char *to, ptrdiff_t length, 3226base64_decode_1 (const char *from, char *to, ptrdiff_t length,
3227 int multibyte, ptrdiff_t *nchars_return) 3227 bool multibyte, ptrdiff_t *nchars_return)
3228{ 3228{
3229 ptrdiff_t i = 0; /* Used inside READ_QUADRUPLET_BYTE */ 3229 ptrdiff_t i = 0; /* Used inside READ_QUADRUPLET_BYTE */
3230 char *e = to; 3230 char *e = to;
@@ -3340,7 +3340,7 @@ static Lisp_Object Qhash_table_test, Qkey_or_value, Qkey_and_value;
3340static struct Lisp_Hash_Table *check_hash_table (Lisp_Object); 3340static struct Lisp_Hash_Table *check_hash_table (Lisp_Object);
3341static ptrdiff_t get_key_arg (Lisp_Object, ptrdiff_t, Lisp_Object *, char *); 3341static ptrdiff_t get_key_arg (Lisp_Object, ptrdiff_t, Lisp_Object *, char *);
3342static void maybe_resize_hash_table (struct Lisp_Hash_Table *); 3342static void maybe_resize_hash_table (struct Lisp_Hash_Table *);
3343static int sweep_weak_table (struct Lisp_Hash_Table *, int); 3343static bool sweep_weak_table (struct Lisp_Hash_Table *, bool);
3344 3344
3345 3345
3346 3346
@@ -3432,10 +3432,10 @@ larger_vector (Lisp_Object vec, ptrdiff_t incr_min, ptrdiff_t nitems_max)
3432 ***********************************************************************/ 3432 ***********************************************************************/
3433 3433
3434/* Compare KEY1 which has hash code HASH1 and KEY2 with hash code 3434/* Compare KEY1 which has hash code HASH1 and KEY2 with hash code
3435 HASH2 in hash table H using `eql'. Value is non-zero if KEY1 and 3435 HASH2 in hash table H using `eql'. Value is true if KEY1 and
3436 KEY2 are the same. */ 3436 KEY2 are the same. */
3437 3437
3438static int 3438static bool
3439cmpfn_eql (struct Lisp_Hash_Table *h, 3439cmpfn_eql (struct Lisp_Hash_Table *h,
3440 Lisp_Object key1, EMACS_UINT hash1, 3440 Lisp_Object key1, EMACS_UINT hash1,
3441 Lisp_Object key2, EMACS_UINT hash2) 3441 Lisp_Object key2, EMACS_UINT hash2)
@@ -3447,10 +3447,10 @@ cmpfn_eql (struct Lisp_Hash_Table *h,
3447 3447
3448 3448
3449/* Compare KEY1 which has hash code HASH1 and KEY2 with hash code 3449/* Compare KEY1 which has hash code HASH1 and KEY2 with hash code
3450 HASH2 in hash table H using `equal'. Value is non-zero if KEY1 and 3450 HASH2 in hash table H using `equal'. Value is true if KEY1 and
3451 KEY2 are the same. */ 3451 KEY2 are the same. */
3452 3452
3453static int 3453static bool
3454cmpfn_equal (struct Lisp_Hash_Table *h, 3454cmpfn_equal (struct Lisp_Hash_Table *h,
3455 Lisp_Object key1, EMACS_UINT hash1, 3455 Lisp_Object key1, EMACS_UINT hash1,
3456 Lisp_Object key2, EMACS_UINT hash2) 3456 Lisp_Object key2, EMACS_UINT hash2)
@@ -3460,10 +3460,10 @@ cmpfn_equal (struct Lisp_Hash_Table *h,
3460 3460
3461 3461
3462/* Compare KEY1 which has hash code HASH1, and KEY2 with hash code 3462/* Compare KEY1 which has hash code HASH1, and KEY2 with hash code
3463 HASH2 in hash table H using H->user_cmp_function. Value is non-zero 3463 HASH2 in hash table H using H->user_cmp_function. Value is true
3464 if KEY1 and KEY2 are the same. */ 3464 if KEY1 and KEY2 are the same. */
3465 3465
3466static int 3466static bool
3467cmpfn_user_defined (struct Lisp_Hash_Table *h, 3467cmpfn_user_defined (struct Lisp_Hash_Table *h,
3468 Lisp_Object key1, EMACS_UINT hash1, 3468 Lisp_Object key1, EMACS_UINT hash1,
3469 Lisp_Object key2, EMACS_UINT hash2) 3469 Lisp_Object key2, EMACS_UINT hash2)
@@ -3923,16 +3923,16 @@ hash_clear (struct Lisp_Hash_Table *h)
3923 Weak Hash Tables 3923 Weak Hash Tables
3924 ************************************************************************/ 3924 ************************************************************************/
3925 3925
3926/* Sweep weak hash table H. REMOVE_ENTRIES_P non-zero means remove 3926/* Sweep weak hash table H. REMOVE_ENTRIES_P means remove
3927 entries from the table that don't survive the current GC. 3927 entries from the table that don't survive the current GC.
3928 REMOVE_ENTRIES_P zero means mark entries that are in use. Value is 3928 !REMOVE_ENTRIES_P means mark entries that are in use. Value is
3929 non-zero if anything was marked. */ 3929 true if anything was marked. */
3930 3930
3931static int 3931static bool
3932sweep_weak_table (struct Lisp_Hash_Table *h, int remove_entries_p) 3932sweep_weak_table (struct Lisp_Hash_Table *h, bool remove_entries_p)
3933{ 3933{
3934 ptrdiff_t bucket, n; 3934 ptrdiff_t bucket, n;
3935 int marked; 3935 bool marked;
3936 3936
3937 n = ASIZE (h->index) & ~ARRAY_MARK_FLAG; 3937 n = ASIZE (h->index) & ~ARRAY_MARK_FLAG;
3938 marked = 0; 3938 marked = 0;
@@ -3949,7 +3949,7 @@ sweep_weak_table (struct Lisp_Hash_Table *h, int remove_entries_p)
3949 ptrdiff_t i = XFASTINT (idx); 3949 ptrdiff_t i = XFASTINT (idx);
3950 bool key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i)); 3950 bool key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i));
3951 bool value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i)); 3951 bool value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i));
3952 int remove_p; 3952 bool remove_p;
3953 3953
3954 if (EQ (h->weak, Qkey)) 3954 if (EQ (h->weak, Qkey))
3955 remove_p = !key_known_to_survive_p; 3955 remove_p = !key_known_to_survive_p;
@@ -4022,7 +4022,7 @@ void
4022sweep_weak_hash_tables (void) 4022sweep_weak_hash_tables (void)
4023{ 4023{
4024 struct Lisp_Hash_Table *h, *used, *next; 4024 struct Lisp_Hash_Table *h, *used, *next;
4025 int marked; 4025 bool marked;
4026 4026
4027 /* Mark all keys and values that are in use. Keep on marking until 4027 /* Mark all keys and values that are in use. Keep on marking until
4028 there is no more change. This is necessary for cases like 4028 there is no more change. This is necessary for cases like
@@ -4674,7 +4674,7 @@ secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_
4674 coding_system = Vcoding_system_for_write; 4674 coding_system = Vcoding_system_for_write;
4675 else 4675 else
4676 { 4676 {
4677 int force_raw_text = 0; 4677 bool force_raw_text = 0;
4678 4678
4679 coding_system = BVAR (XBUFFER (object), buffer_file_coding_system); 4679 coding_system = BVAR (XBUFFER (object), buffer_file_coding_system);
4680 if (NILP (coding_system) 4680 if (NILP (coding_system)
diff --git a/src/lisp.h b/src/lisp.h
index 78c418f3051..a8ed4b6cabc 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1205,9 +1205,9 @@ struct Lisp_Hash_Table
1205 struct Lisp_Hash_Table *next_weak; 1205 struct Lisp_Hash_Table *next_weak;
1206 1206
1207 /* C function to compare two keys. */ 1207 /* C function to compare two keys. */
1208 int (*cmpfn) (struct Lisp_Hash_Table *, 1208 bool (*cmpfn) (struct Lisp_Hash_Table *,
1209 Lisp_Object, EMACS_UINT, 1209 Lisp_Object, EMACS_UINT,
1210 Lisp_Object, EMACS_UINT); 1210 Lisp_Object, EMACS_UINT);
1211 1211
1212 /* C function to compute hash code. */ 1212 /* C function to compute hash code. */
1213 EMACS_UINT (*hashfn) (struct Lisp_Hash_Table *, Lisp_Object); 1213 EMACS_UINT (*hashfn) (struct Lisp_Hash_Table *, Lisp_Object);
@@ -3151,9 +3151,9 @@ EXFUN (Fread_file_name, 6); /* not a normal DEFUN */
3151extern Lisp_Object close_file_unwind (Lisp_Object); 3151extern Lisp_Object close_file_unwind (Lisp_Object);
3152extern Lisp_Object restore_point_unwind (Lisp_Object); 3152extern Lisp_Object restore_point_unwind (Lisp_Object);
3153extern _Noreturn void report_file_error (const char *, Lisp_Object); 3153extern _Noreturn void report_file_error (const char *, Lisp_Object);
3154extern int internal_delete_file (Lisp_Object); 3154extern void internal_delete_file (Lisp_Object);
3155extern void syms_of_fileio (void); 3155extern void syms_of_fileio (void);
3156extern Lisp_Object make_temp_name (Lisp_Object, int); 3156extern Lisp_Object make_temp_name (Lisp_Object, bool);
3157extern Lisp_Object Qdelete_file; 3157extern Lisp_Object Qdelete_file;
3158 3158
3159/* Defined in search.c */ 3159/* Defined in search.c */
diff --git a/src/window.c b/src/window.c
index 08608e0d451..1869a3b65cf 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6576,15 +6576,17 @@ freeze_window_starts (struct frame *f, int freeze_p)
6576/* Return 1 if window configurations CONFIGURATION1 and CONFIGURATION2 6576/* Return 1 if window configurations CONFIGURATION1 and CONFIGURATION2
6577 describe the same state of affairs. This is used by Fequal. 6577 describe the same state of affairs. This is used by Fequal.
6578 6578
6579 ignore_positions non-zero means ignore non-matching scroll positions 6579 IGNORE_POSITIONS means ignore non-matching scroll positions
6580 and the like. 6580 and the like.
6581 6581
6582 This ignores a couple of things like the dedication status of 6582 This ignores a couple of things like the dedication status of
6583 window, combination_limit and the like. This might have to be 6583 window, combination_limit and the like. This might have to be
6584 fixed. */ 6584 fixed. */
6585 6585
6586int 6586bool
6587compare_window_configurations (Lisp_Object configuration1, Lisp_Object configuration2, int ignore_positions) 6587compare_window_configurations (Lisp_Object configuration1,
6588 Lisp_Object configuration2,
6589 bool ignore_positions)
6588{ 6590{
6589 register struct save_window_data *d1, *d2; 6591 register struct save_window_data *d1, *d2;
6590 struct Lisp_Vector *sws1, *sws2; 6592 struct Lisp_Vector *sws1, *sws2;
diff --git a/src/window.h b/src/window.h
index dfb88b2cf3c..f0a3a15f442 100644
--- a/src/window.h
+++ b/src/window.h
@@ -973,7 +973,7 @@ extern Lisp_Object Qwindowp, Qwindow_live_p;
973extern Lisp_Object Vwindow_list; 973extern Lisp_Object Vwindow_list;
974 974
975extern struct window *decode_live_window (Lisp_Object); 975extern struct window *decode_live_window (Lisp_Object);
976extern int compare_window_configurations (Lisp_Object, Lisp_Object, int); 976extern bool compare_window_configurations (Lisp_Object, Lisp_Object, bool);
977extern void mark_window_cursors_off (struct window *); 977extern void mark_window_cursors_off (struct window *);
978extern int window_internal_height (struct window *); 978extern int window_internal_height (struct window *);
979extern int window_body_cols (struct window *w); 979extern int window_body_cols (struct window *w);