diff options
| author | Stefan Monnier | 2007-10-02 21:07:15 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-10-02 21:07:15 +0000 |
| commit | 86a56ef3739fd7e4f1abd0fc122fa6348b73bc36 (patch) | |
| tree | 43ec7336c3b3fbf94443697be5f044d4dd4b84fc | |
| parent | 5a6891e297787d42e24d0ce013baf907c1889d73 (diff) | |
| download | emacs-86a56ef3739fd7e4f1abd0fc122fa6348b73bc36.tar.gz emacs-86a56ef3739fd7e4f1abd0fc122fa6348b73bc36.zip | |
(adjust_markers_for_insert): Generalize assertion checks.
| -rw-r--r-- | src/insdel.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/insdel.c b/src/insdel.c index cd8e2738f9a..5cde53864b7 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) | |||
| 415 | 415 | ||
| 416 | for (m = BUF_MARKERS (current_buffer); m; m = m->next) | 416 | for (m = BUF_MARKERS (current_buffer); m; m = m->next) |
| 417 | { | 417 | { |
| 418 | /* In a single-byte buffer, a marker's two positions must be | 418 | eassert (m->bytepos >= m->charpos |
| 419 | equal. */ | 419 | && m->bytepos - m->charpos <= Z_BYTE - Z); |
| 420 | if (Z == Z_BYTE) | ||
| 421 | { | ||
| 422 | if (m->charpos != m->bytepos) | ||
| 423 | abort (); | ||
| 424 | } | ||
| 425 | 420 | ||
| 426 | if (m->bytepos == from_byte) | 421 | if (m->bytepos == from_byte) |
| 427 | { | 422 | { |
| @@ -468,9 +463,7 @@ adjust_point (nchars, nbytes) | |||
| 468 | BUF_PT_BYTE (current_buffer) += nbytes; | 463 | BUF_PT_BYTE (current_buffer) += nbytes; |
| 469 | 464 | ||
| 470 | /* In a single-byte buffer, the two positions must be equal. */ | 465 | /* In a single-byte buffer, the two positions must be equal. */ |
| 471 | if (ZV == ZV_BYTE | 466 | eassert (PT_BYTE >= PT && PT_BYTE - PT <= ZV_BYTE - ZV); |
| 472 | && PT != PT_BYTE) | ||
| 473 | abort (); | ||
| 474 | } | 467 | } |
| 475 | 468 | ||
| 476 | /* Adjust markers for a replacement of a text at FROM (FROM_BYTE) of | 469 | /* Adjust markers for a replacement of a text at FROM (FROM_BYTE) of |