summaryrefslogtreecommitdiff
path: root/src/region-cache.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-09-04 10:34:54 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-09-04 10:34:54 -0700
commit1088b9226e7dac7314dab52ef0696a5f540900cd (patch)
treebfae7d26f4b411f5c6a0ef33cfcd0c526619ee56 /src/region-cache.c
parent30934d334e8a67c8992d910428758d5b93e0f04f (diff)
downloademacs-1088b9226e7dac7314dab52ef0696a5f540900cd.tar.gz
Simplify redefinition of 'abort' (Bug#12316).
Do not try to redefine the 'abort' function. Instead, redo the code so that it calls 'emacs_abort' rather than 'abort'. This removes the need for the NO_ABORT configure-time macro and makes it easier to change the abort code to do a backtrace. * configure.ac (NO_ABRT): Remove. * admin/CPP-DEFINES (NO_ABORT): Remove. * nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove. * src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort. * src/emacs.c (abort) [!DOS_NT && !NO_ABORT]: Remove; sysdep.c's emacs_abort now takes its place. * src/lisp.h (emacs_abort): New decl. All calls from Emacs code to 'abort' changed to use 'emacs_abort'. * src/msdos.c (dos_abort) [defined abort]: Remove; not used. (abort) [!defined abort]: Rename to ... (emacs_abort): ... new name. * src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking the place of the old 'abort' in emacs.c. * src/w32.c, src/w32fns.c (abort): Do not #undef. * src/w32.c (emacs_abort): Rename from w32_abort.
Diffstat (limited to 'src/region-cache.c')
-rw-r--r--src/region-cache.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/region-cache.c b/src/region-cache.c
index d2bba8c11b2..c3eb087aade 100644
--- a/src/region-cache.c
+++ b/src/region-cache.c
@@ -194,7 +194,7 @@ find_cache_boundary (struct region_cache *c, ptrdiff_t pos)
if (BOUNDARY_POS (c, low) > pos
|| (low + 1 < c->cache_len
&& BOUNDARY_POS (c, low + 1) <= pos))
- abort ();
+ emacs_abort ();
return low;
}
@@ -217,12 +217,12 @@ move_cache_gap (struct region_cache *c, ptrdiff_t pos, ptrdiff_t min_size)
if (pos < 0
|| pos > c->cache_len)
- abort ();
+ emacs_abort ();
/* We mustn't ever try to put the gap before the dummy start
boundary. That must always be start-relative. */
if (pos == 0)
- abort ();
+ emacs_abort ();
/* Need we move the gap right? */
while (gap_start < pos)
@@ -291,24 +291,24 @@ insert_cache_boundary (struct region_cache *c, ptrdiff_t i, ptrdiff_t pos,
{
/* i must be a valid cache index. */
if (i < 0 || i > c->cache_len)
- abort ();
+ emacs_abort ();
/* We must never want to insert something before the dummy first
boundary. */
if (i == 0)
- abort ();
+ emacs_abort ();
/* We must only be inserting things in order. */
if (! (BOUNDARY_POS (c, i - 1) < pos
&& (i == c->cache_len
|| pos < BOUNDARY_POS (c, i))))
- abort ();
+ emacs_abort ();
/* The value must be different from the ones around it. However, we
temporarily create boundaries that establish the same value as
the subsequent boundary, so we're not going to flag that case. */
if (BOUNDARY_VALUE (c, i - 1) == value)
- abort ();
+ emacs_abort ();
move_cache_gap (c, i, 1);
@@ -331,16 +331,16 @@ delete_cache_boundaries (struct region_cache *c,
/* Gotta be in range. */
if (start < 0
|| end > c->cache_len)
- abort ();
+ emacs_abort ();
/* Gotta be in order. */
if (start > end)
- abort ();
+ emacs_abort ();
/* Can't delete the dummy entry. */
if (start == 0
&& end >= 1)
- abort ();
+ emacs_abort ();
/* Minimize gap motion. If we're deleting nothing, do nothing. */
if (len == 0)
@@ -380,10 +380,10 @@ set_cache_region (struct region_cache *c,
ptrdiff_t start, ptrdiff_t end, int value)
{
if (start > end)
- abort ();
+ emacs_abort ();
if (start < c->buffer_beg
|| end > c->buffer_end)
- abort ();
+ emacs_abort ();
/* Eliminate this case; then we can assume that start and end-1 are
both the locations of real characters in the buffer. */