summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--configure.in2
-rw-r--r--src/ChangeLog30
-rw-r--r--src/alloc.c10
-rw-r--r--src/bidi.c10
-rw-r--r--src/dispextern.h13
-rw-r--r--src/dispnew.c120
-rw-r--r--src/fns.c26
-rw-r--r--src/fontset.c39
-rw-r--r--src/fringe.c2
-rw-r--r--src/ftfont.c4
-rw-r--r--src/gtkutil.c2
-rw-r--r--src/image.c46
-rw-r--r--src/keyboard.c4
-rw-r--r--src/menu.c2
-rw-r--r--src/process.c8
-rw-r--r--src/scroll.c10
-rw-r--r--src/sound.c4
-rw-r--r--src/term.c14
-rw-r--r--src/w32console.c2
-rw-r--r--src/w32fns.c4
-rw-r--r--src/w32term.c14
-rw-r--r--src/window.c12
-rw-r--r--src/xdisp.c320
-rw-r--r--src/xfaces.c90
-rw-r--r--src/xfns.c6
-rw-r--r--src/xselect.c2
-rw-r--r--src/xterm.c20
28 files changed, 416 insertions, 404 deletions
diff --git a/ChangeLog b/ChangeLog
index cb0c1632031..9d910fe62d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * configure.in (ENABLE_CHECKING): Update comment.
+
2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
* configure.in: Don't check for sys/select.h, sys/time.h, utime.h.
diff --git a/configure.in b/configure.in
index d545ff4899a..7494e5e5da0 100644
--- a/configure.in
+++ b/configure.in
@@ -284,7 +284,7 @@ IFS="$ac_save_IFS"
if test x$ac_enable_checking != x ; then
AC_DEFINE(ENABLE_CHECKING, 1,
-[Enable expensive run-time checking of data types?])
+[Define to 1 if expensive run-time data type and consistency checks are enabled.])
fi
if test x$ac_gc_check_stringbytes != x ; then
AC_DEFINE(GC_CHECK_STRING_BYTES, 1,
diff --git a/src/ChangeLog b/src/ChangeLog
index 9af61d41353..9a677d9f2d7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,33 @@
+2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Generalize run-time debugging checks.
+ * dispextern.h (XASSERTS): Remove.
+ * fontset.c (xassert): Remove.
+ Convert from xassert to eassert.
+ * alloc.c: Convert from xassert to eassert.
+ * bidi.c: Likewise.
+ * dispnew.c: Likewise.
+ * fns.c: Likewise.
+ * fringe.c: Likewise.
+ * ftfont.c: Likewise.
+ * gtkutil.c: Likewise.
+ * image.c: Likewise.
+ * keyboard.c: Likewise.
+ * menu.c: Likewise.
+ * process.c: Likewise.
+ * scroll.c: Likewise.
+ * sound.c: Likewise.
+ * term.c: Likewise.
+ * w32console.c: Likewise.
+ * w32fns.c: Likewise.
+ * w32term.c: Likewise.
+ * window.c: Likewise.
+ * xdisp.c: Likewise.
+ * xfaces.c: Likewise.
+ * xfns.c: Likewise.
+ * xselect.c: Likewise.
+ * xterm.c: Likewise.
+
2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
* fns.c (maybe_resize_hash_table): Output message when growing the
diff --git a/src/alloc.c b/src/alloc.c
index 17212f8d37d..2570364e6c1 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -787,7 +787,7 @@ verify (INT_MAX <= PTRDIFF_MAX);
void *
xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size)
{
- xassert (0 <= nitems && 0 < item_size);
+ eassert (0 <= nitems && 0 < item_size);
if (min (PTRDIFF_MAX, SIZE_MAX) / item_size < nitems)
memory_full (SIZE_MAX);
return xmalloc (nitems * item_size);
@@ -800,7 +800,7 @@ xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size)
void *
xnrealloc (void *pa, ptrdiff_t nitems, ptrdiff_t item_size)
{
- xassert (0 <= nitems && 0 < item_size);
+ eassert (0 <= nitems && 0 < item_size);
if (min (PTRDIFF_MAX, SIZE_MAX) / item_size < nitems)
memory_full (SIZE_MAX);
return xrealloc (pa, nitems * item_size);
@@ -850,7 +850,7 @@ xpalloc (void *pa, ptrdiff_t *nitems, ptrdiff_t nitems_incr_min,
ptrdiff_t nitems_incr_max = n_max - n;
ptrdiff_t incr = max (nitems_incr_min, min (incr_estimate, nitems_incr_max));
- xassert (0 < item_size && 0 < nitems_incr_min && 0 <= n && -1 <= nitems_max);
+ eassert (0 < item_size && 0 < nitems_incr_min && 0 <= n && -1 <= nitems_max);
if (! pa)
*nitems = 0;
if (nitems_incr_max < incr)
@@ -2220,7 +2220,7 @@ compact_small_strings (void)
for (b = oldest_sblock; b; b = b->next)
{
end = b->next_free;
- xassert ((char *) end <= (char *) b + SBLOCK_SIZE);
+ eassert ((char *) end <= (char *) b + SBLOCK_SIZE);
for (from = &b->first_data; from < end; from = from_end)
{
@@ -2271,7 +2271,7 @@ compact_small_strings (void)
/* Copy, and update the string's `data' pointer. */
if (from != to)
{
- xassert (tb != b || to < from);
+ eassert (tb != b || to < from);
memmove (to, from, nbytes + GC_STRING_EXTRA);
to->string->data = SDATA_DATA (to);
}
diff --git a/src/bidi.c b/src/bidi.c
index 675e2028d92..80986e5b671 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -149,7 +149,7 @@ bidi_get_type (int ch, bidi_dir_t override)
static inline void
bidi_check_type (bidi_type_t type)
{
- xassert (UNKNOWN_BT <= type && type <= NEUTRAL_ON);
+ eassert (UNKNOWN_BT <= type && type <= NEUTRAL_ON);
}
/* Given a bidi TYPE of a character, return its category. */
@@ -263,7 +263,7 @@ bidi_push_embedding_level (struct bidi_it *bidi_it,
int level, bidi_dir_t override)
{
bidi_it->stack_idx++;
- xassert (bidi_it->stack_idx < BIDI_MAXLEVEL);
+ eassert (bidi_it->stack_idx < BIDI_MAXLEVEL);
bidi_it->level_stack[bidi_it->stack_idx].level = level;
bidi_it->level_stack[bidi_it->stack_idx].override = override;
}
@@ -458,7 +458,7 @@ bidi_cache_find_level_change (int level, int dir, int before)
ptrdiff_t i = dir ? bidi_cache_last_idx : bidi_cache_idx - 1;
int incr = before ? 1 : 0;
- xassert (!dir || bidi_cache_last_idx >= 0);
+ eassert (!dir || bidi_cache_last_idx >= 0);
if (!dir)
dir = -1;
@@ -616,7 +616,7 @@ bidi_push_it (struct bidi_it *bidi_it)
memcpy (&bidi_cache[bidi_cache_idx++], bidi_it, sizeof (struct bidi_it));
/* Push the current cache start onto the stack. */
- xassert (bidi_cache_sp < IT_STACK_SIZE);
+ eassert (bidi_cache_sp < IT_STACK_SIZE);
bidi_cache_start_stack[bidi_cache_sp++] = bidi_cache_start;
/* Start a new level of cache, and make it empty. */
@@ -1958,7 +1958,7 @@ bidi_resolve_neutral (struct bidi_it *bidi_it)
case STRONG_AL:
/* Actually, STRONG_AL cannot happen here, because
bidi_resolve_weak converts it to STRONG_R, per W3. */
- xassert (type != STRONG_AL);
+ eassert (type != STRONG_AL);
next_type = type;
break;
case WEAK_EN:
diff --git a/src/dispextern.h b/src/dispextern.h
index d541d181fbf..78f6db63cb7 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -128,13 +128,6 @@ enum window_part
#define GLYPH_DEBUG 0
#endif
-/* If XASSERTS is non-zero, additional consistency checks are activated.
- Turn it off by defining the macro XASSERTS to zero. */
-
-#ifndef XASSERTS
-#define XASSERTS 0
-#endif
-
/* Macros to include code only if GLYPH_DEBUG != 0. */
#if GLYPH_DEBUG
@@ -143,12 +136,6 @@ enum window_part
#define IF_DEBUG(X) (void) 0
#endif
-#if XASSERTS
-#define xassert(X) do {if (!(X)) abort ();} while (0)
-#else
-#define xassert(X) (void) 0
-#endif
-
/* Macro for displaying traces of redisplay. If Emacs was compiled
with GLYPH_DEBUG != 0, the variable trace_redisplay_p can be set to
a non-zero value in debugging sessions to activate traces. */
diff --git a/src/dispnew.c b/src/dispnew.c
index 05c22be79ae..a34552fc564 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -419,9 +419,9 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin
return n;
}
-#if XASSERTS
+#ifdef ENABLE_CHECKING
/* Return non-zero if ROW's hash value is correct, zero if not. */
-int
+static int
verify_row_hash (struct glyph_row *row)
{
return row->hash == row_hash (row);
@@ -480,7 +480,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
{
left = margin_glyphs_to_reserve (w, dim.width, w->left_margin_cols);
right = margin_glyphs_to_reserve (w, dim.width, w->right_margin_cols);
- xassert (left >= 0 && right >= 0);
+ eassert (left >= 0 && right >= 0);
marginal_areas_changed_p = (left != matrix->left_margin_glyphs
|| right != matrix->right_margin_glyphs);
@@ -513,7 +513,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
each row into the glyph pool. */
if (matrix->pool)
{
- xassert (matrix->pool->glyphs);
+ eassert (matrix->pool->glyphs);
if (w)
{
@@ -602,14 +602,14 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
}
}
- xassert (left >= 0 && right >= 0);
+ eassert (left >= 0 && right >= 0);
matrix->left_margin_glyphs = left;
matrix->right_margin_glyphs = right;
}
/* Number of rows to be used by MATRIX. */
matrix->nrows = dim.height;
- xassert (matrix->nrows >= 0);
+ eassert (matrix->nrows >= 0);
if (w)
{
@@ -751,9 +751,9 @@ increment_matrix_positions (struct glyph_matrix *matrix, int start, int end,
ptrdiff_t delta, ptrdiff_t delta_bytes)
{
/* Check that START and END are reasonable values. */
- xassert (start >= 0 && start <= matrix->nrows);
- xassert (end >= 0 && end <= matrix->nrows);
- xassert (start <= end);
+ eassert (start >= 0 && start <= matrix->nrows);
+ eassert (end >= 0 && end <= matrix->nrows);
+ eassert (start <= end);
for (; start < end; ++start)
increment_row_positions (matrix->rows + start, delta, delta_bytes);
@@ -767,9 +767,9 @@ increment_matrix_positions (struct glyph_matrix *matrix, int start, int end,
void
enable_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end, int enabled_p)
{
- xassert (start <= end);
- xassert (start >= 0 && start < matrix->nrows);
- xassert (end >= 0 && end <= matrix->nrows);
+ eassert (start <= end);
+ eassert (start >= 0 && start < matrix->nrows);
+ eassert (end >= 0 && end <= matrix->nrows);
for (; start < end; ++start)
matrix->rows[start].enabled_p = enabled_p != 0;
@@ -806,9 +806,9 @@ shift_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int start, in
{
int min_y, max_y;
- xassert (start <= end);
- xassert (start >= 0 && start < matrix->nrows);
- xassert (end >= 0 && end <= matrix->nrows);
+ eassert (start <= end);
+ eassert (start >= 0 && start < matrix->nrows);
+ eassert (end >= 0 && end <= matrix->nrows);
min_y = WINDOW_HEADER_LINE_HEIGHT (w);
max_y = WINDOW_BOX_HEIGHT_NO_MODE_LINE (w);
@@ -852,7 +852,7 @@ clear_current_matrices (register struct frame *f)
clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
/* Clear current window matrices. */
- xassert (WINDOWP (FRAME_ROOT_WINDOW (f)));
+ eassert (WINDOWP (FRAME_ROOT_WINDOW (f)));
clear_window_matrices (XWINDOW (FRAME_ROOT_WINDOW (f)), 0);
}
@@ -872,7 +872,7 @@ clear_desired_matrices (register struct frame *f)
clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix);
/* Do it for window matrices. */
- xassert (WINDOWP (FRAME_ROOT_WINDOW (f)));
+ eassert (WINDOWP (FRAME_ROOT_WINDOW (f)));
clear_window_matrices (XWINDOW (FRAME_ROOT_WINDOW (f)), 1);
}
@@ -887,12 +887,12 @@ clear_window_matrices (struct window *w, int desired_p)
{
if (!NILP (w->hchild))
{
- xassert (WINDOWP (w->hchild));
+ eassert (WINDOWP (w->hchild));
clear_window_matrices (XWINDOW (w->hchild), desired_p);
}
else if (!NILP (w->vchild))
{
- xassert (WINDOWP (w->vchild));
+ eassert (WINDOWP (w->vchild));
clear_window_matrices (XWINDOW (w->vchild), desired_p);
}
else
@@ -1163,7 +1163,7 @@ find_glyph_row_slice (struct glyph_matrix *window_matrix,
{
int i;
- xassert (row >= 0 && row < frame_matrix->nrows);
+ eassert (row >= 0 && row < frame_matrix->nrows);
for (i = 0; i < window_matrix->nrows; ++i)
if (glyph_row_slice_p (window_matrix->rows + i,
@@ -1291,8 +1291,8 @@ line_draw_cost (struct glyph_matrix *matrix, int vpos)
static inline int
row_equal_p (struct glyph_row *a, struct glyph_row *b, int mouse_face_p)
{
- xassert (verify_row_hash (a));
- xassert (verify_row_hash (b));
+ eassert (verify_row_hash (a));
+ eassert (verify_row_hash (b));
if (a == b)
return 1;
@@ -1394,7 +1394,7 @@ free_glyph_pool (struct glyph_pool *pool)
{
/* More freed than allocated? */
--glyph_pool_count;
- xassert (glyph_pool_count >= 0);
+ eassert (glyph_pool_count >= 0);
xfree (pool->glyphs);
xfree (pool);
@@ -1480,7 +1480,7 @@ check_matrix_pointer_lossage (struct glyph_matrix *matrix)
for (i = 0; i < matrix->nrows; ++i)
for (j = 0; j < matrix->nrows; ++j)
- xassert (i == j
+ eassert (i == j
|| (matrix->rows[i].glyphs[TEXT_AREA]
!= matrix->rows[j].glyphs[TEXT_AREA]));
}
@@ -1491,8 +1491,8 @@ check_matrix_pointer_lossage (struct glyph_matrix *matrix)
struct glyph_row *
matrix_row (struct glyph_matrix *matrix, int row)
{
- xassert (matrix && matrix->rows);
- xassert (row >= 0 && row < matrix->nrows);
+ eassert (matrix && matrix->rows);
+ eassert (row >= 0 && row < matrix->nrows);
/* That's really too slow for normal testing because this function
is called almost everywhere. Although---it's still astonishingly
@@ -1539,9 +1539,9 @@ check_matrix_invariants (struct window *w)
last_text_row = row;
/* Check that character and byte positions are in sync. */
- xassert (MATRIX_ROW_START_BYTEPOS (row)
+ eassert (MATRIX_ROW_START_BYTEPOS (row)
== CHAR_TO_BYTE (MATRIX_ROW_START_CHARPOS (row)));
- xassert (BYTEPOS (row->start.pos)
+ eassert (BYTEPOS (row->start.pos)
== CHAR_TO_BYTE (CHARPOS (row->start.pos)));
/* CHAR_TO_BYTE aborts when invoked for a position > Z. We can
@@ -1549,9 +1549,9 @@ check_matrix_invariants (struct window *w)
displaying something like `[Sole completion]' at its end. */
if (MATRIX_ROW_END_CHARPOS (row) < BUF_ZV (current_buffer))
{
- xassert (MATRIX_ROW_END_BYTEPOS (row)
+ eassert (MATRIX_ROW_END_BYTEPOS (row)
== CHAR_TO_BYTE (MATRIX_ROW_END_CHARPOS (row)));
- xassert (BYTEPOS (row->end.pos)
+ eassert (BYTEPOS (row->end.pos)
== CHAR_TO_BYTE (CHARPOS (row->end.pos)));
}
@@ -1559,18 +1559,18 @@ check_matrix_invariants (struct window *w)
of next row. */
if (next->enabled_p && MATRIX_ROW_DISPLAYS_TEXT_P (next))
{
- xassert (MATRIX_ROW_END_CHARPOS (row)
+ eassert (MATRIX_ROW_END_CHARPOS (row)
== MATRIX_ROW_START_CHARPOS (next));
- xassert (MATRIX_ROW_END_BYTEPOS (row)
+ eassert (MATRIX_ROW_END_BYTEPOS (row)
== MATRIX_ROW_START_BYTEPOS (next));
- xassert (CHARPOS (row->end.pos) == CHARPOS (next->start.pos));
- xassert (BYTEPOS (row->end.pos) == BYTEPOS (next->start.pos));
+ eassert (CHARPOS (row->end.pos) == CHARPOS (next->start.pos));
+ eassert (BYTEPOS (row->end.pos) == BYTEPOS (next->start.pos));
}
row = next;
}
- xassert (w->current_matrix->nrows == w->desired_matrix->nrows);
- xassert (w->desired_matrix->rows != NULL);
+ eassert (w->current_matrix->nrows == w->desired_matrix->nrows);
+ eassert (w->desired_matrix->rows != NULL);
set_buffer_temp (saved);
}
@@ -1997,15 +1997,15 @@ fake_current_matrices (Lisp_Object window)
struct glyph_matrix *m = w->current_matrix;
struct glyph_matrix *fm = f->current_matrix;
- xassert (m->matrix_h == WINDOW_TOTAL_LINES (w));
- xassert (m->matrix_w == WINDOW_TOTAL_COLS (w));
+ eassert (m->matrix_h == WINDOW_TOTAL_LINES (w));
+ eassert (m->matrix_w == WINDOW_TOTAL_COLS (w));
for (i = 0; i < m->matrix_h; ++i)
{
struct glyph_row *r = m->rows + i;
struct glyph_row *fr = fm->rows + i + WINDOW_TOP_EDGE_LINE (w);
- xassert (r->glyphs[TEXT_AREA] >= fr->glyphs[TEXT_AREA]
+ eassert (r->glyphs[TEXT_AREA] >= fr->glyphs[TEXT_AREA]
&& r->glyphs[LAST_AREA] <= fr->glyphs[LAST_AREA]);
r->enabled_p = fr->enabled_p;
@@ -2140,7 +2140,7 @@ adjust_frame_glyphs_for_frame_redisplay (struct frame *f)
/* Size of frame matrices must equal size of frame. Note
that we are called for X frames with window widths NOT equal
to the frame width (from CHANGE_FRAME_SIZE_1). */
- xassert (matrix_dim.width == FRAME_COLS (f)
+ eassert (matrix_dim.width == FRAME_COLS (f)
&& matrix_dim.height == FRAME_LINES (f));
/* Pointers to glyph memory in glyph rows are exchanged during
@@ -2184,7 +2184,7 @@ adjust_frame_glyphs_for_frame_redisplay (struct frame *f)
static void
adjust_frame_glyphs_for_window_redisplay (struct frame *f)
{
- xassert (FRAME_WINDOW_P (f) && FRAME_LIVE_P (f));
+ eassert (FRAME_WINDOW_P (f) && FRAME_LIVE_P (f));
/* Allocate/reallocate window matrices. */
allocate_matrices_for_window_redisplay (XWINDOW (FRAME_ROOT_WINDOW (f)));
@@ -2469,7 +2469,7 @@ build_frame_matrix (struct frame *f)
int i;
/* F must have a frame matrix when this function is called. */
- xassert (!FRAME_WINDOW_P (f));
+ eassert (!FRAME_WINDOW_P (f));
/* Clear all rows in the frame matrix covered by window matrices.
Menu bar lines are not covered by windows. */
@@ -2585,7 +2585,7 @@ build_frame_matrix_from_leaf_window (struct glyph_matrix *frame_matrix, struct w
}
else
{
- xassert (window_row->enabled_p);
+ eassert (window_row->enabled_p);
/* Only when a desired row has been displayed, we want
the corresponding frame row to be updated. */
@@ -2602,7 +2602,7 @@ build_frame_matrix_from_leaf_window (struct glyph_matrix *frame_matrix, struct w
#if GLYPH_DEBUG
/* Window row window_y must be a slice of frame row
frame_y. */
- xassert (glyph_row_slice_p (window_row, frame_row));
+ eassert (glyph_row_slice_p (window_row, frame_row));
/* If rows are in sync, we don't have to copy glyphs because
frame and window share glyphs. */
@@ -2829,8 +2829,8 @@ mirrored_line_dance (struct glyph_matrix *matrix, int unchanged_at_top, int nlin
{
int enabled_before_p = new_rows[i].enabled_p;
- xassert (i + unchanged_at_top < matrix->nrows);
- xassert (unchanged_at_top + copy_from[i] < matrix->nrows);
+ eassert (i + unchanged_at_top < matrix->nrows);
+ eassert (unchanged_at_top + copy_from[i] < matrix->nrows);
new_rows[i] = old_rows[copy_from[i]];
new_rows[i].enabled_p = enabled_before_p;
@@ -2857,8 +2857,8 @@ sync_window_with_frame_matrix_rows (struct window *w)
int left, right, x, width;
/* Preconditions: W must be a leaf window on a tty frame. */
- xassert (NILP (w->hchild) && NILP (w->vchild));
- xassert (!FRAME_WINDOW_P (f));
+ eassert (NILP (w->hchild) && NILP (w->vchild));
+ eassert (!FRAME_WINDOW_P (f));
left = margin_glyphs_to_reserve (w, 1, w->left_margin_cols);
right = margin_glyphs_to_reserve (w, 1, w->right_margin_cols);
@@ -3098,10 +3098,10 @@ check_matrix_pointers (struct glyph_matrix *window_matrix,
static int
window_to_frame_vpos (struct window *w, int vpos)
{
- xassert (!FRAME_WINDOW_P (XFRAME (w->frame)));
- xassert (vpos >= 0 && vpos <= w->desired_matrix->nrows);
+ eassert (!FRAME_WINDOW_P (XFRAME (w->frame)));
+ eassert (vpos >= 0 && vpos <= w->desired_matrix->nrows);
vpos += WINDOW_TOP_EDGE_LINE (w);
- xassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (w->frame)));
+ eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (w->frame)));
return vpos;
}
@@ -3112,7 +3112,7 @@ window_to_frame_vpos (struct window *w, int vpos)
static int
window_to_frame_hpos (struct window *w, int hpos)
{
- xassert (!FRAME_WINDOW_P (XFRAME (w->frame)));
+ eassert (!FRAME_WINDOW_P (XFRAME (w->frame)));
hpos += WINDOW_LEFT_EDGE_COL (w);
return hpos;
}
@@ -3531,7 +3531,7 @@ update_window (struct window *w, int force_p)
struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
#if GLYPH_DEBUG
/* Check that W's frame doesn't have glyph matrices. */
- xassert (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w))));
+ eassert (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w))));
#endif
/* Check pending input the first time so that we can quickly return. */
@@ -3930,7 +3930,7 @@ update_text_area (struct window *w, int vpos)
has to be cleared, if and only if we did a write_glyphs
above. This is made sure by setting desired_stop_pos
appropriately above. */
- xassert (i < desired_row->used[TEXT_AREA]
+ eassert (i < desired_row->used[TEXT_AREA]
|| ((desired_row->used[TEXT_AREA]
== current_row->used[TEXT_AREA])
&& MATRIX_ROW_EXTENDS_FACE_P (current_row)));
@@ -4000,7 +4000,7 @@ update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p)
if (desired_row->mode_line_p
|| desired_row->visible_height > 0)
{
- xassert (desired_row->enabled_p);
+ eassert (desired_row->enabled_p);
/* Update display of the left margin area, if there is one. */
if (!desired_row->full_width_p
@@ -4058,7 +4058,7 @@ set_window_cursor_after_update (struct window *w)
int cx, cy, vpos, hpos;
/* Not intended for frame matrix updates. */
- xassert (FRAME_WINDOW_P (f));
+ eassert (FRAME_WINDOW_P (f));
if (cursor_in_echo_area
&& !NILP (echo_area_buffer[0])
@@ -4218,7 +4218,7 @@ add_row_entry (struct glyph_row *row)
ptrdiff_t i = row->hash % row_table_size;
entry = row_table[i];
- xassert (entry || verify_row_hash (row));
+ eassert (entry || verify_row_hash (row));
while (entry && !row_equal_p (entry->row, row, 1))
entry = entry->next;
@@ -4432,7 +4432,7 @@ scrolling_window (struct window *w, int header_line_p)
for (i = first_new; i < last_new; ++i)
{
- xassert (MATRIX_ROW_ENABLED_P (desired_matrix, i));
+ eassert (MATRIX_ROW_ENABLED_P (desired_matrix, i));
entry = add_row_entry (MATRIX_ROW (desired_matrix, i));
++entry->new_uses;
entry->new_line_number = i;
@@ -4612,7 +4612,7 @@ scrolling_window (struct window *w, int header_line_p)
row. But thanks to the truncation code in the
preceding for-loop, we no longer have such an overlap,
and thus the assigned row should always be enabled. */
- xassert (to->enabled_p);
+ eassert (to->enabled_p);
from->enabled_p = 0;
to->overlapped_p = to_overlapped_p;
}
@@ -4650,7 +4650,7 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p)
int pause_p;
int preempt_count = baud_rate / 2400 + 1;
- xassert (current_matrix && desired_matrix);
+ eassert (current_matrix && desired_matrix);
if (baud_rate != FRAME_COST_BAUD_RATE (f))
calculate_costs (f);
diff --git a/src/fns.c b/src/fns.c
index f734520fedb..2c6e75e60c5 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3434,8 +3434,8 @@ larger_vector (Lisp_Object vec, ptrdiff_t incr_min, ptrdiff_t nitems_max)
ptrdiff_t C_language_max = min (PTRDIFF_MAX, SIZE_MAX) / sizeof *v->contents;
ptrdiff_t n_max = (0 <= nitems_max && nitems_max < C_language_max
? nitems_max : C_language_max);
- xassert (VECTORP (vec));
- xassert (0 < incr_min && -1 <= nitems_max);
+ eassert (VECTORP (vec));
+ eassert (0 < incr_min && -1 <= nitems_max);
old_size = ASIZE (vec);
incr_max = n_max - old_size;
incr = max (incr_min, min (old_size >> 1, incr_max));
@@ -3514,7 +3514,7 @@ static EMACS_UINT
hashfn_eq (struct Lisp_Hash_Table *h, Lisp_Object key)
{
EMACS_UINT hash = XUINT (key) ^ XTYPE (key);
- xassert ((hash & ~INTMASK) == 0);
+ eassert ((hash & ~INTMASK) == 0);
return hash;
}
@@ -3531,7 +3531,7 @@ hashfn_eql (struct Lisp_Hash_Table *h, Lisp_Object key)
hash = sxhash (key, 0);
else
hash = XUINT (key) ^ XTYPE (key);
- xassert ((hash & ~INTMASK) == 0);
+ eassert ((hash & ~INTMASK) == 0);
return hash;
}
@@ -3544,7 +3544,7 @@ static EMACS_UINT
hashfn_equal (struct Lisp_Hash_Table *h, Lisp_Object key)
{
EMACS_UINT hash = sxhash (key, 0);
- xassert ((hash & ~INTMASK) == 0);
+ eassert ((hash & ~INTMASK) == 0);
return hash;
}
@@ -3605,11 +3605,11 @@ make_hash_table (Lisp_Object test, Lisp_Object size, Lisp_Object rehash_size,
double index_float;
/* Preconditions. */
- xassert (SYMBOLP (test));
- xassert (INTEGERP (size) && XINT (size) >= 0);
- xassert ((INTEGERP (rehash_size) && XINT (rehash_size) > 0)
+ eassert (SYMBOLP (test));
+ eassert (INTEGERP (size) && XINT (size) >= 0);
+ eassert ((INTEGERP (rehash_size) && XINT (rehash_size) > 0)
|| (FLOATP (rehash_size) && 1 < XFLOAT_DATA (rehash_size)));
- xassert (FLOATP (rehash_threshold)
+ eassert (FLOATP (rehash_threshold)
&& 0 < XFLOAT_DATA (rehash_threshold)
&& XFLOAT_DATA (rehash_threshold) <= 1.0);
@@ -3667,8 +3667,8 @@ make_hash_table (Lisp_Object test, Lisp_Object size, Lisp_Object rehash_size,
h->next_free = make_number (0);
XSET_HASH_TABLE (table, h);
- xassert (HASH_TABLE_P (table));
- xassert (XHASH_TABLE (table) == h);
+ eassert (HASH_TABLE_P (table));
+ eassert (XHASH_TABLE (table) == h);
/* Maybe add this hash table to the list of all weak hash tables. */
if (NILP (h->weak))
@@ -3843,7 +3843,7 @@ hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value,
{
ptrdiff_t start_of_bucket, i;
- xassert ((hash & ~INTMASK) == 0);
+ eassert ((hash & ~INTMASK) == 0);
/* Increment count after resizing because resizing may fail. */
maybe_resize_hash_table (h);
@@ -3902,7 +3902,7 @@ hash_remove_from_table (struct Lisp_Hash_Table *h, Lisp_Object key)
HASH_NEXT (h, i) = h->next_free;
h->next_free = make_number (i);
h->count--;
- xassert (h->count >= 0);
+ eassert (h->count >= 0);
break;
}
else
diff --git a/src/fontset.c b/src/fontset.c
index 1d704a5900e..98ee89070f9 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -24,8 +24,6 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* #define FONTSET_DEBUG */
-
#include <config.h>
#include <stdio.h>
#include <setjmp.h>
@@ -55,13 +53,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "font.h"
-#undef xassert
-#ifdef FONTSET_DEBUG
-#define xassert(X) do {if (!(X)) abort ();} while (0)
-#else /* not FONTSET_DEBUG */
-#define xassert(X) (void) 0
-#endif /* not FONTSET_DEBUG */
-
/* FONTSET
A fontset is a collection of font related information to give
@@ -206,7 +197,7 @@ static void accumulate_script_ranges (Lisp_Object, Lisp_Object,
Lisp_Object);
static void set_fontset_font (Lisp_Object, Lisp_Object);
-#ifdef FONTSET_DEBUG
+#ifdef ENABLE_CHECKING
/* Return 1 if ID is a valid fontset id, else return 0. */
@@ -459,7 +450,7 @@ fontset_get_font_group (Lisp_Object fontset, int c)
Lisp_Object base_fontset;
int from = 0, to = MAX_CHAR, i;
- xassert (! BASE_FONTSET_P (fontset));
+ eassert (! BASE_FONTSET_P (fontset));
if (c >= 0)
font_group = CHAR_TABLE_REF (fontset, c);
else
@@ -848,7 +839,7 @@ free_realized_fontset (FRAME_PTR f, Lisp_Object fontset)
if (0)
for (tail = FONTSET_OBJLIST (fontset); CONSP (tail); tail = XCDR (tail))
{
- xassert (FONT_OBJECT_P (XCAR (tail)));
+ eassert (FONT_OBJECT_P (XCAR (tail)));
font_close_object (f, XCAR (tail));
}
#endif
@@ -865,8 +856,8 @@ free_face_fontset (FRAME_PTR f, struct face *face)
fontset = FONTSET_FROM_ID (face->fontset);
if (NILP (fontset))
return;
- xassert (! BASE_FONTSET_P (fontset));
- xassert (f == XFRAME (FONTSET_FRAME (fontset)));
+ eassert (! BASE_FONTSET_P (fontset));
+ eassert (f == XFRAME (FONTSET_FRAME (fontset)));
free_realized_fontset (f, fontset);
ASET (Vfontset_table, face->fontset, Qnil);
if (face->fontset < next_fontset_id)
@@ -876,8 +867,8 @@ free_face_fontset (FRAME_PTR f, struct face *face)
int id = XINT (FONTSET_ID (FONTSET_DEFAULT (fontset)));
fontset = AREF (Vfontset_table, id);
- xassert (!NILP (fontset) && ! BASE_FONTSET_P (fontset));
- xassert (f == XFRAME (FONTSET_FRAME (fontset)));
+ eassert (!NILP (fontset) && ! BASE_FONTSET_P (fontset));
+ eassert (f == XFRAME (FONTSET_FRAME (fontset)));
free_realized_fontset (f, fontset);
ASET (Vfontset_table, id, Qnil);
if (id < next_fontset_id)
@@ -924,9 +915,9 @@ face_for_char (FRAME_PTR f, struct face *face, int c, int pos, Lisp_Object objec
if (ASCII_CHAR_P (c) || face->fontset < 0)
return face->ascii_face->id;
- xassert (fontset_id_valid_p (face->fontset));
+ eassert (fontset_id_valid_p (face->fontset));
fontset = FONTSET_FROM_ID (face->fontset);
- xassert (!BASE_FONTSET_P (fontset));
+ eassert (!BASE_FONTSET_P (fontset));
if (pos < 0)
{
@@ -973,7 +964,7 @@ face_for_char (FRAME_PTR f, struct face *face, int c, int pos, Lisp_Object objec
FONTSET_NOFONT_FACE (fontset) = make_number (face_id);
}
}
- xassert (face_id >= 0);
+ eassert (face_id >= 0);
return face_id;
}
@@ -992,9 +983,9 @@ font_for_char (struct face *face, int c, int pos, Lisp_Object object)
return font_object;
}
- xassert (fontset_id_valid_p (face->fontset));
+ eassert (fontset_id_valid_p (face->fontset));
fontset = FONTSET_FROM_ID (face->fontset);
- xassert (!BASE_FONTSET_P (fontset));
+ eassert (!BASE_FONTSET_P (fontset));
if (pos < 0)
{
id = -1;
@@ -2104,7 +2095,7 @@ DEFUN ("fontset-list", Ffontset_list, Sfontset_list, 0, 0, 0,
}
-#ifdef FONTSET_DEBUG
+#ifdef ENABLE_CHECKING
Lisp_Object dump_fontset (Lisp_Object) EXTERNALLY_VISIBLE;
@@ -2154,7 +2145,7 @@ DEFUN ("fontset-list-all", Ffontset_list_all, Sfontset_list_all, 0, 0, 0,
val = Fcons (dump_fontset (AREF (Vfontset_table, i)), val);
return (Fnreverse (val));
}
-#endif /* FONTSET_DEBUG */
+#endif /* ENABLE_CHECKING */
void
syms_of_fontset (void)
@@ -2245,7 +2236,7 @@ at the vertical center of lines. */);
defsubr (&Sfontset_info);
defsubr (&Sfontset_font);
defsubr (&Sfontset_list);
-#ifdef FONTSET_DEBUG
+#ifdef ENABLE_CHECKING
defsubr (&Sfontset_list_all);
#endif
}
diff --git a/src/fringe.c b/src/fringe.c
index 0224ea73e3e..72090dd01ca 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -849,7 +849,7 @@ draw_fringe_bitmap (struct window *w, struct glyph_row *row, int left_p)
void
draw_row_fringe_bitmaps (struct window *w, struct glyph_row *row)
{
- xassert (interrupt_input_blocked);
+ eassert (interrupt_input_blocked);
/* If row is completely invisible, because of vscrolling, we
don't have to draw anything. */
diff --git a/src/ftfont.c b/src/ftfont.c
index bfce7425af4..29732e4c870 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -372,7 +372,7 @@ ftfont_lookup_cache (Lisp_Object key, enum ftfont_cache_for cache_for)
{
entity = key;
val = assq_no_quit (QCfont_entity, AREF (entity, FONT_EXTRA_INDEX));
- xassert (CONSP (val));
+ eassert (CONSP (val));
key = XCDR (val);
}
else
@@ -1325,7 +1325,7 @@ ftfont_close (FRAME_PTR f, struct font *font)
val = Fcons (font->props[FONT_FILE_INDEX], make_number (ftfont_info->index));
cache = ftfont_lookup_cache (val, FTFONT_CACHE_FOR_FACE);
- xassert (CONSP (cache));
+ eassert (CONSP (cache));
val = XCDR (cache);
(XSAVE_VALUE (val)->integer)--;
if (XSAVE_VALUE (val)->integer == 0)
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 6105d139d0e..57453b29648 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -4555,7 +4555,7 @@ update_frame_tool_bar (FRAME_PTR f)
? TOOL_BAR_IMAGE_DISABLED_SELECTED
: TOOL_BAR_IMAGE_DISABLED_DESELECTED);
- xassert (ASIZE (image) >= idx);
+ eassert (ASIZE (image) >= idx);
image = AREF (image, idx);
}
else
diff --git a/src/image.c b/src/image.c
index cc0ddbb77e4..63bac9a8a79 100644
--- a/src/image.c
+++ b/src/image.c
@@ -522,7 +522,7 @@ x_create_bitmap_mask (struct frame *f, ptrdiff_t id)
}
}
- xassert (interrupt_input_blocked);
+ eassert (interrupt_input_blocked);
gc = XCreateGC (FRAME_X_DISPLAY (f), mask, 0, NULL);
XPutImage (FRAME_X_DISPLAY (f), mask, gc, mask_img, 0, 0, 0, 0,
width, height);
@@ -874,7 +874,7 @@ image_spec_value (Lisp_Object spec, Lisp_Object key, int *found)
{
Lisp_Object tail;
- xassert (valid_image_p (spec));
+ eassert (valid_image_p (spec));
for (tail = XCDR (spec);
CONSP (tail) && CONSP (XCDR (tail));
@@ -986,11 +986,11 @@ make_image (Lisp_Object spec, EMACS_UINT hash)
struct image *img = (struct image *) xmalloc (sizeof *img);
Lisp_Object file = image_spec_value (spec, QCfile, NULL);
- xassert (valid_image_p (spec));
+ eassert (valid_image_p (spec));
memset (img, 0, sizeof *img);
img->dependencies = NILP (file) ? Qnil : list1 (file);
img->type = lookup_image_type (image_spec_value (spec, QCtype, NULL));
- xassert (img->type != NULL);
+ eassert (img->type != NULL);
img->spec = spec;
img->lisp_data = Qnil;
img->ascent = DEFAULT_IMAGE_ASCENT;
@@ -1349,7 +1349,7 @@ x_alloc_image_color (struct frame *f, struct image *img, Lisp_Object color_name,
XColor color;
unsigned long result;
- xassert (STRINGP (color_name));
+ eassert (STRINGP (color_name));
if (x_defined_color (f, SSDATA (color_name), &color, 1)
&& img->ncolors < min (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *img->colors,
@@ -1461,7 +1461,7 @@ free_image_cache (struct frame *f)
ptrdiff_t i;
/* Cache should not be referenced by any frame when freed. */
- xassert (c->refcount == 0);
+ eassert (c->refcount == 0);
for (i = 0; i < c->used; ++i)
free_image (f, c->images[i]);
@@ -1708,8 +1708,8 @@ lookup_image (struct frame *f, Lisp_Object spec)
/* F must be a window-system frame, and SPEC must be a valid image
specification. */
- xassert (FRAME_WINDOW_P (f));
- xassert (valid_image_p (spec));
+ eassert (FRAME_WINDOW_P (f));
+ eassert (valid_image_p (spec));
/* Look up SPEC in the hash table of the image cache. */
hash = sxhash (spec, 0);
@@ -1947,7 +1947,7 @@ x_create_x_image_and_pixmap (struct frame *f, int width, int height, int depth,
Window window = FRAME_X_WINDOW (f);
Screen *screen = FRAME_X_SCREEN (f);
- xassert (interrupt_input_blocked);
+ eassert (interrupt_input_blocked);
if (depth <= 0)
depth = DefaultDepthOfScreen (screen);
@@ -2085,7 +2085,7 @@ x_create_x_image_and_pixmap (struct frame *f, int width, int height, int depth,
static void
x_destroy_x_image (XImagePtr ximg)
{
- xassert (interrupt_input_blocked);
+ eassert (interrupt_input_blocked);
if (ximg)
{
#ifdef HAVE_X_WINDOWS
@@ -2114,7 +2114,7 @@ x_put_x_image (struct frame *f, XImagePtr ximg, Pixmap pixmap, int width, int he
#ifdef HAVE_X_WINDOWS
GC gc;
- xassert (interrupt_input_blocked);
+ eassert (interrupt_input_blocked);
gc = XCreateGC (FRAME_X_DISPLAY (f), pixmap, 0, NULL);
XPutImage (FRAME_X_DISPLAY (f), pixmap, gc, ximg, 0, 0, 0, 0, width, height);
XFreeGC (FRAME_X_DISPLAY (f), gc);
@@ -2129,7 +2129,7 @@ x_put_x_image (struct frame *f, XImagePtr ximg, Pixmap pixmap, int width, int he
#endif /* HAVE_NTGUI */
#ifdef HAVE_NS
- xassert (ximg == pixmap);
+ eassert (ximg == pixmap);
ns_retain_object (ximg);
#endif
}
@@ -2319,7 +2319,7 @@ xbm_image_p (Lisp_Object object)
if (!parse_image_spec (object, kw, XBM_LAST, Qxbm))
return 0;
- xassert (EQ (kw[XBM_TYPE].value, Qxbm));
+ eassert (EQ (kw[XBM_TYPE].value, Qxbm));
if (kw[XBM_FILE].count)
{
@@ -2780,7 +2780,7 @@ xbm_load_image (struct frame *f, struct image *img, unsigned char *contents,
int non_default_colors = 0;
Lisp_Object value;
- xassert (img->width > 0 && img->height > 0);
+ eassert (img->width > 0 && img->height > 0);
/* Get foreground and background colors, maybe allocate colors. */
value = image_spec_value (img->spec, QCforeground, NULL);
@@ -2840,7 +2840,7 @@ xbm_load (struct frame *f, struct image *img)
int success_p = 0;
Lisp_Object file_name;
- xassert (xbm_image_p (img->spec));
+ eassert (xbm_image_p (img->spec));
/* If IMG->spec specifies a file name, create a non-file spec from it. */
file_name = image_spec_value (img->spec, QCfile, NULL);
@@ -2886,14 +2886,14 @@ xbm_load (struct frame *f, struct image *img)
memcpy (fmt, xbm_format, sizeof fmt);
parsed_p = parse_image_spec (img->spec, fmt, XBM_LAST, Qxbm);
(void) parsed_p;
- xassert (parsed_p);
+ eassert (parsed_p);
/* Get specified width, and height. */
if (!in_memory_file_p)
{
img->width = XFASTINT (fmt[XBM_WIDTH].value);
img->height = XFASTINT (fmt[XBM_HEIGHT].value);
- xassert (img->width > 0 && img->height > 0);
+ eassert (img->width > 0 && img->height > 0);
if (!check_image_size (f, img->width, img->height))
{
image_error ("Invalid image size (see `max-image-size')",
@@ -3580,7 +3580,7 @@ xpm_load (struct frame *f, struct image *img)
img->width = attrs.width;
img->height = attrs.height;
- xassert (img->width > 0 && img->height > 0);
+ eassert (img->width > 0 && img->height > 0);
/* The call to XpmFreeAttributes below frees attrs.alloc_pixels. */
#ifdef HAVE_NTGUI
@@ -5551,7 +5551,7 @@ init_png_functions (Lisp_Object libraries)
static _Noreturn void
my_png_error (png_struct *png_ptr, const char *msg)
{
- xassert (png_ptr != NULL);
+ eassert (png_ptr != NULL);
/* Avoid compiler warning about deprecated direct access to
png_ptr's fields in libpng versions 1.4.x. */
image_error ("PNG error: %s", build_string (msg), Qnil);
@@ -5562,7 +5562,7 @@ my_png_error (png_struct *png_ptr, const char *msg)
static void
my_png_warning (png_struct *png_ptr, const char *msg)
{
- xassert (png_ptr != NULL);
+ eassert (png_ptr != NULL);
image_error ("PNG warning: %s", build_string (msg), Qnil);
}
@@ -5832,7 +5832,7 @@ png_load (struct frame *f, struct image *img)
images with alpha channel, i.e. RGBA. If conversions above were
sufficient we should only have 3 or 4 channels here. */
channels = fn_png_get_channels (png_ptr, info_ptr);
- xassert (channels == 3 || channels == 4);
+ eassert (channels == 3 || channels == 4);
/* Number of bytes needed for one row of the image. */
row_bytes = fn_png_get_rowbytes (png_ptr, info_ptr);
@@ -8540,7 +8540,7 @@ gs_load (struct frame *f, struct image *img)
img->height = in_height;
/* Create the pixmap. */
- xassert (img->pixmap == NO_PIXMAP);
+ eassert (img->pixmap == NO_PIXMAP);
if (x_check_image_size (0, img->width, img->height))
{
@@ -8611,7 +8611,7 @@ x_kill_gs_process (Pixmap pixmap, struct frame *f)
/* Kill the GS process. We should have found PIXMAP in the image
cache and its image should contain a process object. */
img = c->images[i];
- xassert (PROCESSP (img->lisp_data));
+ eassert (PROCESSP (img->lisp_data));
Fkill_process (img->lisp_data, Qnil);
img->lisp_data = Qnil;
diff --git a/src/keyboard.c b/src/keyboard.c
index 3d128612028..c76e015a6f4 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1752,7 +1752,7 @@ adjust_point_for_property (ptrdiff_t last_pt, int modified)
&& (beg < PT /* && end > PT <- It's always the case. */
|| (beg <= PT && STRINGP (val) && SCHARS (val) == 0)))
{
- xassert (end > PT);
+ eassert (end > PT);
SET_PT (PT < last_pt
? (STRINGP (val) && SCHARS (val) == 0
? max (beg - 1, BEGV)
@@ -1834,7 +1834,7 @@ adjust_point_for_property (ptrdiff_t last_pt, int modified)
#if 0 /* This assertion isn't correct, because SET_PT may end up setting
the point to something other than its argument, due to
point-motion hooks, intangibility, etc. */
- xassert (PT == beg || PT == end);
+ eassert (PT == beg || PT == end);
#endif
/* Pretend the area doesn't exist if the buffer is not
diff --git a/src/menu.c b/src/menu.c
index e3677e62896..2cff60eae3c 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -129,7 +129,7 @@ discard_menu_items (void)
menu_items = Qnil;
menu_items_allocated = 0;
}
- xassert (NILP (menu_items_inuse));
+ eassert (NILP (menu_items_inuse));
}
#ifdef HAVE_NS
diff --git a/src/process.c b/src/process.c
index 1508e4b13fc..de7fc147975 100644
--- a/src/process.c
+++ b/src/process.c
@@ -353,7 +353,7 @@ static struct fd_callback_data
void
add_read_fd (int fd, fd_callback func, void *data)
{
- xassert (fd < MAXDESC);
+ eassert (fd < MAXDESC);
add_keyboard_wait_descriptor (fd);
fd_callback_info[fd].func = func;
@@ -366,7 +366,7 @@ add_read_fd (int fd, fd_callback func, void *data)
void
delete_read_fd (int fd)
{
- xassert (fd < MAXDESC);
+ eassert (fd < MAXDESC);
delete_keyboard_wait_descriptor (fd);
fd_callback_info[fd].condition &= ~FOR_READ;
@@ -383,7 +383,7 @@ delete_read_fd (int fd)
void
add_write_fd (int fd, fd_callback func, void *data)
{
- xassert (fd < MAXDESC);
+ eassert (fd < MAXDESC);
FD_SET (fd, &write_mask);
if (fd > max_input_desc)
max_input_desc = fd;
@@ -400,7 +400,7 @@ delete_write_fd (int fd)
{
int lim = max_input_desc;
- xassert (fd < MAXDESC);
+ eassert (fd < MAXDESC);
FD_CLR (fd, &write_mask);
fd_callback_info[fd].condition &= ~FOR_WRITE;
if (fd_callback_info[fd].condition == 0)
diff --git a/src/scroll.c b/src/scroll.c
index abc5c17400a..603e04575f6 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -270,7 +270,7 @@ do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix,
{ \
int ck; \
for (ck = 0; ck < window_size; ++ck) \
- xassert (copy_from[ck] == -1 \
+ eassert (copy_from[ck] == -1 \
|| (copy_from[ck] >= 0 && copy_from[ck] < window_size)); \
} \
while (0);
@@ -317,8 +317,8 @@ do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix,
{
/* Best thing done here is no insert or delete, i.e. a write. */
--i, --j;
- xassert (i >= 0 && i < window_size);
- xassert (j >= 0 && j < window_size);
+ eassert (i >= 0 && i < window_size);
+ eassert (j >= 0 && j < window_size);
copy_from[i] = j;
retained_p[j] = 1;
@@ -368,7 +368,7 @@ do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix,
}
for (k = 0; k < window_size; ++k)
- xassert (copy_from[k] >= 0 && copy_from[k] < window_size);
+ eassert (copy_from[k] >= 0 && copy_from[k] < window_size);
/* Perform the row swizzling. */
mirrored_line_dance (current_matrix, unchanged_at_top, window_size,
@@ -728,7 +728,7 @@ do_direct_scrolling (struct frame *frame, struct glyph_matrix *current_matrix,
place they belong. */
int n_to_write = p->writecount;
write_follows_p = 1;
- xassert (n_to_write > 0);
+ eassert (n_to_write > 0);
if (i > j)
{
diff --git a/src/sound.c b/src/sound.c
index 65e7af70c5d..66df195338f 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -733,7 +733,7 @@ vox_configure (struct sound_device *sd)
{
int val;
- xassert (sd->fd >= 0);
+ eassert (sd->fd >= 0);
/* On GNU/Linux, it seems that the device driver doesn't like to be
interrupted by a signal. Block the ones we know to cause
@@ -962,7 +962,7 @@ alsa_configure (struct sound_device *sd)
struct alsa_params *p = (struct alsa_params *) sd->data;
snd_pcm_uframes_t buffer_size;
- xassert (p->handle != 0);
+ eassert (p->handle != 0);
err = snd_pcm_hw_params_malloc (&p->hwparams);
if (err < 0)
diff --git a/src/term.c b/src/term.c
index 471bc19ab54..128aaca20dd 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1459,7 +1459,7 @@ append_glyph (struct it *it)
struct glyph *glyph, *end;
int i;
- xassert (it->glyph_row);
+ eassert (it->glyph_row);
glyph = (it->glyph_row->glyphs[it->area]
+ it->glyph_row->used[it->area]);
end = it->glyph_row->glyphs[1 + it->area];
@@ -1546,7 +1546,7 @@ produce_glyphs (struct it *it)
/* If a hook is installed, let it do the work. */
/* Nothing but characters are supported on terminal frames. */
- xassert (it->what == IT_CHARACTER
+ eassert (it->what == IT_CHARACTER
|| it->what == IT_COMPOSITION
|| it->what == IT_STRETCH
|| it->what == IT_GLYPHLESS);
@@ -1633,7 +1633,7 @@ produce_glyphs (struct it *it)
{
Lisp_Object acronym = lookup_glyphless_char_display (-1, it);
- xassert (it->what == IT_GLYPHLESS);
+ eassert (it->what == IT_GLYPHLESS);
produce_glyphless_glyph (it, 1, acronym);
}
}
@@ -1657,7 +1657,7 @@ append_composite_glyph (struct it *it)
{
struct glyph *glyph;
- xassert (it->glyph_row);
+ eassert (it->glyph_row);
glyph = it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area];
if (glyph < it->glyph_row->glyphs[1 + it->area])
{
@@ -1749,7 +1749,7 @@ append_glyphless_glyph (struct it *it, int face_id, const char *str)
struct glyph *glyph, *end;
int i;
- xassert (it->glyph_row);
+ eassert (it->glyph_row);
glyph = it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area];
end = it->glyph_row->glyphs[1 + it->area];
@@ -1871,7 +1871,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
}
else
{
- xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE);
+ eassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE);
len = (it->c < 0x10000 ? sprintf (buf, "\\u%04X", it->c)
: it->c <= MAX_UNICODE_CHAR ? sprintf (buf, "\\U%06X", it->c)
: sprintf (buf, "\\x%06X", it->c));
@@ -2067,7 +2067,7 @@ turn_off_face (struct frame *f, int face_id)
struct face *face = FACE_FROM_ID (f, face_id);
struct tty_display_info *tty = FRAME_TTY (f);
- xassert (face != NULL);
+ eassert (face != NULL);
if (tty->TS_exit_attribute_mode)
{
diff --git a/src/w32console.c b/src/w32console.c
index 22f329e239d..42d89cca6d7 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -616,7 +616,7 @@ w32_face_attributes (struct frame *f, int face_id)
WORD char_attr;
struct face *face = FACE_FROM_ID (f, face_id);
- xassert (face != NULL);
+ eassert (face != NULL);
char_attr = char_attr_normal;
diff --git a/src/w32fns.c b/src/w32fns.c
index 915114138d8..c00ed66dcbb 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4005,8 +4005,8 @@ unwind_create_frame (Lisp_Object frame)
#if GLYPH_DEBUG
/* Check that reference counts are indeed correct. */
- xassert (dpyinfo->reference_count == dpyinfo_refcount);
- xassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount);
+ eassert (dpyinfo->reference_count == dpyinfo_refcount);
+ eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount);
#endif
return Qt;
}
diff --git a/src/w32term.c b/src/w32term.c
index 4f4fa220a7b..f879e648054 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -742,7 +742,7 @@ x_after_update_window_line (struct glyph_row *desired_row)
struct frame *f;
int width, height;
- xassert (w);
+ eassert (w);
if (!desired_row->mode_line_p && !w->pseudo_window_p)
desired_row->redraw_fringe_bitmaps_p = 1;
@@ -1086,7 +1086,7 @@ x_set_mouse_face_gc (struct glyph_string *s)
s->gc = FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc;
}
- xassert (s->gc != 0);
+ eassert (s->gc != 0);
}
@@ -1143,7 +1143,7 @@ x_set_glyph_string_gc (struct glyph_string *s)
}
/* GC must have been set. */
- xassert (s->gc != 0);
+ eassert (s->gc != 0);
}
@@ -1560,7 +1560,7 @@ w32_alloc_lighter_color (struct frame *f, COLORREF *color,
delta /= 256;
/* Change RGB values by specified FACTOR. Avoid overflow! */
- xassert (factor >= 0);
+ eassert (factor >= 0);
new = PALETTERGB (min (0xff, factor * GetRValue (*color)),
min (0xff, factor * GetGValue (*color)),
min (0xff, factor * GetBValue (*color)));
@@ -2237,7 +2237,7 @@ x_draw_image_glyph_string (struct glyph_string *s)
static void
x_draw_stretch_glyph_string (struct glyph_string *s)
{
- xassert (s->first_glyph->type == STRETCH_GLYPH);
+ eassert (s->first_glyph->type == STRETCH_GLYPH);
if (s->hl == DRAW_CURSOR
&& !x_stretch_cursor_p)
@@ -6032,9 +6032,9 @@ x_wm_set_icon_position (struct frame *f, int icon_x, int icon_y)
static void
x_check_font (struct frame *f, struct font *font)
{
- xassert (font != NULL && ! NILP (font->props[FONT_TYPE_INDEX]));
+ eassert (font != NULL && ! NILP (font->props[FONT_TYPE_INDEX]));
if (font->driver->check)
- xassert (font->driver->check (f, font) == 0);
+ eassert (font->driver->check (f, font) == 0);
}
#endif /* GLYPH_DEBUG != 0 */
diff --git a/src/window.c b/src/window.c
index 05749c12bb9..f640a54b283 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2035,7 +2035,7 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf
candidate_p = 1;
else if (NILP (all_frames))
{
- xassert (WINDOWP (owindow));
+ eassert (WINDOWP (owindow));
candidate_p = EQ (w->frame, XWINDOW (owindow)->frame);
}
else if (EQ (all_frames, Qvisible))
@@ -4010,8 +4010,8 @@ grow_mini_window (struct window *w, int delta)
struct window *r;
Lisp_Object root, value;
- xassert (MINI_WINDOW_P (w));
- xassert (delta >= 0);
+ eassert (MINI_WINDOW_P (w));
+ eassert (delta >= 0);
root = FRAME_ROOT_WINDOW (f);
r = XWINDOW (root);
@@ -4043,7 +4043,7 @@ shrink_mini_window (struct window *w)
Lisp_Object root, value;
EMACS_INT size;
- xassert (MINI_WINDOW_P (w));
+ eassert (MINI_WINDOW_P (w));
size = XINT (w->total_lines);
if (size > 1)
@@ -4721,7 +4721,7 @@ scroll_command (Lisp_Object n, int direction)
{
ptrdiff_t count = SPECPDL_INDEX ();
- xassert (eabs (direction) == 1);
+ eassert (eabs (direction) == 1);
/* If selected window's buffer isn't current, make it current for
the moment. But don't screw up if window_scroll gets an error. */
@@ -5686,7 +5686,7 @@ the return value is nil. Otherwise the value is t. */)
if (NILP (leaf_windows[i]->buffer))
{
/* Assert it's not reused as a combination. */
- xassert (NILP (leaf_windows[i]->hchild)
+ eassert (NILP (leaf_windows[i]->hchild)
&& NILP (leaf_windows[i]->vchild));
free_window_matrices (leaf_windows[i]);
}
diff --git a/src/xdisp.c b/src/xdisp.c
index 23ecbb5d480..b03c455eb50 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1025,7 +1025,7 @@ window_box_height (struct window *w)
struct frame *f = XFRAME (w->frame);
int height = WINDOW_TOTAL_HEIGHT (w);
- xassert (height >= 0);
+ eassert (height >= 0);
/* Note: the code below that determines the mode-line/header-line
height is essentially the same as that contained in the macro
@@ -1511,7 +1511,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
--g;
top_x -= g->pixel_width;
}
- xassert (g < it3.glyph_row->glyphs[TEXT_AREA]
+ eassert (g < it3.glyph_row->glyphs[TEXT_AREA]
+ it3.glyph_row->used[TEXT_AREA]);
}
}
@@ -1606,7 +1606,7 @@ string_char_and_length (const unsigned char *str, int *len)
static struct text_pos
string_pos_nchars_ahead (struct text_pos pos, Lisp_Object string, ptrdiff_t nchars)
{
- xassert (STRINGP (string) && nchars >= 0);
+ eassert (STRINGP (string) && nchars >= 0);
if (STRING_MULTIBYTE (string))
{
@@ -1635,8 +1635,8 @@ static inline struct text_pos
string_pos (ptrdiff_t charpos, Lisp_Object string)
{
struct text_pos pos;
- xassert (STRINGP (string));
- xassert (charpos >= 0);
+ eassert (STRINGP (string));
+ eassert (charpos >= 0);
SET_TEXT_POS (pos, charpos, string_char_to_byte (string, charpos));
return pos;
}
@@ -1651,8 +1651,8 @@ c_string_pos (ptrdiff_t charpos, const char *s, int multibyte_p)
{
struct text_pos pos;
- xassert (s != NULL);
- xassert (charpos >= 0);
+ eassert (s != NULL);
+ eassert (charpos >= 0);
if (multibyte_p)
{
@@ -1708,8 +1708,8 @@ number_of_chars (const char *s, int multibyte_p)
static void
compute_string_pos (struct text_pos *newpos, struct text_pos pos, Lisp_Object string)
{
- xassert (STRINGP (string));
- xassert (CHARPOS (*newpos) >= CHARPOS (pos));
+ eassert (STRINGP (string));
+ eassert (CHARPOS (*newpos) >= CHARPOS (pos));
if (STRING_MULTIBYTE (string))
*newpos = string_pos_nchars_ahead (pos, string,
@@ -2467,23 +2467,23 @@ check_it (struct it *it)
{
if (it->method == GET_FROM_STRING)
{
- xassert (STRINGP (it->string));
- xassert (IT_STRING_CHARPOS (*it) >= 0);
+ eassert (STRINGP (it->string));
+ eassert (IT_STRING_CHARPOS (*it) >= 0);
}
else
{
- xassert (IT_STRING_CHARPOS (*it) < 0);
+ eassert (IT_STRING_CHARPOS (*it) < 0);
if (it->method == GET_FROM_BUFFER)
{
/* Check that character and byte positions agree. */
- xassert (IT_CHARPOS (*it) == BYTE_TO_CHAR (IT_BYTEPOS (*it)));
+ eassert (IT_CHARPOS (*it) == BYTE_TO_CHAR (IT_BYTEPOS (*it)));
}
}
if (it->dpvec)
- xassert (it->current.dpvec_index >= 0);
+ eassert (it->current.dpvec_index >= 0);
else
- xassert (it->current.dpvec_index < 0);
+ eassert (it->current.dpvec_index < 0);
}
#define CHECK_IT(IT) check_it ((IT))
@@ -2495,7 +2495,7 @@ check_it (struct it *it)
#endif /* not 0 */
-#if GLYPH_DEBUG && XASSERTS
+#if GLYPH_DEBUG && defined ENABLE_CHECKING
/* Check that the window end of window W is what we expect it
to be---the last row in the current matrix displaying text. */
@@ -2507,7 +2507,7 @@ check_window_end (struct window *w)
&& !NILP (w->window_end_valid))
{
struct glyph_row *row;
- xassert ((row = MATRIX_ROW (w->current_matrix,
+ eassert ((row = MATRIX_ROW (w->current_matrix,
XFASTINT (w->window_end_vpos)),
!row->enabled_p
|| MATRIX_ROW_DISPLAYS_TEXT_P (row)
@@ -2557,8 +2557,8 @@ init_iterator (struct it *it, struct window *w,
enum face_id remapped_base_face_id = base_face_id;
/* Some precondition checks. */
- xassert (w != NULL && it != NULL);
- xassert (charpos < 0 || (charpos >= BUF_BEG (current_buffer)
+ eassert (w != NULL && it != NULL);
+ eassert (charpos < 0 || (charpos >= BUF_BEG (current_buffer)
&& charpos <= ZV));
/* If face attributes have been changed since the last redisplay,
@@ -2719,14 +2719,14 @@ init_iterator (struct it *it, struct window *w,
if (it->line_wrap == TRUNCATE)
{
/* We will need the truncation glyph. */
- xassert (it->glyph_row == NULL);
+ eassert (it->glyph_row == NULL);
produce_special_glyphs (it, IT_TRUNCATION);
it->truncation_pixel_width = it->pixel_width;
}
else
{
/* We will need the continuation glyph. */
- xassert (it->glyph_row == NULL);
+ eassert (it->glyph_row == NULL);
produce_special_glyphs (it, IT_CONTINUATION);
it->continuation_pixel_width = it->pixel_width;
}
@@ -3056,7 +3056,7 @@ init_from_display_pos (struct it *it, struct window *w, struct display_pos *pos)
relative_index = (it->current.overlay_string_index
% OVERLAY_STRING_CHUNK_SIZE);
it->string = it->overlay_strings[relative_index];
- xassert (STRINGP (it->string));
+ eassert (STRINGP (it->string));
it->current.string_pos = pos->string_pos;
it->method = GET_FROM_STRING;
}
@@ -3067,7 +3067,7 @@ init_from_display_pos (struct it *it, struct window *w, struct display_pos *pos)
string. This can only be a string from a `display' property.
IT should already be filled with that string. */
it->current.string_pos = pos->string_pos;
- xassert (STRINGP (it->string));
+ eassert (STRINGP (it->string));
}
/* Restore position in display vector translations, control
@@ -3076,7 +3076,7 @@ init_from_display_pos (struct it *it, struct window *w, struct display_pos *pos)
{
if (it->dpvec == NULL)
get_next_display_element (it);
- xassert (it->dpvec && it->current.dpvec_index == 0);
+ eassert (it->dpvec && it->current.dpvec_index == 0);
it->current.dpvec_index = pos->dpvec_index;
}
@@ -3342,7 +3342,7 @@ compute_stop_pos (struct it *it)
stoppos, it->string);
}
- xassert (STRINGP (it->string)
+ eassert (STRINGP (it->string)
|| (it->stop_charpos >= BEGV
&& it->stop_charpos >= IT_CHARPOS (*it)));
}
@@ -3558,7 +3558,7 @@ handle_fontified_prop (struct it *it)
val = Vfontification_functions;
specbind (Qfontification_functions, Qnil);
- xassert (it->end_charpos == ZV);
+ eassert (it->end_charpos == ZV);
if (!CONSP (val) || EQ (XCAR (val), Qlambda))
safe_call1 (val, pos);
@@ -3790,7 +3790,7 @@ underlying_face_id (struct it *it)
{
int face_id = it->base_face_id, i;
- xassert (STRINGP (it->string));
+ eassert (STRINGP (it->string));
for (i = it->sp - 1; i >= 0; --i)
if (NILP (it->stack[i].string))
@@ -3813,7 +3813,7 @@ face_before_or_after_it_pos (struct it *it, int before_p)
struct it it_copy;
void *it_copy_data = NULL;
- xassert (it->s == NULL);
+ eassert (it->s == NULL);
if (STRINGP (it->string))
{
@@ -3879,7 +3879,7 @@ face_before_or_after_it_pos (struct it *it, int before_p)
charpos = it_copy.bidi_it.charpos;
}
}
- xassert (0 <= charpos && charpos <= SCHARS (it->string));
+ eassert (0 <= charpos && charpos <= SCHARS (it->string));
if (it->current.overlay_string_index >= 0)
bufpos = IT_CHARPOS (*it);
@@ -3979,7 +3979,7 @@ face_before_or_after_it_pos (struct it *it, int before_p)
it_copy.bidi_it.charpos, it_copy.bidi_it.bytepos);
}
}
- xassert (BEGV <= CHARPOS (pos) && CHARPOS (pos) <= ZV);
+ eassert (BEGV <= CHARPOS (pos) && CHARPOS (pos) <= ZV);
/* Determine face for CHARSET_ASCII, or unibyte. */
face_id = face_at_buffer_position (it->w,
@@ -5237,7 +5237,7 @@ next_overlay_string (struct it *it)
it->ellipsis_p = (it->stack[it->sp - 1].display_ellipsis_p != 0);
pop_it (it);
- xassert (it->sp > 0
+ eassert (it->sp > 0
|| (NILP (it->string)
&& it->method == GET_FROM_BUFFER
&& it->stop_charpos >= BEGV
@@ -5418,7 +5418,7 @@ load_overlay_strings (struct it *it, ptrdiff_t charpos)
for (ov = current_buffer->overlays_before; ov; ov = ov->next)
{
XSETMISC (overlay, ov);
- xassert (OVERLAYP (overlay));
+ eassert (OVERLAYP (overlay));
start = OVERLAY_POSITION (OVERLAY_START (overlay));
end = OVERLAY_POSITION (OVERLAY_END (overlay));
@@ -5458,7 +5458,7 @@ load_overlay_strings (struct it *it, ptrdiff_t charpos)
for (ov = current_buffer->overlays_after; ov; ov = ov->next)
{
XSETMISC (overlay, ov);
- xassert (OVERLAYP (overlay));
+ eassert (OVERLAYP (overlay));
start = OVERLAY_POSITION (OVERLAY_START (overlay));
end = OVERLAY_POSITION (OVERLAY_END (overlay));
@@ -5546,11 +5546,11 @@ get_overlay_strings_1 (struct it *it, ptrdiff_t charpos, int compute_stop_p)
strings. */
if (compute_stop_p)
compute_stop_pos (it);
- xassert (it->face_id >= 0);
+ eassert (it->face_id >= 0);
/* Save IT's settings. They are restored after all overlay
strings have been processed. */
- xassert (!compute_stop_p || it->sp == 0);
+ eassert (!compute_stop_p || it->sp == 0);
/* When called from handle_stop, there might be an empty display
string loaded. In that case, don't bother saving it. But
@@ -5570,7 +5570,7 @@ get_overlay_strings_1 (struct it *it, ptrdiff_t charpos, int compute_stop_p)
it->string = it->overlay_strings[0];
it->from_overlay = Qnil;
it->stop_charpos = 0;
- xassert (STRINGP (it->string));
+ eassert (STRINGP (it->string));
it->end_charpos = SCHARS (it->string);
it->prev_stop = 0;
it->base_level_stop = 0;
@@ -5636,14 +5636,14 @@ push_it (struct it *it, struct text_pos *position)
{
struct iterator_stack_entry *p;
- xassert (it->sp < IT_STACK_SIZE);
+ eassert (it->sp < IT_STACK_SIZE);
p = it->stack + it->sp;
p->stop_charpos = it->stop_charpos;
p->prev_stop = it->prev_stop;
p->base_level_stop = it->base_level_stop;
p->cmp_it = it->cmp_it;
- xassert (it->face_id >= 0);
+ eassert (it->face_id >= 0);
p->face_id = it->face_id;
p->string = it->string;
p->method = it->method;
@@ -5690,7 +5690,7 @@ iterate_out_of_display_property (struct it *it)
ptrdiff_t eob = (buffer_p ? ZV : it->end_charpos);
ptrdiff_t bob = (buffer_p ? BEGV : 0);
- xassert (eob >= CHARPOS (it->position) && CHARPOS (it->position) >= bob);
+ eassert (eob >= CHARPOS (it->position) && CHARPOS (it->position) >= bob);
/* Maybe initialize paragraph direction. If we are at the beginning
of a new paragraph, next_element_from_buffer may not have a
@@ -5729,7 +5729,7 @@ pop_it (struct it *it)
struct iterator_stack_entry *p;
int from_display_prop = it->from_disp_prop_p;
- xassert (it->sp > 0);
+ eassert (it->sp > 0);
--it->sp;
p = it->stack + it->sp;
it->stop_charpos = p->stop_charpos;
@@ -5799,7 +5799,7 @@ pop_it (struct it *it)
&& (it->method == GET_FROM_BUFFER || it->method == GET_FROM_STRING))
iterate_out_of_display_property (it);
- xassert ((BUFFERP (it->object)
+ eassert ((BUFFERP (it->object)
&& IT_CHARPOS (*it) == it->bidi_it.charpos
&& IT_BYTEPOS (*it) == it->bidi_it.bytepos)
|| (STRINGP (it->object)
@@ -5896,7 +5896,7 @@ forward_to_next_line_start (struct it *it, int *skipped_p,
ptrdiff_t limit = find_next_newline_no_quit (start, 1);
Lisp_Object pos;
- xassert (!STRINGP (it->string));
+ eassert (!STRINGP (it->string));
/* If there isn't any `display' property in sight, and no
overlays, we can just use the position of the newline in
@@ -6035,8 +6035,8 @@ back_to_previous_visible_line_start (struct it *it)
it->continuation_lines_width = 0;
- xassert (IT_CHARPOS (*it) >= BEGV);
- xassert (IT_CHARPOS (*it) == BEGV
+ eassert (IT_CHARPOS (*it) >= BEGV);
+ eassert (IT_CHARPOS (*it) == BEGV
|| FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n');
CHECK_IT (it);
}
@@ -6078,7 +6078,7 @@ reseat_at_next_visible_line_start (struct it *it, int on_newline_p)
&& indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it),
it->selective))
{
- xassert (IT_BYTEPOS (*it) == BEGV
+ eassert (IT_BYTEPOS (*it) == BEGV
|| FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n');
newline_found_p =
forward_to_next_line_start (it, &skipped_p, &bidi_it_prev);
@@ -6192,10 +6192,10 @@ static void
reseat_1 (struct it *it, struct text_pos pos, int set_stop_p)
{
/* Don't call this function when scanning a C string. */
- xassert (it->s == NULL);
+ eassert (it->s == NULL);
/* POS must be a reasonable value. */
- xassert (CHARPOS (pos) >= BEGV && CHARPOS (pos) <= ZV);
+ eassert (CHARPOS (pos) >= BEGV && CHARPOS (pos) <= ZV);
it->current.pos = it->position = pos;
it->end_charpos = ZV;
@@ -6268,7 +6268,7 @@ reseat_to_string (struct it *it, const char *s, Lisp_Object string,
memset (&it->current, 0, sizeof it->current);
it->current.overlay_string_index = -1;
it->current.dpvec_index = -1;
- xassert (charpos >= 0);
+ eassert (charpos >= 0);
/* If STRING is specified, use its multibyteness, otherwise use the
setting of MULTIBYTE, if specified. */
@@ -6285,7 +6285,7 @@ reseat_to_string (struct it *it, const char *s, Lisp_Object string,
if (s == NULL)
{
- xassert (STRINGP (string));
+ eassert (STRINGP (string));
it->string = string;
it->s = NULL;
it->end_charpos = it->string_nchars = SCHARS (string);
@@ -6528,7 +6528,7 @@ get_next_display_element (struct it *it)
if (! it->multibyte_p && ! ASCII_CHAR_P (c))
{
- xassert (SINGLE_BYTE_CHAR_P (c));
+ eassert (SINGLE_BYTE_CHAR_P (c));
if (unibyte_display_via_language_environment)
{
c = DECODE_CHAR (unibyte, c);
@@ -6981,7 +6981,7 @@ set_iterator_to_next (struct it *it, int reseat_p)
}
else
{
- xassert (it->len != 0);
+ eassert (it->len != 0);
if (!it->bidi_p)
{
@@ -7009,7 +7009,7 @@ set_iterator_to_next (struct it *it, int reseat_p)
IT_BYTEPOS (*it), stop, Qnil);
}
}
- xassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it)));
+ eassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it)));
}
break;
@@ -7081,7 +7081,7 @@ set_iterator_to_next (struct it *it, int reseat_p)
case GET_FROM_STRING:
/* Current display element is a character from a Lisp string. */
- xassert (it->s == NULL && STRINGP (it->string));
+ eassert (it->s == NULL && STRINGP (it->string));
/* Don't advance past string end. These conditions are true
when set_iterator_to_next is called at the end of
get_next_display_element, in which case the Lisp string is
@@ -7230,7 +7230,7 @@ set_iterator_to_next (struct it *it, int reseat_p)
/* The position etc with which we have to proceed are on
the stack. The position may be at the end of a string,
if the `display' property takes up the whole string. */
- xassert (it->sp > 0);
+ eassert (it->sp > 0);
pop_it (it);
if (it->method == GET_FROM_STRING)
goto consider_string_end;
@@ -7241,7 +7241,7 @@ set_iterator_to_next (struct it *it, int reseat_p)
abort ();
}
- xassert (it->method != GET_FROM_STRING
+ eassert (it->method != GET_FROM_STRING
|| (STRINGP (it->string)
&& IT_STRING_CHARPOS (*it) >= 0));
}
@@ -7261,7 +7261,7 @@ next_element_from_display_vector (struct it *it)
Lisp_Object gc;
/* Precondition. */
- xassert (it->dpvec && it->current.dpvec_index >= 0);
+ eassert (it->dpvec && it->current.dpvec_index >= 0);
it->face_id = it->saved_face_id;
@@ -7379,7 +7379,7 @@ get_visually_first_element (struct it *it)
if (STRINGP (it->string))
{
- xassert (!it->s);
+ eassert (!it->s);
stop = SCHARS (it->string);
if (stop > it->end_charpos)
stop = it->end_charpos;
@@ -7409,9 +7409,9 @@ next_element_from_string (struct it *it)
{
struct text_pos position;
- xassert (STRINGP (it->string));
- xassert (!it->bidi_p || EQ (it->string, it->bidi_it.string.lstring));
- xassert (IT_STRING_CHARPOS (*it) >= 0);
+ eassert (STRINGP (it->string));
+ eassert (!it->bidi_p || EQ (it->string, it->bidi_it.string.lstring));
+ eassert (IT_STRING_CHARPOS (*it) >= 0);
position = it->current.string_pos;
/* With bidi reordering, the character to display might not be the
@@ -7575,8 +7575,8 @@ next_element_from_c_string (struct it *it)
{
int success_p = 1;
- xassert (it->s);
- xassert (!it->bidi_p || it->s == it->bidi_it.string.s);
+ eassert (it->s);
+ eassert (!it->bidi_p || it->s == it->bidi_it.string.s);
it->what = IT_CHARACTER;
BYTEPOS (it->position) = CHARPOS (it->position) = 0;
it->object = Qnil;
@@ -7681,8 +7681,8 @@ compute_stop_pos_backwards (struct it *it)
ptrdiff_t save_stop_pos = it->stop_charpos;
ptrdiff_t save_end_pos = it->end_charpos;
- xassert (NILP (it->string) && !it->s);
- xassert (it->bidi_p);
+ eassert (NILP (it->string) && !it->s);
+ eassert (it->bidi_p);
it->bidi_p = 0;
do
{
@@ -7727,7 +7727,7 @@ handle_stop_backwards (struct it *it, ptrdiff_t charpos)
ptrdiff_t next_stop;
/* Scan in strict logical order. */
- xassert (it->bidi_p);
+ eassert (it->bidi_p);
it->bidi_p = 0;
do
{
@@ -7766,9 +7766,9 @@ next_element_from_buffer (struct it *it)
{
int success_p = 1;
- xassert (IT_CHARPOS (*it) >= BEGV);
- xassert (NILP (it->string) && !it->s);
- xassert (!it->bidi_p
+ eassert (IT_CHARPOS (*it) >= BEGV);
+ eassert (NILP (it->string) && !it->s);
+ eassert (!it->bidi_p
|| (EQ (it->bidi_it.string.lstring, Qnil)
&& it->bidi_it.string.s == NULL));
@@ -7927,7 +7927,7 @@ next_element_from_buffer (struct it *it)
}
/* Value is zero if end of buffer reached. */
- xassert (!success_p || it->what != IT_CHARACTER || it->len > 0);
+ eassert (!success_p || it->what != IT_CHARACTER || it->len > 0);
return success_p;
}
@@ -7941,7 +7941,7 @@ run_redisplay_end_trigger_hook (struct it *it)
/* IT->glyph_row should be non-null, i.e. we should be actually
displaying something, or otherwise we should not run the hook. */
- xassert (it->glyph_row);
+ eassert (it->glyph_row);
/* Set up hook arguments. */
args[0] = Qredisplay_end_trigger_functions;
@@ -8434,7 +8434,7 @@ move_it_in_display_line_to (struct it *it,
necessary here because of lines consisting of a line end,
only. The line end will not produce any glyphs and we
would never get MOVE_X_REACHED. */
- xassert (it->nglyphs == 0);
+ eassert (it->nglyphs == 0);
result = MOVE_X_REACHED;
break;
}
@@ -8884,7 +8884,7 @@ move_it_vertically_backward (struct it *it, int dy)
ptrdiff_t start_pos;
move_further_back:
- xassert (dy >= 0);
+ eassert (dy >= 0);
start_pos = IT_CHARPOS (*it);
@@ -8927,11 +8927,11 @@ move_it_vertically_backward (struct it *it, int dy)
|| (it2.method == GET_FROM_STRING
&& IT_CHARPOS (it2) == start_pos
&& SREF (it2.string, IT_STRING_BYTEPOS (it2) - 1) == '\n')));
- xassert (IT_CHARPOS (*it) >= BEGV);
+ eassert (IT_CHARPOS (*it) >= BEGV);
SAVE_IT (it3, it2, it3data);
move_it_to (&it2, start_pos, -1, -1, -1, MOVE_TO_POS);
- xassert (IT_CHARPOS (*it) >= BEGV);
+ eassert (IT_CHARPOS (*it) >= BEGV);
/* H is the actual vertical distance from the position in *IT
and the starting position. */
h = it2.current_y - it->current_y;
@@ -9942,13 +9942,13 @@ with_echo_area_buffer (struct window *w, int which,
if (clear_buffer_p && Z > BEG)
del_range (BEG, Z);
- xassert (BEGV >= BEG);
- xassert (ZV <= Z && ZV >= BEGV);
+ eassert (BEGV >= BEG);
+ eassert (ZV <= Z && ZV >= BEGV);
rc = fn (a1, a2, a3, a4);
- xassert (BEGV >= BEG);
- xassert (ZV <= Z && ZV >= BEGV);
+ eassert (BEGV >= BEG);
+ eassert (ZV <= Z && ZV >= BEGV);
unbind_to (count, Qnil);
return rc;
@@ -9990,7 +9990,7 @@ with_echo_area_buffer_unwind_data (struct window *w)
ASET (vector, i, Qnil);
}
- xassert (i == ASIZE (vector));
+ eassert (i == ASIZE (vector));
return vector;
}
@@ -10229,7 +10229,7 @@ resize_mini_window (struct window *w, int exact_p)
struct frame *f = XFRAME (w->frame);
int window_height_changed_p = 0;
- xassert (MINI_WINDOW_P (w));
+ eassert (MINI_WINDOW_P (w));
/* By default, start display at the beginning. */
set_marker_both (w->start, w->buffer,
@@ -10420,7 +10420,7 @@ restore_message (void)
{
Lisp_Object msg;
- xassert (CONSP (Vmessage_stack));
+ eassert (CONSP (Vmessage_stack));
msg = XCAR (Vmessage_stack);
if (STRINGP (msg))
message3_nolog (msg, SBYTES (msg), STRING_MULTIBYTE (msg));
@@ -10443,7 +10443,7 @@ pop_message_unwind (Lisp_Object dummy)
static void
pop_message (void)
{
- xassert (CONSP (Vmessage_stack));
+ eassert (CONSP (Vmessage_stack));
Vmessage_stack = XCDR (Vmessage_stack);
}
@@ -11522,7 +11522,7 @@ build_desired_tool_bar_string (struct frame *f)
? TOOL_BAR_IMAGE_DISABLED_SELECTED
: TOOL_BAR_IMAGE_DISABLED_DESELECTED);
- xassert (ASIZE (image) >= idx);
+ eassert (ASIZE (image) >= idx);
image = AREF (image, idx);
}
else
@@ -12808,7 +12808,7 @@ select_frame_for_redisplay (Lisp_Object frame)
Lisp_Object old = selected_frame;
struct Lisp_Symbol *sym;
- xassert (FRAMEP (frame) && FRAME_LIVE_P (XFRAME (frame)));
+ eassert (FRAMEP (frame) && FRAME_LIVE_P (XFRAME (frame)));
selected_frame = frame;
@@ -13300,8 +13300,8 @@ redisplay_internal (void)
&& (row = MATRIX_ROW (w->current_matrix, this_line_vpos),
row->enabled_p))
{
- xassert (this_line_vpos == it.vpos);
- xassert (this_line_y == it.current_y);
+ eassert (this_line_vpos == it.vpos);
+ eassert (this_line_y == it.current_y);
set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0);
#if GLYPH_DEBUG
*w->desired_matrix->method = 0;
@@ -13869,7 +13869,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
/* Don't even try doing anything if called for a mode-line or
header-line row, since the rest of the code isn't prepared to
deal with such calamities. */
- xassert (!row->mode_line_p);
+ eassert (!row->mode_line_p);
if (row->mode_line_p)
return 0;
@@ -15017,7 +15017,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
while (MATRIX_ROW_END_CHARPOS (row) < PT
&& MATRIX_ROW_BOTTOM_Y (row) < last_y)
{
- xassert (row->enabled_p);
+ eassert (row->enabled_p);
++row;
}
@@ -15060,7 +15060,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
&& (row->y > top_scroll_margin
|| CHARPOS (startp) == BEGV))
{
- xassert (row->enabled_p);
+ eassert (row->enabled_p);
--row;
}
@@ -15130,7 +15130,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
rc = CURSOR_MOVEMENT_MUST_SCROLL;
break;
}
- xassert (row->enabled_p);
+ eassert (row->enabled_p);
}
}
if (must_scroll)
@@ -15331,7 +15331,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
opoint = lpoint;
/* W must be a leaf window here. */
- xassert (!NILP (w->buffer));
+ eassert (!NILP (w->buffer));
#if GLYPH_DEBUG
*w->desired_matrix->method = 0;
#endif
@@ -15911,7 +15911,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
}
move_it_vertically_backward (&it, centering_position);
- xassert (IT_CHARPOS (it) >= BEGV);
+ eassert (IT_CHARPOS (it) >= BEGV);
/* The function move_it_vertically_backward may move over more
than the specified y-distance. If it->w is small, e.g. a
@@ -16260,14 +16260,14 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
window_end_vpos to its row number. */
if (last_text_row)
{
- xassert (MATRIX_ROW_DISPLAYS_TEXT_P (last_text_row));
+ eassert (MATRIX_ROW_DISPLAYS_TEXT_P (last_text_row));
w->window_end_bytepos
= Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
w->window_end_pos
= make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row));
w->window_end_vpos
= make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix));
- xassert (MATRIX_ROW (w->desired_matrix, XFASTINT (w->window_end_vpos))
+ eassert (MATRIX_ROW (w->desired_matrix, XFASTINT (w->window_end_vpos))
->displays_text_p);
}
else
@@ -16576,7 +16576,7 @@ try_window_reusing_current_matrix (struct window *w)
}
/* Start displaying at the start of first_row_to_display. */
- xassert (first_row_to_display->y < yb);
+ eassert (first_row_to_display->y < yb);
init_to_row_start (&it, w, first_row_to_display);
nrows_scrolled = (MATRIX_ROW_VPOS (first_reusable_row, w->current_matrix)
@@ -16648,7 +16648,7 @@ try_window_reusing_current_matrix (struct window *w)
}
/* Scroll the current matrix. */
- xassert (nrows_scrolled > 0);
+ eassert (nrows_scrolled > 0);
rotate_matrix (w->current_matrix,
start_vpos,
MATRIX_ROW_VPOS (bottom_row, w->current_matrix),
@@ -16760,7 +16760,7 @@ find_last_row_displaying_text (struct glyph_matrix *matrix, struct it *it,
row = start ? start : MATRIX_FIRST_TEXT_ROW (matrix);
while (MATRIX_ROW_DISPLAYS_TEXT_P (row))
{
- xassert (row->enabled_p);
+ eassert (row->enabled_p);
row_found = row;
if (MATRIX_ROW_BOTTOM_Y (row) >= it->last_visible_y)
break;
@@ -16922,9 +16922,9 @@ sync_frame_with_window_matrix_rows (struct window *w)
/* Preconditions: W must be a leaf window and full-width. Its frame
must have a frame matrix. */
- xassert (NILP (w->hchild) && NILP (w->vchild));
- xassert (WINDOW_FULL_WIDTH_P (w));
- xassert (!FRAME_WINDOW_P (f));
+ eassert (NILP (w->hchild) && NILP (w->vchild));
+ eassert (WINDOW_FULL_WIDTH_P (w));
+ eassert (!FRAME_WINDOW_P (f));
/* If W is a full-width window, glyph pointers in W's current matrix
have, by definition, to be the same as glyph pointers in the
@@ -17361,7 +17361,7 @@ try_window_id (struct window *w)
it.glyph_row = MATRIX_ROW (desired_matrix, it.vpos);
it.current_y = MATRIX_ROW_BOTTOM_Y (last_unchanged_at_beg_row);
- xassert (it.hpos == 0 && it.current_x == 0);
+ eassert (it.hpos == 0 && it.current_x == 0);
}
else
{
@@ -17391,7 +17391,7 @@ try_window_id (struct window *w)
stop_pos = 0;
if (first_unchanged_at_end_row)
{
- xassert (last_unchanged_at_beg_row == NULL
+ eassert (last_unchanged_at_beg_row == NULL
|| first_unchanged_at_end_row >= last_unchanged_at_beg_row);
/* If this is a continuation line, move forward to the next one
@@ -17414,7 +17414,7 @@ try_window_id (struct window *w)
+ delta);
first_unchanged_at_end_vpos
= MATRIX_ROW_VPOS (first_unchanged_at_end_row, current_matrix);
- xassert (stop_pos >= Z - END_UNCHANGED);
+ eassert (stop_pos >= Z - END_UNCHANGED);
}
}
else if (last_unchanged_at_beg_row == NULL)
@@ -17426,7 +17426,7 @@ try_window_id (struct window *w)
/* Either there is no unchanged row at the end, or the one we have
now displays text. This is a necessary condition for the window
end pos calculation at the end of this function. */
- xassert (first_unchanged_at_end_row == NULL
+ eassert (first_unchanged_at_end_row == NULL
|| MATRIX_ROW_DISPLAYS_TEXT_P (first_unchanged_at_end_row));
debug_last_unchanged_at_beg_vpos
@@ -17671,7 +17671,7 @@ try_window_id (struct window *w)
struct glyph_row *last_row = MATRIX_ROW (current_matrix, last_vpos);
/* If last_row is the window end line, it should display text. */
- xassert (last_row->displays_text_p);
+ eassert (last_row->displays_text_p);
/* If window end line was partially visible before, begin
displaying at that line. Otherwise begin displaying with the
@@ -17718,16 +17718,16 @@ try_window_id (struct window *w)
matrix. Set row to the last row displaying text in current
matrix starting at first_unchanged_at_end_row, after
scrolling. */
- xassert (first_unchanged_at_end_row->displays_text_p);
+ eassert (first_unchanged_at_end_row->displays_text_p);
row = find_last_row_displaying_text (w->current_matrix, &it,
first_unchanged_at_end_row);
- xassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row));
+ eassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row));
w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row));
w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
w->window_end_vpos
= make_number (MATRIX_ROW_VPOS (row, w->current_matrix));
- xassert (w->window_end_bytepos >= 0);
+ eassert (w->window_end_bytepos >= 0);
IF_DEBUG (debug_method_add (w, "A"));
}
else if (last_text_row_at_end)
@@ -17738,7 +17738,7 @@ try_window_id (struct window *w)
= Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end);
w->window_end_vpos
= make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix));
- xassert (w->window_end_bytepos >= 0);
+ eassert (w->window_end_bytepos >= 0);
IF_DEBUG (debug_method_add (w, "B"));
}
else if (last_text_row)
@@ -17752,7 +17752,7 @@ try_window_id (struct window *w)
= Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
w->window_end_vpos
= make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix));
- xassert (w->window_end_bytepos >= 0);
+ eassert (w->window_end_bytepos >= 0);
}
else if (first_unchanged_at_end_row == NULL
&& last_text_row == NULL
@@ -17778,11 +17778,11 @@ try_window_id (struct window *w)
row = current_row;
}
- xassert (row != NULL);
+ eassert (row != NULL);
w->window_end_vpos = make_number (vpos + 1);
w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row));
w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
- xassert (w->window_end_bytepos >= 0);
+ eassert (w->window_end_bytepos >= 0);
IF_DEBUG (debug_method_add (w, "C"));
}
else
@@ -18196,7 +18196,7 @@ insert_left_trunc_glyphs (struct it *it)
struct it truncate_it;
struct glyph *from, *end, *to, *toend;
- xassert (!FRAME_WINDOW_P (it->f));
+ eassert (!FRAME_WINDOW_P (it->f));
/* Get the truncation glyphs. */
truncate_it = *it;
@@ -18329,8 +18329,8 @@ compute_line_metrics (struct it *it)
for (i = 0; i < row->used[TEXT_AREA]; ++i)
row->pixel_width += row->glyphs[TEXT_AREA][i].pixel_width;
- xassert (row->pixel_width >= 0);
- xassert (row->ascent >= 0 && row->height > 0);
+ eassert (row->pixel_width >= 0);
+ eassert (row->ascent >= 0 && row->height > 0);
row->overlapping_p = (MATRIX_ROW_OVERLAPS_SUCC_P (row)
|| MATRIX_ROW_OVERLAPS_PRED_P (row));
@@ -18803,7 +18803,7 @@ push_prefix_prop (struct it *it, Lisp_Object prop)
struct text_pos pos =
STRINGP (it->string) ? it->current.string_pos : it->current.pos;
- xassert (it->method == GET_FROM_BUFFER
+ eassert (it->method == GET_FROM_BUFFER
|| it->method == GET_FROM_DISPLAY_VECTOR
|| it->method == GET_FROM_STRING);
@@ -18930,10 +18930,10 @@ unproduce_glyphs (struct it *it, int n)
{
struct glyph *glyph, *end;
- xassert (it->glyph_row);
- xassert (it->glyph_row->reversed_p);
- xassert (it->area == TEXT_AREA);
- xassert (n <= it->glyph_row->used[TEXT_AREA]);
+ eassert (it->glyph_row);
+ eassert (it->glyph_row->reversed_p);
+ eassert (it->area == TEXT_AREA);
+ eassert (n <= it->glyph_row->used[TEXT_AREA]);
if (n > it->glyph_row->used[TEXT_AREA])
n = it->glyph_row->used[TEXT_AREA];
@@ -19122,7 +19122,7 @@ display_line (struct it *it)
ptrdiff_t min_bpos IF_LINT (= 0), max_bpos IF_LINT (= 0);
/* We always start displaying at hpos zero even if hscrolled. */
- xassert (it->hpos == 0 && it->current_x == 0);
+ eassert (it->hpos == 0 && it->current_x == 0);
if (MATRIX_ROW_VPOS (row, it->w->desired_matrix)
>= it->w->desired_matrix->nrows)
@@ -19541,7 +19541,7 @@ display_line (struct it *it)
move_it_in_display_line at the start of this
function, unless the text display area of the
window is empty. */
- xassert (it->first_visible_x <= it->last_visible_x);
+ eassert (it->first_visible_x <= it->last_visible_x);
}
}
/* Even if this display element produced no glyphs at all,
@@ -19733,7 +19733,7 @@ display_line (struct it *it)
}
else
{
- xassert (INTEGERP (overlay_arrow_string));
+ eassert (INTEGERP (overlay_arrow_string));
row->overlay_arrow_bitmap = XINT (overlay_arrow_string);
}
overlay_arrow_seen = 1;
@@ -19936,7 +19936,7 @@ display_menu_bar (struct window *w)
#endif /* HAVE_NS */
#ifdef USE_X_TOOLKIT
- xassert (!FRAME_WINDOW_P (f));
+ eassert (!FRAME_WINDOW_P (f));
init_iterator (&it, w, -1, -1, f->desired_matrix->rows, MENU_FACE_ID);
it.first_visible_x = 0;
it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
@@ -19946,7 +19946,7 @@ display_menu_bar (struct window *w)
/* Menu bar lines are displayed in the desired matrix of the
dummy window menu_bar_window. */
struct window *menu_w;
- xassert (WINDOWP (f->menu_bar_window));
+ eassert (WINDOWP (f->menu_bar_window));
menu_w = XWINDOW (f->menu_bar_window);
init_iterator (&it, menu_w, -1, -1, menu_w->desired_matrix->rows,
MENU_FACE_ID);
@@ -22042,7 +22042,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
if (NILP (prop))
return OK_PIXELS (0);
- xassert (FRAME_LIVE_P (it->f));
+ eassert (FRAME_LIVE_P (it->f));
if (SYMBOLP (prop))
{
@@ -22369,7 +22369,7 @@ get_char_face_and_encoding (struct frame *f, int c, int face_id,
if (display_p)
#endif
{
- xassert (face != NULL);
+ eassert (face != NULL);
PREPARE_FACE_FOR_DISPLAY (f, face);
}
@@ -22387,7 +22387,7 @@ get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph,
{
struct face *face;
- xassert (glyph->type == CHAR_GLYPH);
+ eassert (glyph->type == CHAR_GLYPH);
face = FACE_FROM_ID (f, glyph->face_id);
if (two_byte_p)
@@ -22409,7 +22409,7 @@ get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph,
}
/* Make sure X resources of the face are allocated. */
- xassert (face != NULL);
+ eassert (face != NULL);
PREPARE_FACE_FOR_DISPLAY (f, face);
return face;
}
@@ -22455,7 +22455,7 @@ fill_composite_glyph_string (struct glyph_string *s, struct face *base_face,
glyph that requires the different face, add it to S. */
struct face *face;
- xassert (s);
+ eassert (s);
s->for_overlaps = overlaps;
s->face = NULL;
@@ -22565,7 +22565,7 @@ fill_glyphless_glyph_string (struct glyph_string *s, int face_id,
struct glyph *glyph, *last;
int voffset;
- xassert (s->first_glyph->type == GLYPHLESS_GLYPH);
+ eassert (s->first_glyph->type == GLYPHLESS_GLYPH);
s->for_overlaps = overlaps;
glyph = s->row->glyphs[s->area] + start;
last = s->row->glyphs[s->area] + end;
@@ -22606,9 +22606,9 @@ fill_glyph_string (struct glyph_string *s, int face_id,
int voffset;
int glyph_not_available_p;
- xassert (s->f == XFRAME (s->w->frame));
- xassert (s->nchars == 0);
- xassert (start >= 0 && end > start);
+ eassert (s->f == XFRAME (s->w->frame));
+ eassert (s->nchars == 0);
+ eassert (start >= 0 && end > start);
s->for_overlaps = overlaps;
glyph = s->row->glyphs[s->area] + start;
@@ -22631,7 +22631,7 @@ fill_glyph_string (struct glyph_string *s, int face_id,
&two_byte_p);
s->two_byte_p = two_byte_p;
++s->nchars;
- xassert (s->nchars <= end - start);
+ eassert (s->nchars <= end - start);
s->width += glyph->pixel_width;
if (glyph++->padding_p != s->padding_p)
break;
@@ -22652,7 +22652,7 @@ fill_glyph_string (struct glyph_string *s, int face_id,
/* Adjust base line for subscript/superscript text. */
s->ybase += voffset;
- xassert (s->face && s->face->gc);
+ eassert (s->face && s->face->gc);
return glyph - s->row->glyphs[s->area];
}
@@ -22662,9 +22662,9 @@ fill_glyph_string (struct glyph_string *s, int face_id,
static void
fill_image_glyph_string (struct glyph_string *s)
{
- xassert (s->first_glyph->type == IMAGE_GLYPH);
+ eassert (s->first_glyph->type == IMAGE_GLYPH);
s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img_id);
- xassert (s->img);
+ eassert (s->img);
s->slice = s->first_glyph->slice.img;
s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
s->font = s->face->font;
@@ -22688,7 +22688,7 @@ fill_stretch_glyph_string (struct glyph_string *s, int start, int end)
struct glyph *glyph, *last;
int voffset, face_id;
- xassert (s->first_glyph->type == STRETCH_GLYPH);
+ eassert (s->first_glyph->type == STRETCH_GLYPH);
glyph = s->row->glyphs[s->area] + start;
last = s->row->glyphs[s->area] + end;
@@ -22712,7 +22712,7 @@ fill_stretch_glyph_string (struct glyph_string *s, int start, int end)
/* The case that face->gc == 0 is handled when drawing the glyph
string by calling PREPARE_FACE_FOR_DISPLAY. */
- xassert (s->face);
+ eassert (s->face);
return glyph - s->row->glyphs[s->area];
}
@@ -23458,8 +23458,8 @@ append_glyph (struct it *it)
struct glyph *glyph;
enum glyph_row_area area = it->area;
- xassert (it->glyph_row);
- xassert (it->char_to_display != '\n' && it->char_to_display != '\t');
+ eassert (it->glyph_row);
+ eassert (it->char_to_display != '\n' && it->char_to_display != '\t');
glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
if (glyph < it->glyph_row->glyphs[area + 1])
@@ -23532,7 +23532,7 @@ append_composite_glyph (struct it *it)
struct glyph *glyph;
enum glyph_row_area area = it->area;
- xassert (it->glyph_row);
+ eassert (it->glyph_row);
glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
if (glyph < it->glyph_row->glyphs[area + 1])
@@ -23624,10 +23624,10 @@ produce_image_glyph (struct it *it)
int glyph_ascent, crop;
struct glyph_slice slice;
- xassert (it->what == IT_IMAGE);
+ eassert (it->what == IT_IMAGE);
face = FACE_FROM_ID (it->f, it->face_id);
- xassert (face);
+ eassert (face);
/* Make sure X resources of the face is loaded. */
PREPARE_FACE_FOR_DISPLAY (it->f, face);
@@ -23642,7 +23642,7 @@ produce_image_glyph (struct it *it)
}
img = IMAGE_FROM_ID (it->f, it->image_id);
- xassert (img);
+ eassert (img);
/* Make sure X resources of the image is loaded. */
prepare_image_for_display (it->f, img);
@@ -23783,7 +23783,7 @@ append_stretch_glyph (struct it *it, Lisp_Object object,
struct glyph *glyph;
enum glyph_row_area area = it->area;
- xassert (ascent >= 0 && ascent <= height);
+ eassert (ascent >= 0 && ascent <= height);
glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
if (glyph < it->glyph_row->glyphs[area + 1])
@@ -23893,7 +23893,7 @@ produce_stretch_glyph (struct it *it)
#endif
/* List should start with `space'. */
- xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace));
+ eassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace));
plist = XCDR (it->object);
/* Compute the width of the stretch. */
@@ -24272,7 +24272,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
}
else
{
- xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE);
+ eassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE);
sprintf (buf, "%0*X", it->c < 0x10000 ? 4 : 6, it->c);
str = buf;
}
@@ -24374,7 +24374,7 @@ x_produce_glyphs (struct it *it)
Vglyphless_char_display. */
Lisp_Object acronym = lookup_glyphless_char_display (-1, it);
- xassert (it->what == IT_GLYPHLESS);
+ eassert (it->what == IT_GLYPHLESS);
produce_glyphless_glyph (it, 1, STRINGP (acronym) ? acronym : Qnil);
goto done;
}
@@ -24999,7 +24999,7 @@ x_produce_glyphs (struct it *it)
done:
/* Accumulate dimensions. Note: can't assume that it->descent > 0
because this isn't true for images with `:ascent 100'. */
- xassert (it->ascent >= 0 && it->descent >= 0);
+ eassert (it->ascent >= 0 && it->descent >= 0);
if (it->area == TEXT_AREA)
it->current_x += it->pixel_width;
@@ -25028,7 +25028,7 @@ x_write_glyphs (struct glyph *start, int len)
{
int x, hpos, chpos = updated_window->phys_cursor.hpos;
- xassert (updated_window && updated_row);
+ eassert (updated_window && updated_row);
/* When the window is hscrolled, cursor hpos can legitimately be out
of bounds, but we draw the cursor at the corresponding window
margin in that case. */
@@ -25077,7 +25077,7 @@ x_insert_glyphs (struct glyph *start, int len)
int frame_x, frame_y;
ptrdiff_t hpos;
- xassert (updated_window && updated_row);
+ eassert (updated_window && updated_row);
BLOCK_INPUT;
w = updated_window;
f = XFRAME (WINDOW_FRAME (w));
@@ -25132,7 +25132,7 @@ x_clear_end_of_line (int to_x)
int max_x, min_y, max_y;
int from_x, from_y, to_y;
- xassert (updated_window && updated_row);
+ eassert (updated_window && updated_row);
f = XFRAME (w->frame);
if (updated_row->full_width_p)
@@ -25757,7 +25757,7 @@ display_and_set_cursor (struct window *w, int on,
|| (0 <= hpos && hpos < glyph_row->used[TEXT_AREA]))
glyph = glyph_row->glyphs[TEXT_AREA] + hpos;
- xassert (interrupt_input_blocked);
+ eassert (interrupt_input_blocked);
/* Set new_cursor_type to the cursor we want to be displayed. */
new_cursor_type = get_window_cursor_type (w, glyph,
@@ -26304,9 +26304,9 @@ mouse_face_from_buffer_pos (Lisp_Object window,
ptrdiff_t ignore, pos;
int x;
- xassert (NILP (disp_string) || STRINGP (disp_string));
- xassert (NILP (before_string) || STRINGP (before_string));
- xassert (NILP (after_string) || STRINGP (after_string));
+ eassert (NILP (disp_string) || STRINGP (disp_string));
+ eassert (NILP (before_string) || STRINGP (before_string));
+ eassert (NILP (after_string) || STRINGP (after_string));
/* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */
rows_from_pos_range (w, start_charpos, end_charpos, disp_string, &r1, &r2);
@@ -27922,7 +27922,7 @@ expose_area (struct window *w, struct glyph_row *row, XRectangle *r,
static int
expose_line (struct window *w, struct glyph_row *row, XRectangle *r)
{
- xassert (row->enabled_p);
+ eassert (row->enabled_p);
if (row->mode_line_p || w->pseudo_window_p)
draw_glyphs (w, 0, row, TEXT_AREA,
@@ -27962,7 +27962,7 @@ expose_overlaps (struct window *w,
for (row = first_overlapping_row; row <= last_overlapping_row; ++row)
if (row->overlapping_p)
{
- xassert (row->enabled_p && !row->mode_line_p);
+ eassert (row->enabled_p && !row->mode_line_p);
row->clip = r;
if (row->used[LEFT_MARGIN_AREA])
diff --git a/src/xfaces.c b/src/xfaces.c
index f2cd0eb6af8..a319c542b07 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -539,7 +539,7 @@ int color_count[256];
void
register_color (unsigned long pixel)
{
- xassert (pixel < 256);
+ eassert (pixel < 256);
++color_count[pixel];
}
@@ -549,7 +549,7 @@ register_color (unsigned long pixel)
void
unregister_color (unsigned long pixel)
{
- xassert (pixel < 256);
+ eassert (pixel < 256);
if (color_count[pixel] > 0)
--color_count[pixel];
else
@@ -663,7 +663,7 @@ static inline void
x_free_gc (struct frame *f, GC gc)
{
eassert (interrupt_input_blocked);
- IF_DEBUG (xassert (--ngcs >= 0));
+ IF_DEBUG (eassert (--ngcs >= 0));
XFreeGC (FRAME_X_DISPLAY (f), gc);
}
@@ -689,7 +689,7 @@ x_create_gc (struct frame *f, unsigned long mask, XGCValues *xgcv)
static inline void
x_free_gc (struct frame *f, GC gc)
{
- IF_DEBUG (xassert (--ngcs >= 0));
+ IF_DEBUG (eassert (--ngcs >= 0));
xfree (gc);
}
@@ -1325,8 +1325,8 @@ load_color (struct frame *f, struct face *face, Lisp_Object name,
{
XColor color;
- xassert (STRINGP (name));
- xassert (target_index == LFACE_FOREGROUND_INDEX
+ eassert (STRINGP (name));
+ eassert (target_index == LFACE_FOREGROUND_INDEX
|| target_index == LFACE_BACKGROUND_INDEX
|| target_index == LFACE_UNDERLINE_INDEX
|| target_index == LFACE_OVERLINE_INDEX
@@ -1855,7 +1855,7 @@ the WIDTH times as wide as FACE on FRAME. */)
#define LFACE_INHERIT(LFACE) AREF ((LFACE), LFACE_INHERIT_INDEX)
#define LFACE_FONTSET(LFACE) AREF ((LFACE), LFACE_FONTSET_INDEX)
-#if XASSERTS
+#ifdef ENABLE_CHECKING
/* Non-zero if LFACE is a Lisp face. A Lisp face is a vector of size
LFACE_VECTOR_SIZE which has the symbol `face' in slot 0. */
@@ -1873,68 +1873,68 @@ the WIDTH times as wide as FACE on FRAME. */)
static void
check_lface_attrs (Lisp_Object *attrs)
{
- xassert (UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_FAMILY_INDEX])
|| STRINGP (attrs[LFACE_FAMILY_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_FOUNDRY_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_FOUNDRY_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_FOUNDRY_INDEX])
|| STRINGP (attrs[LFACE_FOUNDRY_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_SWIDTH_INDEX])
|| SYMBOLP (attrs[LFACE_SWIDTH_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_HEIGHT_INDEX])
|| INTEGERP (attrs[LFACE_HEIGHT_INDEX])
|| FLOATP (attrs[LFACE_HEIGHT_INDEX])
|| FUNCTIONP (attrs[LFACE_HEIGHT_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_WEIGHT_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_WEIGHT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_WEIGHT_INDEX])
|| SYMBOLP (attrs[LFACE_WEIGHT_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_SLANT_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_SLANT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_SLANT_INDEX])
|| SYMBOLP (attrs[LFACE_SLANT_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_UNDERLINE_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_UNDERLINE_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_UNDERLINE_INDEX])
|| SYMBOLP (attrs[LFACE_UNDERLINE_INDEX])
|| STRINGP (attrs[LFACE_UNDERLINE_INDEX])
|| CONSP (attrs[LFACE_UNDERLINE_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_OVERLINE_INDEX])
|| SYMBOLP (attrs[LFACE_OVERLINE_INDEX])
|| STRINGP (attrs[LFACE_OVERLINE_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_STRIKE_THROUGH_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_STRIKE_THROUGH_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_STRIKE_THROUGH_INDEX])
|| SYMBOLP (attrs[LFACE_STRIKE_THROUGH_INDEX])
|| STRINGP (attrs[LFACE_STRIKE_THROUGH_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_BOX_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_BOX_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_BOX_INDEX])
|| SYMBOLP (attrs[LFACE_BOX_INDEX])
|| STRINGP (attrs[LFACE_BOX_INDEX])
|| INTEGERP (attrs[LFACE_BOX_INDEX])
|| CONSP (attrs[LFACE_BOX_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_INVERSE_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_INVERSE_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_INVERSE_INDEX])
|| SYMBOLP (attrs[LFACE_INVERSE_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_FOREGROUND_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_FOREGROUND_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_FOREGROUND_INDEX])
|| STRINGP (attrs[LFACE_FOREGROUND_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_BACKGROUND_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_BACKGROUND_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_BACKGROUND_INDEX])
|| STRINGP (attrs[LFACE_BACKGROUND_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_INHERIT_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_INHERIT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_INHERIT_INDEX])
|| NILP (attrs[LFACE_INHERIT_INDEX])
|| SYMBOLP (attrs[LFACE_INHERIT_INDEX])
|| CONSP (attrs[LFACE_INHERIT_INDEX]));
#ifdef HAVE_WINDOW_SYSTEM
- xassert (UNSPECIFIEDP (attrs[LFACE_STIPPLE_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_STIPPLE_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_STIPPLE_INDEX])
|| SYMBOLP (attrs[LFACE_STIPPLE_INDEX])
|| !NILP (Fbitmap_spec_p (attrs[LFACE_STIPPLE_INDEX])));
- xassert (UNSPECIFIEDP (attrs[LFACE_FONT_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_FONT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_FONT_INDEX])
|| FONTP (attrs[LFACE_FONT_INDEX]));
- xassert (UNSPECIFIEDP (attrs[LFACE_FONTSET_INDEX])
+ eassert (UNSPECIFIEDP (attrs[LFACE_FONTSET_INDEX])
|| STRINGP (attrs[LFACE_FONTSET_INDEX])
|| NILP (attrs[LFACE_FONTSET_INDEX]));
#endif
@@ -1948,7 +1948,7 @@ check_lface (Lisp_Object lface)
{
if (!NILP (lface))
{
- xassert (LFACEP (lface));
+ eassert (LFACEP (lface));
check_lface_attrs (XVECTOR (lface)->contents);
}
}
@@ -2225,7 +2225,7 @@ set_lface_from_font (struct frame *f, Lisp_Object lface,
{
int pt = PIXEL_TO_POINT (font->pixel_size * 10, f->resy);
- xassert (pt > 0);
+ eassert (pt > 0);
LFACE_HEIGHT (lface) = make_number (pt);
}
@@ -2731,7 +2731,7 @@ Value is a vector of face attributes. */)
++windows_or_buffers_changed;
}
- xassert (LFACEP (lface));
+ eassert (LFACEP (lface));
check_lface (lface);
return lface;
}
@@ -3515,7 +3515,7 @@ face_boolean_x_resource_value (Lisp_Object value, int signal_p)
{
Lisp_Object result = make_number (0);
- xassert (STRINGP (value));
+ eassert (STRINGP (value));
if (xstrcasecmp (SSDATA (value), "on") == 0
|| xstrcasecmp (SSDATA (value), "true") == 0)
@@ -4088,7 +4088,7 @@ hash_string_case_insensitive (Lisp_Object string)
{
const unsigned char *s;
unsigned hash = 0;
- xassert (STRINGP (string));
+ eassert (STRINGP (string));
for (s = SDATA (string); *s; ++s)
hash = (hash << 1) ^ tolower (*s);
return hash;
@@ -4119,7 +4119,7 @@ lface_hash (Lisp_Object *v)
static inline int
lface_same_font_attributes_p (Lisp_Object *lface1, Lisp_Object *lface2)
{
- xassert (lface_fully_specified_p (lface1)
+ eassert (lface_fully_specified_p (lface1)
&& lface_fully_specified_p (lface2));
return (xstrcasecmp (SSDATA (lface1[LFACE_FAMILY_INDEX]),
SSDATA (lface2[LFACE_FAMILY_INDEX])) == 0
@@ -4200,7 +4200,7 @@ void
prepare_face_for_display (struct frame *f, struct face *face)
{
#ifdef HAVE_WINDOW_SYSTEM
- xassert (FRAME_WINDOW_P (f));
+ eassert (FRAME_WINDOW_P (f));
if (face->gc == 0)
{
@@ -4472,7 +4472,7 @@ cache_face (struct face_cache *c, struct face *face, unsigned int hash)
if (face1->id == i)
++n;
- xassert (n == 1);
+ eassert (n == 1);
}
#endif /* GLYPH_DEBUG */
@@ -4523,7 +4523,7 @@ lookup_face (struct frame *f, Lisp_Object *attr)
int i;
struct face *face;
- xassert (cache != NULL);
+ eassert (cache != NULL);
check_lface_attrs (attr);
/* Look up ATTR in the face cache. */
@@ -4548,7 +4548,7 @@ lookup_face (struct frame *f, Lisp_Object *attr)
face = realize_face (cache, attr, -1);
#if GLYPH_DEBUG
- xassert (face == FACE_FROM_ID (f, face->id));
+ eassert (face == FACE_FROM_ID (f, face->id));
#endif /* GLYPH_DEBUG */
return face->id;
@@ -4569,7 +4569,7 @@ face_for_font (struct frame *f, Lisp_Object font_object, struct face *base_face)
int i;
struct face *face;
- xassert (cache != NULL);
+ eassert (cache != NULL);
base_face = base_face->ascii_face;
hash = lface_hash (base_face->lface);
i = hash % FACE_CACHE_BUCKETS_SIZE;
@@ -5470,7 +5470,7 @@ realize_default_face (struct frame *f)
LFACE_STIPPLE (lface) = Qnil;
/* Realize the face; it must be fully-specified now. */
- xassert (lface_fully_specified_p (XVECTOR (lface)->contents));
+ eassert (lface_fully_specified_p (XVECTOR (lface)->contents));
check_lface (lface);
memcpy (attrs, XVECTOR (lface)->contents, sizeof attrs);
face = realize_face (c, attrs, DEFAULT_FACE_ID);
@@ -5511,7 +5511,7 @@ realize_named_face (struct frame *f, Lisp_Object symbol, int id)
/* The default face must exist and be fully specified. */
get_lface_attributes_no_remap (f, Qdefault, attrs, 1);
check_lface_attrs (attrs);
- xassert (lface_fully_specified_p (attrs));
+ eassert (lface_fully_specified_p (attrs));
/* If SYMBOL isn't know as a face, create it. */
if (NILP (lface))
@@ -5541,7 +5541,7 @@ realize_face (struct face_cache *cache, Lisp_Object *attrs, int former_face_id)
struct face *face;
/* LFACE must be fully specified. */
- xassert (cache != NULL);
+ eassert (cache != NULL);
check_lface_attrs (attrs);
if (former_face_id >= 0 && cache->used > former_face_id)
@@ -5621,7 +5621,7 @@ realize_x_face (struct face_cache *cache, Lisp_Object *attrs)
struct frame *f;
Lisp_Object stipple, underline, overline, strike_through, box;
- xassert (FRAME_WINDOW_P (cache->f));
+ eassert (FRAME_WINDOW_P (cache->f));
/* Allocate a new realized face. */
face = make_realized_face (attrs);
@@ -5699,7 +5699,7 @@ realize_x_face (struct face_cache *cache, Lisp_Object *attrs)
{
/* Simple box of specified line width in foreground color of the
face. */
- xassert (XINT (box) != 0);
+ eassert (XINT (box) != 0);
face->box = FACE_SIMPLE_BOX;
face->box_line_width = XINT (box);
face->box_color = face->foreground;
@@ -5880,7 +5880,7 @@ map_tty_color (struct frame *f, struct face *face,
foreground_p ? FACE_TTY_DEFAULT_BG_COLOR : FACE_TTY_DEFAULT_FG_COLOR;
#endif
- xassert (idx == LFACE_FOREGROUND_INDEX || idx == LFACE_BACKGROUND_INDEX);
+ eassert (idx == LFACE_FOREGROUND_INDEX || idx == LFACE_BACKGROUND_INDEX);
XSETFRAME (frame, f);
color = face->lface[idx];
@@ -5948,7 +5948,7 @@ realize_tty_face (struct face_cache *cache, Lisp_Object *attrs)
struct frame *f = cache->f;
/* Frame must be a termcap frame. */
- xassert (FRAME_TERMCAP_P (cache->f) || FRAME_MSDOS_P (cache->f));
+ eassert (FRAME_TERMCAP_P (cache->f) || FRAME_MSDOS_P (cache->f));
/* Allocate a new realized face. */
face = make_realized_face (attrs);
@@ -6079,7 +6079,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos,
/* W must display the current buffer. We could write this function
to use the frame and buffer of W, but right now it doesn't. */
- /* xassert (XBUFFER (w->buffer) == current_buffer); */
+ /* eassert (XBUFFER (w->buffer) == current_buffer); */
XSETFRAME (frame, f);
XSETFASTINT (position, pos);
@@ -6189,7 +6189,7 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
/* W must display the current buffer. We could write this function
to use the frame and buffer of W, but right now it doesn't. */
- /* xassert (XBUFFER (w->buffer) == current_buffer); */
+ /* eassert (XBUFFER (w->buffer) == current_buffer); */
XSETFRAME (frame, f);
XSETFASTINT (position, pos);
@@ -6293,7 +6293,7 @@ face_at_string_position (struct window *w, Lisp_Object string,
*endptr = -1;
base_face = FACE_FROM_ID (f, base_face_id);
- xassert (base_face);
+ eassert (base_face);
/* Optimize the default case that there is no face property and we
are not in the region. */
diff --git a/src/xfns.c b/src/xfns.c
index 02aefe9d91a..00cf9f8e081 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2914,7 +2914,7 @@ unwind_create_frame (Lisp_Object frame)
/* If frame is ``official'', nothing to do. */
if (NILP (Fmemq (frame, Vframe_list)))
{
-#if GLYPH_DEBUG && XASSERTS
+#if GLYPH_DEBUG && defined ENABLE_CHECKING
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
#endif
@@ -2923,8 +2923,8 @@ unwind_create_frame (Lisp_Object frame)
#if GLYPH_DEBUG
/* Check that reference counts are indeed correct. */
- xassert (dpyinfo->reference_count == dpyinfo_refcount);
- xassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount);
+ eassert (dpyinfo->reference_count == dpyinfo_refcount);
+ eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount);
#endif
return Qt;
}
diff --git a/src/xselect.c b/src/xselect.c
index f21c57b44bb..4d961d73bf1 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1359,7 +1359,7 @@ x_get_window_property (Display *display, Window window, Atom property,
break;
bytes_per_item = *actual_format_ret >> 3;
- xassert (*actual_size_ret <= buffer_size / bytes_per_item);
+ eassert (*actual_size_ret <= buffer_size / bytes_per_item);
/* The man page for XGetWindowProperty says:
"If the returned format is 32, the returned data is represented
diff --git a/src/xterm.c b/src/xterm.c
index be01513d910..8e978edf7d9 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -715,7 +715,7 @@ x_after_update_window_line (struct glyph_row *desired_row)
struct frame *f;
int width, height;
- xassert (w);
+ eassert (w);
if (!desired_row->mode_line_p && !w->pseudo_window_p)
desired_row->redraw_fringe_bitmaps_p = 1;
@@ -1033,7 +1033,7 @@ x_set_mouse_face_gc (struct glyph_string *s)
s->gc = FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc;
}
- xassert (s->gc != 0);
+ eassert (s->gc != 0);
}
@@ -1090,7 +1090,7 @@ x_set_glyph_string_gc (struct glyph_string *s)
}
/* GC must have been set. */
- xassert (s->gc != 0);
+ eassert (s->gc != 0);
}
@@ -1691,8 +1691,8 @@ x_query_colors (struct frame *f, XColor *colors, int ncolors)
for (i = 0; i < ncolors; ++i)
{
unsigned long pixel = colors[i].pixel;
- xassert (pixel < dpyinfo->ncolor_cells);
- xassert (dpyinfo->color_cells[pixel].pixel == pixel);
+ eassert (pixel < dpyinfo->ncolor_cells);
+ eassert (dpyinfo->color_cells[pixel].pixel == pixel);
colors[i] = dpyinfo->color_cells[pixel];
}
}
@@ -1850,7 +1850,7 @@ x_alloc_lighter_color (struct frame *f, Display *display, Colormap cmap, long un
x_query_color (f, &color);
/* Change RGB values by specified FACTOR. Avoid overflow! */
- xassert (factor >= 0);
+ eassert (factor >= 0);
new.red = min (0xffff, factor * color.red);
new.green = min (0xffff, factor * color.green);
new.blue = min (0xffff, factor * color.blue);
@@ -2562,7 +2562,7 @@ x_draw_image_glyph_string (struct glyph_string *s)
static void
x_draw_stretch_glyph_string (struct glyph_string *s)
{
- xassert (s->first_glyph->type == STRETCH_GLYPH);
+ eassert (s->first_glyph->type == STRETCH_GLYPH);
if (s->hl == DRAW_CURSOR
&& !x_stretch_cursor_p)
@@ -3026,7 +3026,7 @@ x_delete_glyphs (struct frame *f, register int n)
void
x_clear_area (Display *dpy, Window window, int x, int y, int width, int height, int exposures)
{
- xassert (width > 0 && height > 0);
+ eassert (width > 0 && height > 0);
XClearArea (dpy, window, x, y, width, height, exposures);
}
@@ -9809,9 +9809,9 @@ x_wm_set_icon_position (struct frame *f, int icon_x, int icon_y)
static void
x_check_font (struct frame *f, struct font *font)
{
- xassert (font != NULL && ! NILP (font->props[FONT_TYPE_INDEX]));
+ eassert (font != NULL && ! NILP (font->props[FONT_TYPE_INDEX]));
if (font->driver->check)
- xassert (font->driver->check (f, font) == 0);
+ eassert (font->driver->check (f, font) == 0);
}
#endif /* GLYPH_DEBUG != 0 */