aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog27
-rw-r--r--src/alloc.c80
-rw-r--r--src/editfns.c10
-rw-r--r--src/fileio.c6
-rw-r--r--src/fns.c4
-rw-r--r--src/lisp.h16
-rw-r--r--src/lread.c8
-rw-r--r--src/print.c6
-rw-r--r--src/xdisp.c5
9 files changed, 95 insertions, 67 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3e7b64becb1..27e430d7d0d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,32 @@
12012-08-21 Paul Eggert <eggert@cs.ucla.edu> 12012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * alloc.c: Use bool for booleans.
4 (gc_in_progress, abort_on_gc)
5 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6 (dont_register_blocks) [GC_MALLOC_CHECK]:
7 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8 (check_string_bytes, make_specified_string, memory_full)
9 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
10 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
11 (mark_stack, valid_pointer_p, make_pure_string)
12 (Fgarbage_collect, survives_gc_p, gc_sweep):
13 Use bool for booleans, instead of int.
14 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
15 Remove unused local.
16 * alloc.c (PURE_POINTER_P):
17 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
18 * editfns.c (Fformat):
19 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
20 (Fdo_auto_save):
21 * fns.c (sweep_weak_table):
22 * lisp.h (suppress_checking, push_message, survives_gc_p)
23 (make_pure_string, gc_in_progress, abort_on_gc):
24 * lread.c (readchar, read1):
25 * print.c (Fprin1_to_string):
26 * xdisp.c (push_message):
27 Use bool for booleans affected directly or indirectly by
28 alloc.c's changes.
29
3 Make recently-introduced setters macros. 30 Make recently-introduced setters macros.
4 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii) 31 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
5 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face) 32 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
diff --git a/src/alloc.c b/src/alloc.c
index 522f33f5379..f0da9416ece 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -173,15 +173,15 @@ EMACS_INT gc_relative_threshold;
173 173
174EMACS_INT memory_full_cons_threshold; 174EMACS_INT memory_full_cons_threshold;
175 175
176/* Nonzero during GC. */ 176/* True during GC. */
177 177
178int gc_in_progress; 178bool gc_in_progress;
179 179
180/* Nonzero means abort if try to GC. 180/* True means abort if try to GC.
181 This is for code which is written on the assumption that 181 This is for code which is written on the assumption that
182 no GC will happen, so as to verify that assumption. */ 182 no GC will happen, so as to verify that assumption. */
183 183
184int abort_on_gc; 184bool abort_on_gc;
185 185
186/* Number of live and free conses etc. */ 186/* Number of live and free conses etc. */
187 187
@@ -223,7 +223,7 @@ static ptrdiff_t pure_size;
223 223
224static ptrdiff_t pure_bytes_used_before_overflow; 224static ptrdiff_t pure_bytes_used_before_overflow;
225 225
226/* Value is non-zero if P points into pure space. */ 226/* True if P points into pure space. */
227 227
228#define PURE_POINTER_P(P) \ 228#define PURE_POINTER_P(P) \
229 ((uintptr_t) (P) - (uintptr_t) purebeg <= pure_size) 229 ((uintptr_t) (P) - (uintptr_t) purebeg <= pure_size)
@@ -392,13 +392,13 @@ static struct mem_node mem_z;
392static struct Lisp_Vector *allocate_vectorlike (ptrdiff_t); 392static struct Lisp_Vector *allocate_vectorlike (ptrdiff_t);
393static void lisp_free (void *); 393static void lisp_free (void *);
394static void mark_stack (void); 394static void mark_stack (void);
395static int live_vector_p (struct mem_node *, void *); 395static bool live_vector_p (struct mem_node *, void *);
396static int live_buffer_p (struct mem_node *, void *); 396static bool live_buffer_p (struct mem_node *, void *);
397static int live_string_p (struct mem_node *, void *); 397static bool live_string_p (struct mem_node *, void *);
398static int live_cons_p (struct mem_node *, void *); 398static bool live_cons_p (struct mem_node *, void *);
399static int live_symbol_p (struct mem_node *, void *); 399static bool live_symbol_p (struct mem_node *, void *);
400static int live_float_p (struct mem_node *, void *); 400static bool live_float_p (struct mem_node *, void *);
401static int live_misc_p (struct mem_node *, void *); 401static bool live_misc_p (struct mem_node *, void *);
402static void mark_maybe_object (Lisp_Object); 402static void mark_maybe_object (Lisp_Object);
403static void mark_memory (void *, void *); 403static void mark_memory (void *, void *);
404#if GC_MARK_STACK || defined GC_MALLOC_CHECK 404#if GC_MARK_STACK || defined GC_MALLOC_CHECK
@@ -1241,7 +1241,7 @@ static void (*old_free_hook) (void*, const void*);
1241#endif 1241#endif
1242 1242
1243#ifdef GC_MALLOC_CHECK 1243#ifdef GC_MALLOC_CHECK
1244static int dont_register_blocks; 1244static bool dont_register_blocks;
1245#endif 1245#endif
1246 1246
1247static size_t bytes_used_when_reconsidered; 1247static size_t bytes_used_when_reconsidered;
@@ -1828,11 +1828,11 @@ check_sblock (struct sblock *b)
1828 1828
1829 1829
1830/* Check validity of Lisp strings' string_bytes member. ALL_P 1830/* Check validity of Lisp strings' string_bytes member. ALL_P
1831 non-zero means check all strings, otherwise check only most 1831 means check all strings, otherwise check only most
1832 recently allocated strings. Used for hunting a bug. */ 1832 recently allocated strings. Used for hunting a bug. */
1833 1833
1834static void 1834static void
1835check_string_bytes (int all_p) 1835check_string_bytes (bool all_p)
1836{ 1836{
1837 if (all_p) 1837 if (all_p)
1838 { 1838 {
@@ -2437,9 +2437,9 @@ make_string_from_bytes (const char *contents,
2437 2437
2438Lisp_Object 2438Lisp_Object
2439make_specified_string (const char *contents, 2439make_specified_string (const char *contents,
2440 ptrdiff_t nchars, ptrdiff_t nbytes, int multibyte) 2440 ptrdiff_t nchars, ptrdiff_t nbytes, bool multibyte)
2441{ 2441{
2442 register Lisp_Object val; 2442 Lisp_Object val;
2443 2443
2444 if (nchars < 0) 2444 if (nchars < 0)
2445 { 2445 {
@@ -3094,7 +3094,7 @@ sweep_vectors (void)
3094 3094
3095 for (block = vector_blocks; block; block = *bprev) 3095 for (block = vector_blocks; block; block = *bprev)
3096 { 3096 {
3097 int free_this_block = 0; 3097 bool free_this_block = 0;
3098 3098
3099 for (vector = (struct Lisp_Vector *) block->data; 3099 for (vector = (struct Lisp_Vector *) block->data;
3100 VECTOR_IN_BLOCK (vector, block); vector = next) 3100 VECTOR_IN_BLOCK (vector, block); vector = next)
@@ -3753,7 +3753,7 @@ void
3753memory_full (size_t nbytes) 3753memory_full (size_t nbytes)
3754{ 3754{
3755 /* Do not go into hysterics merely because a large request failed. */ 3755 /* Do not go into hysterics merely because a large request failed. */
3756 int enough_free_memory = 0; 3756 bool enough_free_memory = 0;
3757 if (SPARE_MEMORY < nbytes) 3757 if (SPARE_MEMORY < nbytes)
3758 { 3758 {
3759 void *p; 3759 void *p;
@@ -4246,7 +4246,7 @@ mem_delete_fixup (struct mem_node *x)
4246/* Value is non-zero if P is a pointer to a live Lisp string on 4246/* Value is non-zero if P is a pointer to a live Lisp string on
4247 the heap. M is a pointer to the mem_block for P. */ 4247 the heap. M is a pointer to the mem_block for P. */
4248 4248
4249static inline int 4249static inline bool
4250live_string_p (struct mem_node *m, void *p) 4250live_string_p (struct mem_node *m, void *p)
4251{ 4251{
4252 if (m->type == MEM_TYPE_STRING) 4252 if (m->type == MEM_TYPE_STRING)
@@ -4269,7 +4269,7 @@ live_string_p (struct mem_node *m, void *p)
4269/* Value is non-zero if P is a pointer to a live Lisp cons on 4269/* Value is non-zero if P is a pointer to a live Lisp cons on
4270 the heap. M is a pointer to the mem_block for P. */ 4270 the heap. M is a pointer to the mem_block for P. */
4271 4271
4272static inline int 4272static inline bool
4273live_cons_p (struct mem_node *m, void *p) 4273live_cons_p (struct mem_node *m, void *p)
4274{ 4274{
4275 if (m->type == MEM_TYPE_CONS) 4275 if (m->type == MEM_TYPE_CONS)
@@ -4295,7 +4295,7 @@ live_cons_p (struct mem_node *m, void *p)
4295/* Value is non-zero if P is a pointer to a live Lisp symbol on 4295/* Value is non-zero if P is a pointer to a live Lisp symbol on
4296 the heap. M is a pointer to the mem_block for P. */ 4296 the heap. M is a pointer to the mem_block for P. */
4297 4297
4298static inline int 4298static inline bool
4299live_symbol_p (struct mem_node *m, void *p) 4299live_symbol_p (struct mem_node *m, void *p)
4300{ 4300{
4301 if (m->type == MEM_TYPE_SYMBOL) 4301 if (m->type == MEM_TYPE_SYMBOL)
@@ -4321,7 +4321,7 @@ live_symbol_p (struct mem_node *m, void *p)
4321/* Value is non-zero if P is a pointer to a live Lisp float on 4321/* Value is non-zero if P is a pointer to a live Lisp float on
4322 the heap. M is a pointer to the mem_block for P. */ 4322 the heap. M is a pointer to the mem_block for P. */
4323 4323
4324static inline int 4324static inline bool
4325live_float_p (struct mem_node *m, void *p) 4325live_float_p (struct mem_node *m, void *p)
4326{ 4326{
4327 if (m->type == MEM_TYPE_FLOAT) 4327 if (m->type == MEM_TYPE_FLOAT)
@@ -4345,7 +4345,7 @@ live_float_p (struct mem_node *m, void *p)
4345/* Value is non-zero if P is a pointer to a live Lisp Misc on 4345/* Value is non-zero if P is a pointer to a live Lisp Misc on
4346 the heap. M is a pointer to the mem_block for P. */ 4346 the heap. M is a pointer to the mem_block for P. */
4347 4347
4348static inline int 4348static inline bool
4349live_misc_p (struct mem_node *m, void *p) 4349live_misc_p (struct mem_node *m, void *p)
4350{ 4350{
4351 if (m->type == MEM_TYPE_MISC) 4351 if (m->type == MEM_TYPE_MISC)
@@ -4371,7 +4371,7 @@ live_misc_p (struct mem_node *m, void *p)
4371/* Value is non-zero if P is a pointer to a live vector-like object. 4371/* Value is non-zero if P is a pointer to a live vector-like object.
4372 M is a pointer to the mem_block for P. */ 4372 M is a pointer to the mem_block for P. */
4373 4373
4374static inline int 4374static inline bool
4375live_vector_p (struct mem_node *m, void *p) 4375live_vector_p (struct mem_node *m, void *p)
4376{ 4376{
4377 if (m->type == MEM_TYPE_VECTOR_BLOCK) 4377 if (m->type == MEM_TYPE_VECTOR_BLOCK)
@@ -4407,7 +4407,7 @@ live_vector_p (struct mem_node *m, void *p)
4407/* Value is non-zero if P is a pointer to a live buffer. M is a 4407/* Value is non-zero if P is a pointer to a live buffer. M is a
4408 pointer to the mem_block for P. */ 4408 pointer to the mem_block for P. */
4409 4409
4410static inline int 4410static inline bool
4411live_buffer_p (struct mem_node *m, void *p) 4411live_buffer_p (struct mem_node *m, void *p)
4412{ 4412{
4413 /* P must point to the start of the block, and the buffer 4413 /* P must point to the start of the block, and the buffer
@@ -4487,7 +4487,7 @@ mark_maybe_object (Lisp_Object obj)
4487 4487
4488 if (m != MEM_NIL) 4488 if (m != MEM_NIL)
4489 { 4489 {
4490 int mark_p = 0; 4490 bool mark_p = 0;
4491 4491
4492 switch (XTYPE (obj)) 4492 switch (XTYPE (obj))
4493 { 4493 {
@@ -4707,7 +4707,8 @@ mark_memory (void *start, void *end)
4707 4707
4708#if !defined GC_SAVE_REGISTERS_ON_STACK && !defined GC_SETJMP_WORKS 4708#if !defined GC_SAVE_REGISTERS_ON_STACK && !defined GC_SETJMP_WORKS
4709 4709
4710static int setjmp_tested_p, longjmps_done; 4710static bool setjmp_tested_p;
4711static int longjmps_done;
4711 4712
4712#define SETJMP_WILL_LIKELY_WORK "\ 4713#define SETJMP_WILL_LIKELY_WORK "\
4713\n\ 4714\n\
@@ -4751,7 +4752,6 @@ test_setjmp (void)
4751 char buf[10]; 4752 char buf[10];
4752 register int x; 4753 register int x;
4753 jmp_buf jbuf; 4754 jmp_buf jbuf;
4754 int result = 0;
4755 4755
4756 /* Arrange for X to be put in a register. */ 4756 /* Arrange for X to be put in a register. */
4757 sprintf (buf, "1"); 4757 sprintf (buf, "1");
@@ -4891,7 +4891,7 @@ mark_stack (void)
4891 Lisp_Object o; 4891 Lisp_Object o;
4892 jmp_buf j; 4892 jmp_buf j;
4893 } j; 4893 } j;
4894 volatile int stack_grows_down_p = (char *) &j > (char *) stack_base; 4894 volatile bool stack_grows_down_p = (char *) &j > (char *) stack_base;
4895#endif 4895#endif
4896 /* This trick flushes the register windows so that all the state of 4896 /* This trick flushes the register windows so that all the state of
4897 the process is contained in the stack. */ 4897 the process is contained in the stack. */
@@ -4965,7 +4965,7 @@ valid_pointer_p (void *p)
4965 4965
4966 if (pipe (fd) == 0) 4966 if (pipe (fd) == 0)
4967 { 4967 {
4968 int valid = (emacs_write (fd[1], (char *) p, 16) == 16); 4968 bool valid = emacs_write (fd[1], (char *) p, 16) == 16;
4969 emacs_close (fd[1]); 4969 emacs_close (fd[1]);
4970 emacs_close (fd[0]); 4970 emacs_close (fd[0]);
4971 return valid; 4971 return valid;
@@ -5186,7 +5186,7 @@ find_string_data_in_pure (const char *data, ptrdiff_t nbytes)
5186 5186
5187/* Return a string allocated in pure space. DATA is a buffer holding 5187/* Return a string allocated in pure space. DATA is a buffer holding
5188 NCHARS characters, and NBYTES bytes of string data. MULTIBYTE 5188 NCHARS characters, and NBYTES bytes of string data. MULTIBYTE
5189 non-zero means make the result string multibyte. 5189 means make the result string multibyte.
5190 5190
5191 Must get an error if pure storage is full, since if it cannot hold 5191 Must get an error if pure storage is full, since if it cannot hold
5192 a large string it may be able to hold conses that point to that 5192 a large string it may be able to hold conses that point to that
@@ -5194,7 +5194,7 @@ find_string_data_in_pure (const char *data, ptrdiff_t nbytes)
5194 5194
5195Lisp_Object 5195Lisp_Object
5196make_pure_string (const char *data, 5196make_pure_string (const char *data,
5197 ptrdiff_t nchars, ptrdiff_t nbytes, int multibyte) 5197 ptrdiff_t nchars, ptrdiff_t nbytes, bool multibyte)
5198{ 5198{
5199 Lisp_Object string; 5199 Lisp_Object string;
5200 struct Lisp_String *s = pure_alloc (sizeof *s, Lisp_String); 5200 struct Lisp_String *s = pure_alloc (sizeof *s, Lisp_String);
@@ -5389,11 +5389,11 @@ returns nil, because real GC can't be done.
5389See Info node `(elisp)Garbage Collection'. */) 5389See Info node `(elisp)Garbage Collection'. */)
5390 (void) 5390 (void)
5391{ 5391{
5392 register struct specbinding *bind; 5392 struct specbinding *bind;
5393 register struct buffer *nextb; 5393 struct buffer *nextb;
5394 char stack_top_variable; 5394 char stack_top_variable;
5395 ptrdiff_t i; 5395 ptrdiff_t i;
5396 int message_p; 5396 bool message_p;
5397 ptrdiff_t count = SPECPDL_INDEX (); 5397 ptrdiff_t count = SPECPDL_INDEX ();
5398 EMACS_TIME start; 5398 EMACS_TIME start;
5399 Lisp_Object retval = Qnil; 5399 Lisp_Object retval = Qnil;
@@ -6208,10 +6208,10 @@ mark_terminals (void)
6208/* Value is non-zero if OBJ will survive the current GC because it's 6208/* Value is non-zero if OBJ will survive the current GC because it's
6209 either marked or does not need to be marked to survive. */ 6209 either marked or does not need to be marked to survive. */
6210 6210
6211int 6211bool
6212survives_gc_p (Lisp_Object obj) 6212survives_gc_p (Lisp_Object obj)
6213{ 6213{
6214 int survives_p; 6214 bool survives_p;
6215 6215
6216 switch (XTYPE (obj)) 6216 switch (XTYPE (obj))
6217 { 6217 {
@@ -6456,7 +6456,7 @@ gc_sweep (void)
6456 /* Check if the symbol was created during loadup. In such a case 6456 /* Check if the symbol was created during loadup. In such a case
6457 it might be pointed to by pure bytecode which we don't trace, 6457 it might be pointed to by pure bytecode which we don't trace,
6458 so we conservatively assume that it is live. */ 6458 so we conservatively assume that it is live. */
6459 int pure_p = PURE_POINTER_P (XSTRING (sym->s.name)); 6459 bool pure_p = PURE_POINTER_P (XSTRING (sym->s.name));
6460 6460
6461 if (!sym->s.gcmarkbit && !pure_p) 6461 if (!sym->s.gcmarkbit && !pure_p)
6462 { 6462 {
@@ -6681,7 +6681,7 @@ which_symbols (Lisp_Object obj, EMACS_INT find_max)
6681} 6681}
6682 6682
6683#ifdef ENABLE_CHECKING 6683#ifdef ENABLE_CHECKING
6684int suppress_checking; 6684bool suppress_checking;
6685 6685
6686void 6686void
6687die (const char *msg, const char *file, int line) 6687die (const char *msg, const char *file, int line)
diff --git a/src/editfns.c b/src/editfns.c
index fa57edead28..0bd632d14b7 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3642,13 +3642,13 @@ usage: (format STRING &rest OBJECTS) */)
3642 ptrdiff_t max_bufsize = STRING_BYTES_BOUND + 1; 3642 ptrdiff_t max_bufsize = STRING_BYTES_BOUND + 1;
3643 char *p; 3643 char *p;
3644 Lisp_Object buf_save_value IF_LINT (= {0}); 3644 Lisp_Object buf_save_value IF_LINT (= {0});
3645 register char *format, *end, *format_start; 3645 char *format, *end, *format_start;
3646 ptrdiff_t formatlen, nchars; 3646 ptrdiff_t formatlen, nchars;
3647 /* Nonzero if the format is multibyte. */ 3647 /* True if the format is multibyte. */
3648 int multibyte_format = 0; 3648 bool multibyte_format = 0;
3649 /* Nonzero if the output should be a multibyte string, 3649 /* True if the output should be a multibyte string,
3650 which is true if any of the inputs is one. */ 3650 which is true if any of the inputs is one. */
3651 int multibyte = 0; 3651 bool multibyte = 0;
3652 /* When we make a multibyte string, we must pay attention to the 3652 /* When we make a multibyte string, we must pay attention to the
3653 byte combining problem, i.e., a byte may be combined with a 3653 byte combining problem, i.e., a byte may be combined with a
3654 multibyte character of the previous string. This flag tells if we 3654 multibyte character of the previous string. This flag tells if we
diff --git a/src/fileio.c b/src/fileio.c
index 2f4a2ad2314..6deca0bf1e1 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -766,7 +766,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
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;
769 int multibyte; 769 bool multibyte;
770 Lisp_Object hdir; 770 Lisp_Object hdir;
771 771
772 CHECK_STRING (name); 772 CHECK_STRING (name);
@@ -1566,7 +1566,7 @@ those `/' is discarded. */)
1566 char *target = NULL; 1566 char *target = NULL;
1567 int total = 0; 1567 int total = 0;
1568 int substituted = 0; 1568 int substituted = 0;
1569 int multibyte; 1569 bool multibyte;
1570 char *xnm; 1570 char *xnm;
1571 Lisp_Object handler; 1571 Lisp_Object handler;
1572 1572
@@ -5306,7 +5306,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5306 FILE *stream = NULL; 5306 FILE *stream = NULL;
5307 ptrdiff_t count = SPECPDL_INDEX (); 5307 ptrdiff_t count = SPECPDL_INDEX ();
5308 int orig_minibuffer_auto_raise = minibuffer_auto_raise; 5308 int orig_minibuffer_auto_raise = minibuffer_auto_raise;
5309 int old_message_p = 0; 5309 bool old_message_p = 0;
5310 struct gcpro gcpro1, gcpro2; 5310 struct gcpro gcpro1, gcpro2;
5311 5311
5312 if (max_specpdl_size < specpdl_size + 40) 5312 if (max_specpdl_size < specpdl_size + 40)
diff --git a/src/fns.c b/src/fns.c
index 34238e4cd6a..3225fefc5e3 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3967,8 +3967,8 @@ sweep_weak_table (struct Lisp_Hash_Table *h, int remove_entries_p)
3967 for (idx = HASH_INDEX (h, bucket); !NILP (idx); idx = next) 3967 for (idx = HASH_INDEX (h, bucket); !NILP (idx); idx = next)
3968 { 3968 {
3969 ptrdiff_t i = XFASTINT (idx); 3969 ptrdiff_t i = XFASTINT (idx);
3970 int key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i)); 3970 bool key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i));
3971 int value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i)); 3971 bool value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i));
3972 int remove_p; 3972 int remove_p;
3973 3973
3974 if (EQ (h->weak, Qkey)) 3974 if (EQ (h->weak, Qkey))
diff --git a/src/lisp.h b/src/lisp.h
index 30bbb65f4fa..d9a7c9d0bdc 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -124,7 +124,7 @@ extern _Noreturn void die (const char *, const char *, int);
124 eassert macro altogether, e.g., if XSTRING (x) uses eassert to test 124 eassert macro altogether, e.g., if XSTRING (x) uses eassert to test
125 STRINGP (x), but a particular use of XSTRING is invoked only after 125 STRINGP (x), but a particular use of XSTRING is invoked only after
126 testing that STRINGP (x) is true, making the test redundant. */ 126 testing that STRINGP (x) is true, making the test redundant. */
127extern int suppress_checking EXTERNALLY_VISIBLE; 127extern bool suppress_checking EXTERNALLY_VISIBLE;
128 128
129# define eassert(cond) \ 129# define eassert(cond) \
130 ((cond) || suppress_checking \ 130 ((cond) || suppress_checking \
@@ -702,7 +702,7 @@ struct Lisp_Cons
702#define CDR_SAFE(c) \ 702#define CDR_SAFE(c) \
703 (CONSP ((c)) ? XCDR ((c)) : Qnil) 703 (CONSP ((c)) ? XCDR ((c)) : Qnil)
704 704
705/* Nonzero if STR is a multibyte string. */ 705/* True if STR is a multibyte string. */
706#define STRING_MULTIBYTE(STR) \ 706#define STRING_MULTIBYTE(STR) \
707 (XSTRING (STR)->size_byte >= 0) 707 (XSTRING (STR)->size_byte >= 0)
708 708
@@ -2799,7 +2799,7 @@ extern Lisp_Object echo_area_buffer[2];
2799extern void add_to_log (const char *, Lisp_Object, Lisp_Object); 2799extern void add_to_log (const char *, Lisp_Object, Lisp_Object);
2800extern void check_message_stack (void); 2800extern void check_message_stack (void);
2801extern void setup_echo_area_for_printing (int); 2801extern void setup_echo_area_for_printing (int);
2802extern int push_message (void); 2802extern bool push_message (void);
2803extern Lisp_Object pop_message_unwind (Lisp_Object); 2803extern Lisp_Object pop_message_unwind (Lisp_Object);
2804extern Lisp_Object restore_message_unwind (Lisp_Object); 2804extern Lisp_Object restore_message_unwind (Lisp_Object);
2805extern void restore_message (void); 2805extern void restore_message (void);
@@ -2842,7 +2842,7 @@ extern void uninterrupt_malloc (void);
2842extern void malloc_warning (const char *); 2842extern void malloc_warning (const char *);
2843extern _Noreturn void memory_full (size_t); 2843extern _Noreturn void memory_full (size_t);
2844extern _Noreturn void buffer_memory_full (ptrdiff_t); 2844extern _Noreturn void buffer_memory_full (ptrdiff_t);
2845extern int survives_gc_p (Lisp_Object); 2845extern bool survives_gc_p (Lisp_Object);
2846extern void mark_object (Lisp_Object); 2846extern void mark_object (Lisp_Object);
2847#if defined REL_ALLOC && !defined SYSTEM_MALLOC 2847#if defined REL_ALLOC && !defined SYSTEM_MALLOC
2848extern void refill_memory_reserve (void); 2848extern void refill_memory_reserve (void);
@@ -2881,8 +2881,8 @@ extern Lisp_Object make_uninit_string (EMACS_INT);
2881extern Lisp_Object make_uninit_multibyte_string (EMACS_INT, EMACS_INT); 2881extern Lisp_Object make_uninit_multibyte_string (EMACS_INT, EMACS_INT);
2882extern Lisp_Object make_string_from_bytes (const char *, ptrdiff_t, ptrdiff_t); 2882extern Lisp_Object make_string_from_bytes (const char *, ptrdiff_t, ptrdiff_t);
2883extern Lisp_Object make_specified_string (const char *, 2883extern Lisp_Object make_specified_string (const char *,
2884 ptrdiff_t, ptrdiff_t, int); 2884 ptrdiff_t, ptrdiff_t, bool);
2885extern Lisp_Object make_pure_string (const char *, ptrdiff_t, ptrdiff_t, int); 2885extern Lisp_Object make_pure_string (const char *, ptrdiff_t, ptrdiff_t, bool);
2886extern Lisp_Object make_pure_c_string (const char *, ptrdiff_t); 2886extern Lisp_Object make_pure_c_string (const char *, ptrdiff_t);
2887 2887
2888/* Make a string allocated in pure space, use STR as string data. */ 2888/* Make a string allocated in pure space, use STR as string data. */
@@ -2916,8 +2916,8 @@ extern struct window *allocate_window (void);
2916extern struct frame *allocate_frame (void); 2916extern struct frame *allocate_frame (void);
2917extern struct Lisp_Process *allocate_process (void); 2917extern struct Lisp_Process *allocate_process (void);
2918extern struct terminal *allocate_terminal (void); 2918extern struct terminal *allocate_terminal (void);
2919extern int gc_in_progress; 2919extern bool gc_in_progress;
2920extern int abort_on_gc; 2920extern bool abort_on_gc;
2921extern Lisp_Object make_float (double); 2921extern Lisp_Object make_float (double);
2922extern void display_malloc_warning (void); 2922extern void display_malloc_warning (void);
2923extern ptrdiff_t inhibit_garbage_collection (void); 2923extern ptrdiff_t inhibit_garbage_collection (void);
diff --git a/src/lread.c b/src/lread.c
index f3ab1610d2c..b0413c98765 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -189,7 +189,7 @@ static int readbyte_from_string (int, Lisp_Object);
189static int unread_char; 189static int unread_char;
190 190
191static int 191static int
192readchar (Lisp_Object readcharfun, int *multibyte) 192readchar (Lisp_Object readcharfun, bool *multibyte)
193{ 193{
194 Lisp_Object tem; 194 Lisp_Object tem;
195 register int c; 195 register int c;
@@ -2354,9 +2354,9 @@ read_integer (Lisp_Object readcharfun, EMACS_INT radix)
2354static Lisp_Object 2354static Lisp_Object
2355read1 (register Lisp_Object readcharfun, int *pch, int first_in_list) 2355read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2356{ 2356{
2357 register int c; 2357 int c;
2358 unsigned uninterned_symbol = 0; 2358 bool uninterned_symbol = 0;
2359 int multibyte; 2359 bool multibyte;
2360 2360
2361 *pch = 0; 2361 *pch = 0;
2362 load_each_byte = 0; 2362 load_each_byte = 0;
diff --git a/src/print.c b/src/print.c
index 223a79dc552..64449aeaf2a 100644
--- a/src/print.c
+++ b/src/print.c
@@ -586,6 +586,7 @@ A printed representation of an object is text which describes that object. */)
586 (Lisp_Object object, Lisp_Object noescape) 586 (Lisp_Object object, Lisp_Object noescape)
587{ 587{
588 Lisp_Object printcharfun; 588 Lisp_Object printcharfun;
589 bool prev_abort_on_gc;
589 /* struct gcpro gcpro1, gcpro2; */ 590 /* struct gcpro gcpro1, gcpro2; */
590 Lisp_Object save_deactivate_mark; 591 Lisp_Object save_deactivate_mark;
591 ptrdiff_t count = SPECPDL_INDEX (); 592 ptrdiff_t count = SPECPDL_INDEX ();
@@ -601,7 +602,8 @@ A printed representation of an object is text which describes that object. */)
601 No need for specbind, since errors deactivate the mark. */ 602 No need for specbind, since errors deactivate the mark. */
602 save_deactivate_mark = Vdeactivate_mark; 603 save_deactivate_mark = Vdeactivate_mark;
603 /* GCPRO2 (object, save_deactivate_mark); */ 604 /* GCPRO2 (object, save_deactivate_mark); */
604 abort_on_gc++; 605 prev_abort_on_gc = abort_on_gc;
606 abort_on_gc = 1;
605 607
606 printcharfun = Vprin1_to_string_buffer; 608 printcharfun = Vprin1_to_string_buffer;
607 PRINTPREPARE; 609 PRINTPREPARE;
@@ -625,7 +627,7 @@ A printed representation of an object is text which describes that object. */)
625 Vdeactivate_mark = save_deactivate_mark; 627 Vdeactivate_mark = save_deactivate_mark;
626 /* UNGCPRO; */ 628 /* UNGCPRO; */
627 629
628 abort_on_gc--; 630 abort_on_gc = prev_abort_on_gc;
629 return unbind_to (count, object); 631 return unbind_to (count, object);
630} 632}
631 633
diff --git a/src/xdisp.c b/src/xdisp.c
index e41783d03c1..f5edb4b16f8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10480,11 +10480,10 @@ current_message_1 (ptrdiff_t a1, Lisp_Object a2, ptrdiff_t a3, ptrdiff_t a4)
10480 empty. This is a relatively infrequent operation, so it's not 10480 empty. This is a relatively infrequent operation, so it's not
10481 worth optimizing. */ 10481 worth optimizing. */
10482 10482
10483int 10483bool
10484push_message (void) 10484push_message (void)
10485{ 10485{
10486 Lisp_Object msg; 10486 Lisp_Object msg = current_message ();
10487 msg = current_message ();
10488 Vmessage_stack = Fcons (msg, Vmessage_stack); 10487 Vmessage_stack = Fcons (msg, Vmessage_stack);
10489 return STRINGP (msg); 10488 return STRINGP (msg);
10490} 10489}