aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2007-10-02 21:07:15 +0000
committerStefan Monnier <[email protected]>2007-10-02 21:07:15 +0000
commit86a56ef3739fd7e4f1abd0fc122fa6348b73bc36 (patch)
tree43ec7336c3b3fbf94443697be5f044d4dd4b84fc
parent5a6891e297787d42e24d0ce013baf907c1889d73 (diff)
(adjust_markers_for_insert): Generalize assertion checks.
-rw-r--r--src/insdel.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/insdel.c b/src/insdel.c
index cd8e2738f9..5cde53864b 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -415,13 +415,8 @@ adjust_markers_for_insert (from, from_byte, to, to_byte, before_markers)
for (m = BUF_MARKERS (current_buffer); m; m = m->next)
{
- /* In a single-byte buffer, a marker's two positions must be
- equal. */
- if (Z == Z_BYTE)
- {
- if (m->charpos != m->bytepos)
- abort ();
- }
+ eassert (m->bytepos >= m->charpos
+ && m->bytepos - m->charpos <= Z_BYTE - Z);
if (m->bytepos == from_byte)
{
@@ -468,9 +463,7 @@ adjust_point (nchars, nbytes)
BUF_PT_BYTE (current_buffer) += nbytes;
/* In a single-byte buffer, the two positions must be equal. */
- if (ZV == ZV_BYTE
- && PT != PT_BYTE)
- abort ();
+ eassert (PT_BYTE >= PT && PT_BYTE - PT <= ZV_BYTE - ZV);
}
/* Adjust markers for a replacement of a text at FROM (FROM_BYTE) of