aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorPo Lu2024-01-06 15:28:14 +0800
committerPo Lu2024-01-06 15:28:14 +0800
commit657275529e31226bbc6c92eb7f7af887474a0bb8 (patch)
tree1a2091dfb27b9932c6e17a18f458f52b4c1ecc4d /src/buffer.c
parent2f59052602e71fb818dd5d671be119793864e712 (diff)
downloademacs-657275529e31226bbc6c92eb7f7af887474a0bb8.tar.gz
emacs-657275529e31226bbc6c92eb7f7af887474a0bb8.zip
Revert "Add new `swap` macro and use it"
typeof is an extension which does not exist in Standard C, so macros using it are unsuitable for inclusion in Emacs. This reverts commit 37889523278fe65733938fb11c3701898309961c.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 14c67224551..352aca8ddfd 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3591,7 +3591,10 @@ for the rear of the overlay advance when text is inserted there
3591 CHECK_FIXNUM_COERCE_MARKER (end); 3591 CHECK_FIXNUM_COERCE_MARKER (end);
3592 3592
3593 if (XFIXNUM (beg) > XFIXNUM (end)) 3593 if (XFIXNUM (beg) > XFIXNUM (end))
3594 swap (beg, end); 3594 {
3595 Lisp_Object temp;
3596 temp = beg; beg = end; end = temp;
3597 }
3595 3598
3596 ptrdiff_t obeg = clip_to_bounds (BUF_BEG (b), XFIXNUM (beg), BUF_Z (b)); 3599 ptrdiff_t obeg = clip_to_bounds (BUF_BEG (b), XFIXNUM (beg), BUF_Z (b));
3597 ptrdiff_t oend = clip_to_bounds (obeg, XFIXNUM (end), BUF_Z (b)); 3600 ptrdiff_t oend = clip_to_bounds (obeg, XFIXNUM (end), BUF_Z (b));
@@ -3611,7 +3614,11 @@ static void
3611modify_overlay (struct buffer *buf, ptrdiff_t start, ptrdiff_t end) 3614modify_overlay (struct buffer *buf, ptrdiff_t start, ptrdiff_t end)
3612{ 3615{
3613 if (start > end) 3616 if (start > end)
3614 swap (start, end); 3617 {
3618 ptrdiff_t temp = start;
3619 start = end;
3620 end = temp;
3621 }
3615 3622
3616 BUF_COMPUTE_UNCHANGED (buf, start, end); 3623 BUF_COMPUTE_UNCHANGED (buf, start, end);
3617 3624
@@ -3651,7 +3658,10 @@ buffer. */)
3651 CHECK_FIXNUM_COERCE_MARKER (end); 3658 CHECK_FIXNUM_COERCE_MARKER (end);
3652 3659
3653 if (XFIXNUM (beg) > XFIXNUM (end)) 3660 if (XFIXNUM (beg) > XFIXNUM (end))
3654 swap (beg, end); 3661 {
3662 Lisp_Object temp;
3663 temp = beg; beg = end; end = temp;
3664 }
3655 3665
3656 specbind (Qinhibit_quit, Qt); /* FIXME: Why? */ 3666 specbind (Qinhibit_quit, Qt); /* FIXME: Why? */
3657 3667