aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2014-05-04 12:37:56 -0700
committerPaul Eggert2014-05-04 12:37:56 -0700
commit3e9fa60a5c99568817a12a1011b0e61cce5d3a67 (patch)
tree831a801351db662f324d0709bf1fee718eda63e9 /src
parentbbdcf64f499636ba9567e8fed8f209e06380352c (diff)
parent61febcb6e32860575316b8a539a2e9f13f70e3c2 (diff)
downloademacs-3e9fa60a5c99568817a12a1011b0e61cce5d3a67.tar.gz
emacs-3e9fa60a5c99568817a12a1011b0e61cce5d3a67.zip
Merge from emacs-24; up to 2014-05-04T21:18:30Z!eggert@cs.ucla.edu
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog51
-rw-r--r--src/buffer.c23
-rw-r--r--src/floatfns.c5
-rw-r--r--src/intervals.c94
-rw-r--r--src/process.c6
-rw-r--r--src/profiler.c2
-rw-r--r--src/syswait.h4
-rw-r--r--src/term.c8
8 files changed, 124 insertions, 69 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 152bcad9470..e06163c32ce 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,54 @@
12014-05-04 Paul Eggert <eggert@cs.ucla.edu>
2
3 Revert recent libpng changes (Bug#17339).
4 * Makefile.in (PNG_CFLAGS): Remove; all uses removed.
5 * image.c [HAVE_LIBPNG_PNG_H]: Include <libpng/png.h>, not <png.h>.
6
72014-05-03 Paul Eggert <eggert@cs.ucla.edu>
8
9 Handle systems without WCONTINUED consistently. (Bug#15110, 17339)
10 * process.c (handle_child_signal): Remove WCONTINUED ifdef,
11 because WCONTINUED is always defined now.
12 * syswait.h (WCONTINUED): Move here from ../lib-src/emacsclient.c.
13
142014-05-03 Eli Zaretskii <eliz@gnu.org>
15
16 * buffer.c (overlay_strings): Fix the wording of the commentary.
17
182014-05-02 Paul Eggert <eggert@cs.ucla.edu>
19
20 Consult libpng-config more consistently (Bug#17339).
21 * Makefile.in (PNG_CFLAGS): New var.
22 (ALL_CFLAGS): Use it.
23 * image.c [HAVE_PNG]: Don't worry about <libpng/png.h>, as
24 CFLAGS now handles this.
25
262014-05-01 Glenn Morris <rgm@gnu.org>
27
28 * floatfns.c (Fisnan):
29 * profiler.c (Fprofiler_cpu_running_p): Doc fix (replace `iff').
30
312014-05-01 Eli Zaretskii <eliz@gnu.org>
32
33 * term.c (tty_menu_activate): A better initialization for cursor
34 coordinates.
35
362014-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
37
38 * intervals.c: Tighten assertions.
39 (create_root_interval): Make sure the interval is not empty.
40 (intervals_equal): Use booleans.
41 (rotate_right, rotate_left): Check LENGTHs rather than TOTAL_LENGTH.
42 (balance_an_interval): Sanity check LENGTHs and TOTAL_LENGTHs.
43 (balance_possible_root_interval): Simplify and use booleans.
44 (split_interval_right, split_interval_left): Check LENGTH, and remove
45 now redundant assertion.
46 (adjust_intervals_for_insertion): Remove now redundant assertions.
47 (delete_node, interval_deletion_adjustment)
48 (adjust_intervals_for_deletion, merge_interval_right)
49 (merge_interval_left): Check LENGTH rather than TOTAL_LENGTH.
50 (reproduce_interval): Make sure the interval is not empty.
51
12014-04-30 Paul Eggert <eggert@cs.ucla.edu> 522014-04-30 Paul Eggert <eggert@cs.ucla.edu>
2 53
3 * term.c (tty_menu_activate): Don't assume row and col are initialized. 54 * term.c (tty_menu_activate): Don't assume row and col are initialized.
diff --git a/src/buffer.c b/src/buffer.c
index e6968e88d01..a1142479d04 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3328,17 +3328,18 @@ record_overlay_string (struct sortstrlist *ssl, Lisp_Object str,
3328 } 3328 }
3329} 3329}
3330 3330
3331/* Return the concatenation of the strings associated with overlays that 3331/* Concatenate the strings associated with overlays that begin or end
3332 begin or end at POS, ignoring overlays that are specific to a window 3332 at POS, ignoring overlays that are specific to windows other than W.
3333 other than W. The strings are concatenated in the appropriate order: 3333 The strings are concatenated in the appropriate order: shorter
3334 shorter overlays nest inside longer ones, and higher priority inside 3334 overlays nest inside longer ones, and higher priority inside lower.
3335 lower. Normally all of the after-strings come first, but zero-sized 3335 Normally all of the after-strings come first, but zero-sized
3336 overlays have their after-strings ride along with the before-strings 3336 overlays have their after-strings ride along with the
3337 because it would look strange to print them inside-out. 3337 before-strings because it would look strange to print them
3338 3338 inside-out.
3339 Returns the string length, and stores the contents indirectly through 3339
3340 PSTR, if that variable is non-null. The string may be overwritten by 3340 Returns the concatenated string's length, and return the pointer to
3341 subsequent calls. */ 3341 that string via PSTR, if that variable is non-NULL. The storage of
3342 the concatenated strings may be overwritten by subsequent calls. */
3342 3343
3343ptrdiff_t 3344ptrdiff_t
3344overlay_strings (ptrdiff_t pos, struct window *w, unsigned char **pstr) 3345overlay_strings (ptrdiff_t pos, struct window *w, unsigned char **pstr)
diff --git a/src/floatfns.c b/src/floatfns.c
index ac0447ce6d6..75106a661b7 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -1,7 +1,6 @@
1/* Primitive operations on floating point for GNU Emacs Lisp interpreter. 1/* Primitive operations on floating point for GNU Emacs Lisp interpreter.
2 2
3Copyright (C) 1988, 1993-1994, 1999, 2001-2014 Free Software Foundation, 3Copyright (C) 1988, 1993-1994, 1999, 2001-2014 Free Software Foundation, Inc.
4Inc.
5 4
6Author: Wolfgang Rupprecht 5Author: Wolfgang Rupprecht
7(according to ack.texi) 6(according to ack.texi)
@@ -142,7 +141,7 @@ DEFUN ("tan", Ftan, Stan, 1, 1, 0,
142} 141}
143 142
144DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0, 143DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0,
145 doc: /* Return non nil iff argument X is a NaN. */) 144 doc: /* Return non nil if argument X is a NaN. */)
146 (Lisp_Object x) 145 (Lisp_Object x)
147{ 146{
148 CHECK_FLOAT (x); 147 CHECK_FLOAT (x);
diff --git a/src/intervals.c b/src/intervals.c
index 8544ed94b79..842e0c20c42 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -110,13 +110,14 @@ create_root_interval (Lisp_Object parent)
110 set_string_intervals (parent, new); 110 set_string_intervals (parent, new);
111 new->position = 0; 111 new->position = 0;
112 } 112 }
113 113 eassert (LENGTH (new) > 0);
114
114 set_interval_object (new, parent); 115 set_interval_object (new, parent);
115 116
116 return new; 117 return new;
117} 118}
118 119
119/* Make the interval TARGET have exactly the properties of SOURCE */ 120/* Make the interval TARGET have exactly the properties of SOURCE. */
120 121
121void 122void
122copy_properties (register INTERVAL source, register INTERVAL target) 123copy_properties (register INTERVAL source, register INTERVAL target)
@@ -176,10 +177,10 @@ intervals_equal (INTERVAL i0, INTERVAL i1)
176 Lisp_Object i1_cdr, i1_val; 177 Lisp_Object i1_cdr, i1_val;
177 178
178 if (DEFAULT_INTERVAL_P (i0) && DEFAULT_INTERVAL_P (i1)) 179 if (DEFAULT_INTERVAL_P (i0) && DEFAULT_INTERVAL_P (i1))
179 return 1; 180 return true;
180 181
181 if (DEFAULT_INTERVAL_P (i0) || DEFAULT_INTERVAL_P (i1)) 182 if (DEFAULT_INTERVAL_P (i0) || DEFAULT_INTERVAL_P (i1))
182 return 0; 183 return false;
183 184
184 i0_cdr = i0->plist; 185 i0_cdr = i0->plist;
185 i1_cdr = i1->plist; 186 i1_cdr = i1->plist;
@@ -188,31 +189,31 @@ intervals_equal (INTERVAL i0, INTERVAL i1)
188 i0_sym = XCAR (i0_cdr); 189 i0_sym = XCAR (i0_cdr);
189 i0_cdr = XCDR (i0_cdr); 190 i0_cdr = XCDR (i0_cdr);
190 if (!CONSP (i0_cdr)) 191 if (!CONSP (i0_cdr))
191 return 0; 192 return false;
192 i1_val = i1->plist; 193 i1_val = i1->plist;
193 while (CONSP (i1_val) && !EQ (XCAR (i1_val), i0_sym)) 194 while (CONSP (i1_val) && !EQ (XCAR (i1_val), i0_sym))
194 { 195 {
195 i1_val = XCDR (i1_val); 196 i1_val = XCDR (i1_val);
196 if (!CONSP (i1_val)) 197 if (!CONSP (i1_val))
197 return 0; 198 return false;
198 i1_val = XCDR (i1_val); 199 i1_val = XCDR (i1_val);
199 } 200 }
200 201
201 /* i0 has something i1 doesn't. */ 202 /* i0 has something i1 doesn't. */
202 if (EQ (i1_val, Qnil)) 203 if (EQ (i1_val, Qnil))
203 return 0; 204 return false;
204 205
205 /* i0 and i1 both have sym, but it has different values in each. */ 206 /* i0 and i1 both have sym, but it has different values in each. */
206 if (!CONSP (i1_val) 207 if (!CONSP (i1_val)
207 || (i1_val = XCDR (i1_val), !CONSP (i1_val)) 208 || (i1_val = XCDR (i1_val), !CONSP (i1_val))
208 || !EQ (XCAR (i1_val), XCAR (i0_cdr))) 209 || !EQ (XCAR (i1_val), XCAR (i0_cdr)))
209 return 0; 210 return false;
210 211
211 i0_cdr = XCDR (i0_cdr); 212 i0_cdr = XCDR (i0_cdr);
212 213
213 i1_cdr = XCDR (i1_cdr); 214 i1_cdr = XCDR (i1_cdr);
214 if (!CONSP (i1_cdr)) 215 if (!CONSP (i1_cdr))
215 return 0; 216 return false;
216 i1_cdr = XCDR (i1_cdr); 217 i1_cdr = XCDR (i1_cdr);
217 } 218 }
218 219
@@ -339,10 +340,8 @@ rotate_right (INTERVAL A)
339 ptrdiff_t old_total = A->total_length; 340 ptrdiff_t old_total = A->total_length;
340 341
341 eassert (old_total > 0); 342 eassert (old_total > 0);
342 eassert (old_total 343 eassert (LENGTH (A) > 0);
343 > TOTAL_LENGTH (B) + TOTAL_LENGTH (A->right)); 344 eassert (LENGTH (B) > 0);
344 eassert (TOTAL_LENGTH (B)
345 > TOTAL_LENGTH (B->left) + TOTAL_LENGTH (c));
346 345
347 /* Deal with any Parent of A; make it point to B. */ 346 /* Deal with any Parent of A; make it point to B. */
348 if (! ROOT_INTERVAL_P (A)) 347 if (! ROOT_INTERVAL_P (A))
@@ -366,9 +365,11 @@ rotate_right (INTERVAL A)
366 /* A's total length is decreased by the length of B and its left child. */ 365 /* A's total length is decreased by the length of B and its left child. */
367 A->total_length -= B->total_length - TOTAL_LENGTH (c); 366 A->total_length -= B->total_length - TOTAL_LENGTH (c);
368 eassert (TOTAL_LENGTH (A) > 0); 367 eassert (TOTAL_LENGTH (A) > 0);
368 eassert (LENGTH (A) > 0);
369 369
370 /* B must have the same total length of A. */ 370 /* B must have the same total length of A. */
371 B->total_length = old_total; 371 B->total_length = old_total;
372 eassert (LENGTH (B) > 0);
372 373
373 return B; 374 return B;
374} 375}
@@ -390,10 +391,8 @@ rotate_left (INTERVAL A)
390 ptrdiff_t old_total = A->total_length; 391 ptrdiff_t old_total = A->total_length;
391 392
392 eassert (old_total > 0); 393 eassert (old_total > 0);
393 eassert (old_total 394 eassert (LENGTH (A) > 0);
394 > TOTAL_LENGTH (B) + TOTAL_LENGTH (A->left)); 395 eassert (LENGTH (B) > 0);
395 eassert (TOTAL_LENGTH (B)
396 > TOTAL_LENGTH (B->right) + TOTAL_LENGTH (c));
397 396
398 /* Deal with any parent of A; make it point to B. */ 397 /* Deal with any parent of A; make it point to B. */
399 if (! ROOT_INTERVAL_P (A)) 398 if (! ROOT_INTERVAL_P (A))
@@ -417,9 +416,11 @@ rotate_left (INTERVAL A)
417 /* A's total length is decreased by the length of B and its right child. */ 416 /* A's total length is decreased by the length of B and its right child. */
418 A->total_length -= B->total_length - TOTAL_LENGTH (c); 417 A->total_length -= B->total_length - TOTAL_LENGTH (c);
419 eassert (TOTAL_LENGTH (A) > 0); 418 eassert (TOTAL_LENGTH (A) > 0);
419 eassert (LENGTH (A) > 0);
420 420
421 /* B must have the same total length of A. */ 421 /* B must have the same total length of A. */
422 B->total_length = old_total; 422 B->total_length = old_total;
423 eassert (LENGTH (B) > 0);
423 424
424 return B; 425 return B;
425} 426}
@@ -432,6 +433,9 @@ balance_an_interval (INTERVAL i)
432{ 433{
433 register ptrdiff_t old_diff, new_diff; 434 register ptrdiff_t old_diff, new_diff;
434 435
436 eassert (LENGTH (i) > 0);
437 eassert (TOTAL_LENGTH (i) >= LENGTH (i));
438
435 while (1) 439 while (1)
436 { 440 {
437 old_diff = LEFT_TOTAL_LENGTH (i) - RIGHT_TOTAL_LENGTH (i); 441 old_diff = LEFT_TOTAL_LENGTH (i) - RIGHT_TOTAL_LENGTH (i);
@@ -468,16 +472,16 @@ static INTERVAL
468balance_possible_root_interval (INTERVAL interval) 472balance_possible_root_interval (INTERVAL interval)
469{ 473{
470 Lisp_Object parent; 474 Lisp_Object parent;
471 bool have_parent = 0; 475 bool have_parent = false;
472
473 if (!INTERVAL_HAS_OBJECT (interval) && !INTERVAL_HAS_PARENT (interval))
474 return interval;
475 476
476 if (INTERVAL_HAS_OBJECT (interval)) 477 if (INTERVAL_HAS_OBJECT (interval))
477 { 478 {
478 have_parent = 1; 479 have_parent = true;
479 GET_INTERVAL_OBJECT (parent, interval); 480 GET_INTERVAL_OBJECT (parent, interval);
480 } 481 }
482 else if (!INTERVAL_HAS_PARENT (interval))
483 return interval;
484
481 interval = balance_an_interval (interval); 485 interval = balance_an_interval (interval);
482 486
483 if (have_parent) 487 if (have_parent)
@@ -553,7 +557,7 @@ split_interval_right (INTERVAL interval, ptrdiff_t offset)
553 { 557 {
554 set_interval_right (interval, new); 558 set_interval_right (interval, new);
555 new->total_length = new_length; 559 new->total_length = new_length;
556 eassert (TOTAL_LENGTH (new) >= 0); 560 eassert (LENGTH (new) > 0);
557 } 561 }
558 else 562 else
559 { 563 {
@@ -562,7 +566,6 @@ split_interval_right (INTERVAL interval, ptrdiff_t offset)
562 set_interval_parent (interval->right, new); 566 set_interval_parent (interval->right, new);
563 set_interval_right (interval, new); 567 set_interval_right (interval, new);
564 new->total_length = new_length + new->right->total_length; 568 new->total_length = new_length + new->right->total_length;
565 eassert (TOTAL_LENGTH (new) >= 0);
566 balance_an_interval (new); 569 balance_an_interval (new);
567 } 570 }
568 571
@@ -598,7 +601,7 @@ split_interval_left (INTERVAL interval, ptrdiff_t offset)
598 { 601 {
599 set_interval_left (interval, new); 602 set_interval_left (interval, new);
600 new->total_length = new_length; 603 new->total_length = new_length;
601 eassert (TOTAL_LENGTH (new) >= 0); 604 eassert (LENGTH (new) > 0);
602 } 605 }
603 else 606 else
604 { 607 {
@@ -607,7 +610,6 @@ split_interval_left (INTERVAL interval, ptrdiff_t offset)
607 set_interval_parent (new->left, new); 610 set_interval_parent (new->left, new);
608 set_interval_left (interval, new); 611 set_interval_left (interval, new);
609 new->total_length = new_length + new->left->total_length; 612 new->total_length = new_length + new->left->total_length;
610 eassert (TOTAL_LENGTH (new) >= 0);
611 balance_an_interval (new); 613 balance_an_interval (new);
612 } 614 }
613 615
@@ -791,12 +793,12 @@ update_interval (register INTERVAL i, ptrdiff_t pos)
791 { 793 {
792 if (pos < i->position) 794 if (pos < i->position)
793 { 795 {
794 /* Move left. */ 796 /* Move left. */
795 if (pos >= i->position - TOTAL_LENGTH (i->left)) 797 if (pos >= i->position - TOTAL_LENGTH (i->left))
796 { 798 {
797 i->left->position = i->position - TOTAL_LENGTH (i->left) 799 i->left->position = i->position - TOTAL_LENGTH (i->left)
798 + LEFT_TOTAL_LENGTH (i->left); 800 + LEFT_TOTAL_LENGTH (i->left);
799 i = i->left; /* Move to the left child */ 801 i = i->left; /* Move to the left child. */
800 } 802 }
801 else if (NULL_PARENT (i)) 803 else if (NULL_PARENT (i))
802 error ("Point before start of properties"); 804 error ("Point before start of properties");
@@ -806,12 +808,12 @@ update_interval (register INTERVAL i, ptrdiff_t pos)
806 } 808 }
807 else if (pos >= INTERVAL_LAST_POS (i)) 809 else if (pos >= INTERVAL_LAST_POS (i))
808 { 810 {
809 /* Move right. */ 811 /* Move right. */
810 if (pos < INTERVAL_LAST_POS (i) + TOTAL_LENGTH (i->right)) 812 if (pos < INTERVAL_LAST_POS (i) + TOTAL_LENGTH (i->right))
811 { 813 {
812 i->right->position = INTERVAL_LAST_POS (i) 814 i->right->position = INTERVAL_LAST_POS (i)
813 + LEFT_TOTAL_LENGTH (i->right); 815 + LEFT_TOTAL_LENGTH (i->right);
814 i = i->right; /* Move to the right child */ 816 i = i->right; /* Move to the right child. */
815 } 817 }
816 else if (NULL_PARENT (i)) 818 else if (NULL_PARENT (i))
817 error ("Point %"pD"d after end of properties", pos); 819 error ("Point %"pD"d after end of properties", pos);
@@ -958,7 +960,6 @@ adjust_intervals_for_insertion (INTERVAL tree,
958 for (temp = prev ? prev : i; temp; temp = INTERVAL_PARENT_OR_NULL (temp)) 960 for (temp = prev ? prev : i; temp; temp = INTERVAL_PARENT_OR_NULL (temp))
959 { 961 {
960 temp->total_length += length; 962 temp->total_length += length;
961 eassert (TOTAL_LENGTH (temp) >= 0);
962 temp = balance_possible_root_interval (temp); 963 temp = balance_possible_root_interval (temp);
963 } 964 }
964 965
@@ -1014,7 +1015,6 @@ adjust_intervals_for_insertion (INTERVAL tree,
1014 for (temp = i; temp; temp = INTERVAL_PARENT_OR_NULL (temp)) 1015 for (temp = i; temp; temp = INTERVAL_PARENT_OR_NULL (temp))
1015 { 1016 {
1016 temp->total_length += length; 1017 temp->total_length += length;
1017 eassert (TOTAL_LENGTH (temp) >= 0);
1018 temp = balance_possible_root_interval (temp); 1018 temp = balance_possible_root_interval (temp);
1019 } 1019 }
1020 } 1020 }
@@ -1216,9 +1216,10 @@ delete_node (register INTERVAL i)
1216 this = this->left; 1216 this = this->left;
1217 this->total_length += migrate_amt; 1217 this->total_length += migrate_amt;
1218 } 1218 }
1219 eassert (TOTAL_LENGTH (this) >= 0);
1220 set_interval_left (this, migrate); 1219 set_interval_left (this, migrate);
1221 set_interval_parent (migrate, this); 1220 set_interval_parent (migrate, this);
1221 eassert (LENGTH (this) > 0);
1222 eassert (LENGTH (i->right) > 0);
1222 1223
1223 return i->right; 1224 return i->right;
1224} 1225}
@@ -1298,7 +1299,7 @@ interval_deletion_adjustment (register INTERVAL tree, register ptrdiff_t from,
1298 relative_position, 1299 relative_position,
1299 amount); 1300 amount);
1300 tree->total_length -= subtract; 1301 tree->total_length -= subtract;
1301 eassert (TOTAL_LENGTH (tree) >= 0); 1302 eassert (LENGTH (tree) > 0);
1302 return subtract; 1303 return subtract;
1303 } 1304 }
1304 /* Right branch. */ 1305 /* Right branch. */
@@ -1313,7 +1314,7 @@ interval_deletion_adjustment (register INTERVAL tree, register ptrdiff_t from,
1313 relative_position, 1314 relative_position,
1314 amount); 1315 amount);
1315 tree->total_length -= subtract; 1316 tree->total_length -= subtract;
1316 eassert (TOTAL_LENGTH (tree) >= 0); 1317 eassert (LENGTH (tree) > 0);
1317 return subtract; 1318 return subtract;
1318 } 1319 }
1319 /* Here -- this node. */ 1320 /* Here -- this node. */
@@ -1328,7 +1329,7 @@ interval_deletion_adjustment (register INTERVAL tree, register ptrdiff_t from,
1328 amount = my_amount; 1329 amount = my_amount;
1329 1330
1330 tree->total_length -= amount; 1331 tree->total_length -= amount;
1331 eassert (TOTAL_LENGTH (tree) >= 0); 1332 eassert (LENGTH (tree) >= 0);
1332 if (LENGTH (tree) == 0) 1333 if (LENGTH (tree) == 0)
1333 delete_interval (tree); 1334 delete_interval (tree);
1334 1335
@@ -1370,7 +1371,7 @@ adjust_intervals_for_deletion (struct buffer *buffer,
1370 if (ONLY_INTERVAL_P (tree)) 1371 if (ONLY_INTERVAL_P (tree))
1371 { 1372 {
1372 tree->total_length -= length; 1373 tree->total_length -= length;
1373 eassert (TOTAL_LENGTH (tree) >= 0); 1374 eassert (LENGTH (tree) > 0);
1374 return; 1375 return;
1375 } 1376 }
1376 1377
@@ -1430,12 +1431,12 @@ merge_interval_right (register INTERVAL i)
1430 while (! NULL_LEFT_CHILD (successor)) 1431 while (! NULL_LEFT_CHILD (successor))
1431 { 1432 {
1432 successor->total_length += absorb; 1433 successor->total_length += absorb;
1433 eassert (TOTAL_LENGTH (successor) >= 0); 1434 eassert (LENGTH (successor) > 0);
1434 successor = successor->left; 1435 successor = successor->left;
1435 } 1436 }
1436 1437
1437 successor->total_length += absorb; 1438 successor->total_length += absorb;
1438 eassert (TOTAL_LENGTH (successor) >= 0); 1439 eassert (LENGTH (successor) > 0);
1439 delete_interval (i); 1440 delete_interval (i);
1440 return successor; 1441 return successor;
1441 } 1442 }
@@ -1457,7 +1458,7 @@ merge_interval_right (register INTERVAL i)
1457 1458
1458 successor = INTERVAL_PARENT (successor); 1459 successor = INTERVAL_PARENT (successor);
1459 successor->total_length -= absorb; 1460 successor->total_length -= absorb;
1460 eassert (TOTAL_LENGTH (successor) >= 0); 1461 eassert (LENGTH (successor) > 0);
1461 } 1462 }
1462 1463
1463 /* This must be the rightmost or last interval and cannot 1464 /* This must be the rightmost or last interval and cannot
@@ -1486,12 +1487,12 @@ merge_interval_left (register INTERVAL i)
1486 while (! NULL_RIGHT_CHILD (predecessor)) 1487 while (! NULL_RIGHT_CHILD (predecessor))
1487 { 1488 {
1488 predecessor->total_length += absorb; 1489 predecessor->total_length += absorb;
1489 eassert (TOTAL_LENGTH (predecessor) >= 0); 1490 eassert (LENGTH (predecessor) > 0);
1490 predecessor = predecessor->right; 1491 predecessor = predecessor->right;
1491 } 1492 }
1492 1493
1493 predecessor->total_length += absorb; 1494 predecessor->total_length += absorb;
1494 eassert (TOTAL_LENGTH (predecessor) >= 0); 1495 eassert (LENGTH (predecessor) > 0);
1495 delete_interval (i); 1496 delete_interval (i);
1496 return predecessor; 1497 return predecessor;
1497 } 1498 }
@@ -1513,7 +1514,7 @@ merge_interval_left (register INTERVAL i)
1513 1514
1514 predecessor = INTERVAL_PARENT (predecessor); 1515 predecessor = INTERVAL_PARENT (predecessor);
1515 predecessor->total_length -= absorb; 1516 predecessor->total_length -= absorb;
1516 eassert (TOTAL_LENGTH (predecessor) >= 0); 1517 eassert (LENGTH (predecessor) > 0);
1517 } 1518 }
1518 1519
1519 /* This must be the leftmost or first interval and cannot 1520 /* This must be the leftmost or first interval and cannot
@@ -1528,6 +1529,8 @@ reproduce_interval (INTERVAL source)
1528{ 1529{
1529 register INTERVAL target = make_interval (); 1530 register INTERVAL target = make_interval ();
1530 1531
1532 eassert (LENGTH (source) > 0);
1533
1531 target->total_length = source->total_length; 1534 target->total_length = source->total_length;
1532 target->position = source->position; 1535 target->position = source->position;
1533 1536
@@ -1538,6 +1541,7 @@ reproduce_interval (INTERVAL source)
1538 if (! NULL_RIGHT_CHILD (source)) 1541 if (! NULL_RIGHT_CHILD (source))
1539 set_interval_right (target, reproduce_tree (source->right, target)); 1542 set_interval_right (target, reproduce_tree (source->right, target));
1540 1543
1544 eassert (LENGTH (target) > 0);
1541 return target; 1545 return target;
1542} 1546}
1543 1547
@@ -1766,7 +1770,7 @@ lookup_char_property (Lisp_Object plist, Lisp_Object prop, bool textprop)
1766 1770
1767 if (! NILP (fallback)) 1771 if (! NILP (fallback))
1768 return fallback; 1772 return fallback;
1769 /* Check for alternative properties */ 1773 /* Check for alternative properties. */
1770 tail = Fassq (prop, Vchar_property_alias_alist); 1774 tail = Fassq (prop, Vchar_property_alias_alist);
1771 if (! NILP (tail)) 1775 if (! NILP (tail))
1772 { 1776 {
@@ -2434,7 +2438,7 @@ set_intervals_multibyte_1 (INTERVAL i, bool multi_flag,
2434 end, end_byte); 2438 end, end_byte);
2435 } 2439 }
2436 2440
2437 /* Rounding to char boundaries can theoretically ake this interval 2441 /* Rounding to char boundaries can theoretically make this interval
2438 spurious. If so, delete one child, and copy its property list 2442 spurious. If so, delete one child, and copy its property list
2439 to this interval. */ 2443 to this interval. */
2440 if (LEFT_TOTAL_LENGTH (i) + RIGHT_TOTAL_LENGTH (i) >= TOTAL_LENGTH (i)) 2444 if (LEFT_TOTAL_LENGTH (i) + RIGHT_TOTAL_LENGTH (i) >= TOTAL_LENGTH (i))
diff --git a/src/process.c b/src/process.c
index 655f083fc33..fdb0501f9ec 100644
--- a/src/process.c
+++ b/src/process.c
@@ -6226,11 +6226,7 @@ handle_child_signal (int sig)
6226 int status; 6226 int status;
6227 6227
6228 if (p->alive 6228 if (p->alive
6229#ifndef WCONTINUED 6229 && child_status_changed (p->pid, &status, WUNTRACED | WCONTINUED))
6230 && child_status_changed (p->pid, &status, WUNTRACED))
6231#else
6232 && child_status_changed (p->pid, &status, WUNTRACED | WCONTINUED))
6233#endif
6234 { 6230 {
6235 /* Change the status of the process that was found. */ 6231 /* Change the status of the process that was found. */
6236 p->tick = ++process_tick; 6232 p->tick = ++process_tick;
diff --git a/src/profiler.c b/src/profiler.c
index ff97fe88b7b..919aabc92af 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -384,7 +384,7 @@ Return non-nil if the profiler was running. */)
384DEFUN ("profiler-cpu-running-p", 384DEFUN ("profiler-cpu-running-p",
385 Fprofiler_cpu_running_p, Sprofiler_cpu_running_p, 385 Fprofiler_cpu_running_p, Sprofiler_cpu_running_p,
386 0, 0, 0, 386 0, 0, 0,
387 doc: /* Return non-nil iff cpu profiler is running. */) 387 doc: /* Return non-nil if cpu profiler is running. */)
388 (void) 388 (void)
389{ 389{
390 return profiler_cpu_running ? Qt : Qnil; 390 return profiler_cpu_running ? Qt : Qnil;
diff --git a/src/syswait.h b/src/syswait.h
index db197b82fb7..9c8cbd51f00 100644
--- a/src/syswait.h
+++ b/src/syswait.h
@@ -29,6 +29,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
29#include <sys/wait.h> 29#include <sys/wait.h>
30#endif /* !HAVE_SYS_WAIT_H */ 30#endif /* !HAVE_SYS_WAIT_H */
31 31
32#ifndef WCONTINUED
33#define WCONTINUED 8
34#endif
35
32#ifndef WCOREDUMP /* not POSIX */ 36#ifndef WCOREDUMP /* not POSIX */
33#define WCOREDUMP(status) ((status) & 0x80) 37#define WCOREDUMP(status) ((status) & 0x80)
34#endif 38#endif
diff --git a/src/term.c b/src/term.c
index c636b8cac8b..8ea3e42dae6 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3267,7 +3267,10 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3267 3267
3268 /* Turn off the cursor. Otherwise it shows through the menu 3268 /* Turn off the cursor. Otherwise it shows through the menu
3269 panes, which is ugly. */ 3269 panes, which is ugly. */
3270 col = cursorX (tty);
3271 row = cursorY (tty);
3270 tty_hide_cursor (tty); 3272 tty_hide_cursor (tty);
3273
3271 if (buffers_num_deleted) 3274 if (buffers_num_deleted)
3272 menu->text[0][7] = ' '; 3275 menu->text[0][7] = ' ';
3273 onepane = menu->count == 1 && menu->submenu[0]; 3276 onepane = menu->count == 1 && menu->submenu[0];
@@ -3405,8 +3408,6 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3405 col = cursorX (tty); 3408 col = cursorX (tty);
3406 row = cursorY (tty); 3409 row = cursorY (tty);
3407 } 3410 }
3408 else
3409 row = -1;
3410 3411
3411 /* Display the help-echo message for the currently-selected menu 3412 /* Display the help-echo message for the currently-selected menu
3412 item. */ 3413 item. */
@@ -3418,8 +3419,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3418 /* Move the cursor to the beginning of the current menu 3419 /* Move the cursor to the beginning of the current menu
3419 item, so that screen readers and other accessibility aids 3420 item, so that screen readers and other accessibility aids
3420 know where the active region is. */ 3421 know where the active region is. */
3421 if (0 <= row) 3422 cursor_to (sf, row, col);
3422 cursor_to (sf, row, col);
3423 tty_hide_cursor (tty); 3423 tty_hide_cursor (tty);
3424 fflush (tty->output); 3424 fflush (tty->output);
3425 prev_menu_help_message = menu_help_message; 3425 prev_menu_help_message = menu_help_message;