aboutsummaryrefslogtreecommitdiffstats
path: root/src/fns.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-06-28 11:50:27 +0400
committerDmitry Antipov2012-06-28 11:50:27 +0400
commita54e2c050b9cf161cbccc3dd4628f8ef6b64f519 (patch)
tree447eb906b698dee37a17779ea15f448079b8f54b /src/fns.c
parent1c9bd87017e4b5f7f56e734277ff6e0a0ebb51d6 (diff)
downloademacs-a54e2c050b9cf161cbccc3dd4628f8ef6b64f519.tar.gz
emacs-a54e2c050b9cf161cbccc3dd4628f8ef6b64f519.zip
Generalize run-time debugging checks.
* configure.in (ENABLE_CHECKING): Update comment. * src/dispextern.h (XASSERTS): Remove. * src/fontset.c (xassert): Remove. Convert from xassert to eassert. * src/alloc.c: Convert from xassert to eassert. * src/bidi.c: Likewise. * src/dispnew.c: Likewise. * src/fns.c: Likewise. * src/fringe.c: Likewise. * src/ftfont.c: Likewise. * src/gtkutil.c: Likewise. * src/image.c: Likewise. * src/keyboard.c: Likewise. * src/menu.c: Likewise. * src/process.c: Likewise. * src/scroll.c: Likewise. * src/sound.c: Likewise. * src/term.c: Likewise. * src/w32console.c: Likewise. * src/w32fns.c: Likewise. * src/w32term.c: Likewise. * src/window.c: Likewise. * src/xdisp.c: Likewise. * src/xfaces.c: Likewise. * src/xfns.c: Likewise. * src/xselect.c: Likewise. * src/xterm.c: Likewise.
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c26
1 files changed, 13 insertions, 13 deletions
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)
3434 ptrdiff_t C_language_max = min (PTRDIFF_MAX, SIZE_MAX) / sizeof *v->contents; 3434 ptrdiff_t C_language_max = min (PTRDIFF_MAX, SIZE_MAX) / sizeof *v->contents;
3435 ptrdiff_t n_max = (0 <= nitems_max && nitems_max < C_language_max 3435 ptrdiff_t n_max = (0 <= nitems_max && nitems_max < C_language_max
3436 ? nitems_max : C_language_max); 3436 ? nitems_max : C_language_max);
3437 xassert (VECTORP (vec)); 3437 eassert (VECTORP (vec));
3438 xassert (0 < incr_min && -1 <= nitems_max); 3438 eassert (0 < incr_min && -1 <= nitems_max);
3439 old_size = ASIZE (vec); 3439 old_size = ASIZE (vec);
3440 incr_max = n_max - old_size; 3440 incr_max = n_max - old_size;
3441 incr = max (incr_min, min (old_size >> 1, incr_max)); 3441 incr = max (incr_min, min (old_size >> 1, incr_max));
@@ -3514,7 +3514,7 @@ static EMACS_UINT
3514hashfn_eq (struct Lisp_Hash_Table *h, Lisp_Object key) 3514hashfn_eq (struct Lisp_Hash_Table *h, Lisp_Object key)
3515{ 3515{
3516 EMACS_UINT hash = XUINT (key) ^ XTYPE (key); 3516 EMACS_UINT hash = XUINT (key) ^ XTYPE (key);
3517 xassert ((hash & ~INTMASK) == 0); 3517 eassert ((hash & ~INTMASK) == 0);
3518 return hash; 3518 return hash;
3519} 3519}
3520 3520
@@ -3531,7 +3531,7 @@ hashfn_eql (struct Lisp_Hash_Table *h, Lisp_Object key)
3531 hash = sxhash (key, 0); 3531 hash = sxhash (key, 0);
3532 else 3532 else
3533 hash = XUINT (key) ^ XTYPE (key); 3533 hash = XUINT (key) ^ XTYPE (key);
3534 xassert ((hash & ~INTMASK) == 0); 3534 eassert ((hash & ~INTMASK) == 0);
3535 return hash; 3535 return hash;
3536} 3536}
3537 3537
@@ -3544,7 +3544,7 @@ static EMACS_UINT
3544hashfn_equal (struct Lisp_Hash_Table *h, Lisp_Object key) 3544hashfn_equal (struct Lisp_Hash_Table *h, Lisp_Object key)
3545{ 3545{
3546 EMACS_UINT hash = sxhash (key, 0); 3546 EMACS_UINT hash = sxhash (key, 0);
3547 xassert ((hash & ~INTMASK) == 0); 3547 eassert ((hash & ~INTMASK) == 0);
3548 return hash; 3548 return hash;
3549} 3549}
3550 3550
@@ -3605,11 +3605,11 @@ make_hash_table (Lisp_Object test, Lisp_Object size, Lisp_Object rehash_size,
3605 double index_float; 3605 double index_float;
3606 3606
3607 /* Preconditions. */ 3607 /* Preconditions. */
3608 xassert (SYMBOLP (test)); 3608 eassert (SYMBOLP (test));
3609 xassert (INTEGERP (size) && XINT (size) >= 0); 3609 eassert (INTEGERP (size) && XINT (size) >= 0);
3610 xassert ((INTEGERP (rehash_size) && XINT (rehash_size) > 0) 3610 eassert ((INTEGERP (rehash_size) && XINT (rehash_size) > 0)
3611 || (FLOATP (rehash_size) && 1 < XFLOAT_DATA (rehash_size))); 3611 || (FLOATP (rehash_size) && 1 < XFLOAT_DATA (rehash_size)));
3612 xassert (FLOATP (rehash_threshold) 3612 eassert (FLOATP (rehash_threshold)
3613 && 0 < XFLOAT_DATA (rehash_threshold) 3613 && 0 < XFLOAT_DATA (rehash_threshold)
3614 && XFLOAT_DATA (rehash_threshold) <= 1.0); 3614 && XFLOAT_DATA (rehash_threshold) <= 1.0);
3615 3615
@@ -3667,8 +3667,8 @@ make_hash_table (Lisp_Object test, Lisp_Object size, Lisp_Object rehash_size,
3667 h->next_free = make_number (0); 3667 h->next_free = make_number (0);
3668 3668
3669 XSET_HASH_TABLE (table, h); 3669 XSET_HASH_TABLE (table, h);
3670 xassert (HASH_TABLE_P (table)); 3670 eassert (HASH_TABLE_P (table));
3671 xassert (XHASH_TABLE (table) == h); 3671 eassert (XHASH_TABLE (table) == h);
3672 3672
3673 /* Maybe add this hash table to the list of all weak hash tables. */ 3673 /* Maybe add this hash table to the list of all weak hash tables. */
3674 if (NILP (h->weak)) 3674 if (NILP (h->weak))
@@ -3843,7 +3843,7 @@ hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value,
3843{ 3843{
3844 ptrdiff_t start_of_bucket, i; 3844 ptrdiff_t start_of_bucket, i;
3845 3845
3846 xassert ((hash & ~INTMASK) == 0); 3846 eassert ((hash & ~INTMASK) == 0);
3847 3847
3848 /* Increment count after resizing because resizing may fail. */ 3848 /* Increment count after resizing because resizing may fail. */
3849 maybe_resize_hash_table (h); 3849 maybe_resize_hash_table (h);
@@ -3902,7 +3902,7 @@ hash_remove_from_table (struct Lisp_Hash_Table *h, Lisp_Object key)
3902 HASH_NEXT (h, i) = h->next_free; 3902 HASH_NEXT (h, i) = h->next_free;
3903 h->next_free = make_number (i); 3903 h->next_free = make_number (i);
3904 h->count--; 3904 h->count--;
3905 xassert (h->count >= 0); 3905 eassert (h->count >= 0);
3906 break; 3906 break;
3907 } 3907 }
3908 else 3908 else