]> code.delx.au - gnu-emacs/blobdiff - src/buffer.h
TODO update
[gnu-emacs] / src / buffer.h
index d18ef30ea385fa179da58d75e7a9f3d3003a9655..f4c8a8cc8393bdfe66c6397e1d0e4c3a919da32a 100644 (file)
@@ -1,7 +1,7 @@
 /* Header file for the buffer manipulation primitives.
 
-Copyright (C) 1985-1986, 1993-1995, 1997-2012
-                 Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1993-1995, 1997-2013 Free Software Foundation,
+Inc.
 
 This file is part of GNU Emacs.
 
@@ -963,6 +963,22 @@ bset_width_table (struct buffer *b, Lisp_Object val)
 
 #define BUFFER_LIVE_P(b) (!NILP (BVAR (b, name)))
 
+/* Verify indirection counters.  */
+
+#define BUFFER_CHECK_INDIRECTION(b)                    \
+  do {                                                 \
+    if (BUFFER_LIVE_P (b))                             \
+    {                                                  \
+      if (b->base_buffer)                              \
+       {                                               \
+         eassert (b->indirections == -1);              \
+         eassert (b->base_buffer->indirections > 0);   \
+       }                                               \
+      else                                             \
+       eassert (b->indirections >= 0);                 \
+    }                                                  \
+  } while (0)
+
 /* Chain of all buffers, including killed ones.  */
 
 extern struct buffer *all_buffers;