changeset 85016:c7d378d22b24

(adjust_markers_for_insert): Generalize assertion checks.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 02 Oct 2007 21:07:15 +0000
parents 695c195058e7
children b0be1b2384d2
files src/insdel.c
diffstat 1 files changed, 3 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/insdel.c	Tue Oct 02 21:06:16 2007 +0000
+++ b/src/insdel.c	Tue Oct 02 21:07:15 2007 +0000
@@ -415,13 +415,8 @@
 
   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 @@
   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