emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109504: Cleanup intervals.


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109504: Cleanup intervals.
Date: Wed, 08 Aug 2012 10:11:29 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109504
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Wed 2012-08-08 10:11:29 +0400
message:
  Cleanup intervals.
  * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
  (NULL_INTERVAL_P): Likewise.  Adjust users.
  (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P): Adjust
  comment.  Move under #if 0.
  * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
  * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
modified:
  src/ChangeLog
  src/alloc.c
  src/buffer.c
  src/editfns.c
  src/fileio.c
  src/fns.c
  src/insdel.c
  src/intervals.c
  src/intervals.h
  src/print.c
  src/syntax.c
  src/textprop.c
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-08-08 05:23:02 +0000
+++ b/src/ChangeLog     2012-08-08 06:11:29 +0000
@@ -1,5 +1,15 @@
 2012-08-08  Dmitry Antipov  <address@hidden>
 
+       Cleanup intervals.
+       * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
+       (NULL_INTERVAL_P): Likewise.  Adjust users.
+       (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P): Adjust
+       comment.  Move under #if 0.
+       * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
+       * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
+
+2012-08-08  Dmitry Antipov  <address@hidden>
+
        Check total length of intervals with eassert.
        * intervals.h (CHECK_TOTAL_LENGTH): Remove.
        * intervals.c: Change all users to eassert.

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2012-08-07 13:37:21 +0000
+++ b/src/alloc.c       2012-08-08 06:11:29 +0000
@@ -1559,19 +1559,20 @@
 
 /* Mark the interval tree rooted in I.  */
 
-#define MARK_INTERVAL_TREE(i)                          \
-  do {                                                 \
-    if (!NULL_INTERVAL_P (i) && !i->gcmarkbit)         \
-      mark_interval_tree (i);                          \
-  } while (0)
-
-
-#define UNMARK_BALANCE_INTERVALS(i)                    \
-  do {                                                 \
-   if (! NULL_INTERVAL_P (i))                          \
-     (i) = balance_intervals (i);                      \
-  } while (0)
-
+#define MARK_INTERVAL_TREE(i)  \
+  do {                         \
+    if (i && !i->gcmarkbit)    \
+      mark_interval_tree (i);  \
+  } while (0)
+
+/* Unmark and rebalance interval tree rooted in I.  */
+
+#define UNMARK_BALANCE_INTERVALS(i)    \
+  do {                                 \
+   if (i)                              \
+     (i) = balance_intervals (i);      \
+  } while (0)
+
 /***********************************************************************
                          String Allocation
  ***********************************************************************/
@@ -2100,7 +2101,7 @@
                  /* String is live; unmark it and its intervals.  */
                  UNMARK_STRING (s);
 
-                 if (!NULL_INTERVAL_P (s->intervals))
+                 if (s->intervals)
                    UNMARK_BALANCE_INTERVALS (s->intervals);
 
                  ++total_strings;
@@ -2502,7 +2503,7 @@
     return empty_multibyte_string;
 
   s = allocate_string ();
-  s->intervals = NULL_INTERVAL;
+  s->intervals = NULL;
   allocate_string_data (s, nchars, nbytes);
   XSETSTRING (string, s);
   string_chars_consed += nbytes;
@@ -5221,7 +5222,7 @@
     }
   s->size = nchars;
   s->size_byte = multibyte ? nbytes : -1;
-  s->intervals = NULL_INTERVAL;
+  s->intervals = NULL;
   XSETSTRING (string, s);
   return string;
 }
@@ -5237,7 +5238,7 @@
   s->size = nchars;
   s->size_byte = -1;
   s->data = (unsigned char *) data;
-  s->intervals = NULL_INTERVAL;
+  s->intervals = NULL;
   XSETSTRING (string, s);
   return string;
 }

=== modified file 'src/buffer.c'
--- a/src/buffer.c      2012-08-07 13:37:21 +0000
+++ b/src/buffer.c      2012-08-08 06:11:29 +0000
@@ -360,7 +360,7 @@
   BUF_CHARS_MODIFF (b) = 1;
   BUF_OVERLAY_MODIFF (b) = 1;
   BUF_SAVE_MODIFF (b) = 1;
-  BUF_INTERVALS (b) = 0;
+  BUF_INTERVALS (b) = NULL;
   BUF_UNCHANGED_MODIFIED (b) = 1;
   BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1;
   BUF_END_UNCHANGED (b) = 0;
@@ -384,7 +384,7 @@
   BVAR (b, zv_marker) = Qnil;
 
   name = Fcopy_sequence (buffer_or_name);
-  STRING_SET_INTERVALS (name, NULL_INTERVAL);
+  STRING_SET_INTERVALS (name, NULL);
   BVAR (b, name) = name;
 
   BVAR (b, undo_list) = (SREF (name, 0) != ' ') ? Qnil : Qt;
@@ -589,7 +589,7 @@
   all_buffers = b;
 
   name = Fcopy_sequence (name);
-  STRING_SET_INTERVALS (name, NULL_INTERVAL);
+  STRING_SET_INTERVALS (name, NULL);
   BVAR (b, name) = name;
 
   reset_buffer (b);
@@ -1688,7 +1688,7 @@
          m = next;
        }
       BUF_MARKERS (b) = NULL;
-      BUF_INTERVALS (b) = NULL_INTERVAL;
+      BUF_INTERVALS (b) = NULL;
 
       /* Perhaps we should explicitly free the interval tree here... */
     }
@@ -4904,8 +4904,8 @@
   /* No one will share the text with these buffers, but let's play it safe.  */
   buffer_defaults.indirections = 0;
   buffer_local_symbols.indirections = 0;
-  BUF_INTERVALS (&buffer_defaults) = 0;
-  BUF_INTERVALS (&buffer_local_symbols) = 0;
+  BUF_INTERVALS (&buffer_defaults) = NULL;
+  BUF_INTERVALS (&buffer_local_symbols) = NULL;
   XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize);
   XSETBUFFER (Vbuffer_defaults, &buffer_defaults);
   XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize);

=== modified file 'src/editfns.c'
--- a/src/editfns.c     2012-08-07 07:33:18 +0000
+++ b/src/editfns.c     2012-08-08 06:11:29 +0000
@@ -4637,7 +4637,7 @@
       /* Don't use Fset_text_properties: that can cause GC, which can
         clobber objects stored in the tmp_intervals.  */
       tmp_interval3 = validate_interval_range (buf, &startr1, &endr2, 0);
-      if (!NULL_INTERVAL_P (tmp_interval3))
+      if (tmp_interval3)
        set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3);
 
       /* First region smaller than second.  */
@@ -4696,11 +4696,11 @@
           tmp_interval2 = copy_intervals (cur_intv, start2, len2);
 
          tmp_interval3 = validate_interval_range (buf, &startr1, &endr1, 0);
-         if (!NULL_INTERVAL_P (tmp_interval3))
+         if (tmp_interval3)
            set_text_properties_1 (startr1, endr1, Qnil, buf, tmp_interval3);
 
          tmp_interval3 = validate_interval_range (buf, &startr2, &endr2, 0);
-         if (!NULL_INTERVAL_P (tmp_interval3))
+         if (tmp_interval3)
            set_text_properties_1 (startr2, endr2, Qnil, buf, tmp_interval3);
 
          temp = SAFE_ALLOCA (len1_byte);
@@ -4729,7 +4729,7 @@
           tmp_interval2 = copy_intervals (cur_intv, start2, len2);
 
          tmp_interval3 = validate_interval_range (buf, &startr1, &endr2, 0);
-         if (!NULL_INTERVAL_P (tmp_interval3))
+         if (tmp_interval3)
            set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3);
 
          /* holds region 2 */
@@ -4762,7 +4762,7 @@
           tmp_interval2 = copy_intervals (cur_intv, start2, len2);
 
          tmp_interval3 = validate_interval_range (buf, &startr1, &endr2, 0);
-         if (!NULL_INTERVAL_P (tmp_interval3))
+         if (tmp_interval3)
            set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3);
 
          /* holds region 1 */

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2012-08-07 07:33:18 +0000
+++ b/src/fileio.c      2012-08-08 06:11:29 +0000
@@ -3145,7 +3145,7 @@
     set_buffer_internal (XBUFFER (buffer));
   adjust_markers_for_delete (BEG, BEG_BYTE, Z, Z_BYTE);
   adjust_overlays_for_delete (BEG, Z - BEG);
-  BUF_INTERVALS (current_buffer) = 0;
+  BUF_INTERVALS (current_buffer) = NULL;
   TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
 
   /* Now we are safe to change the buffer's multibyteness directly.  */

=== modified file 'src/fns.c'
--- a/src/fns.c 2012-08-07 13:37:21 +0000
+++ b/src/fns.c 2012-08-08 06:11:29 +0000
@@ -628,7 +628,7 @@
          ptrdiff_t thislen_byte = SBYTES (this);
 
          memcpy (SDATA (val) + toindex_byte, SDATA (this), SBYTES (this));
-         if (! NULL_INTERVAL_P (STRING_INTERVALS (this)))
+         if (STRING_INTERVALS (this))
            {
              textprops[num_textprops].argnum = argnum;
              textprops[num_textprops].from = 0;
@@ -640,7 +640,7 @@
       /* Copy a single-byte string to a multibyte string.  */
       else if (STRINGP (this) && STRINGP (val))
        {
-         if (! NULL_INTERVAL_P (STRING_INTERVALS (this)))
+         if (STRING_INTERVALS (this))
            {
              textprops[num_textprops].argnum = argnum;
              textprops[num_textprops].from = 0;
@@ -1060,7 +1060,7 @@
        str_as_multibyte (SDATA (new_string), nbytes,
                          SBYTES (string), NULL);
       string = new_string;
-      STRING_SET_INTERVALS (string, NULL_INTERVAL);
+      STRING_SET_INTERVALS (string, NULL);
     }
   return string;
 }

=== modified file 'src/insdel.c'
--- a/src/insdel.c      2012-08-07 07:33:18 +0000
+++ b/src/insdel.c      2012-08-08 06:11:29 +0000
@@ -844,10 +844,10 @@
                             PT + nchars, PT_BYTE + nbytes,
                             before_markers);
 
-  if (BUF_INTERVALS (current_buffer) != 0)
+  if (BUF_INTERVALS (current_buffer))
     offset_intervals (current_buffer, PT, nchars);
 
-  if (!inherit && BUF_INTERVALS (current_buffer) != 0)
+  if (!inherit && BUF_INTERVALS (current_buffer))
     set_text_properties (make_number (PT), make_number (PT + nchars),
                         Qnil, Qnil, Qnil);
 
@@ -1017,10 +1017,10 @@
   adjust_markers_for_insert (GPT - nchars, GPT_BYTE - nbytes,
                             GPT, GPT_BYTE, 0);
 
-  if (BUF_INTERVALS (current_buffer) != 0)
+  if (BUF_INTERVALS (current_buffer))
     {
       offset_intervals (current_buffer, GPT - nchars, nchars);
-      graft_intervals_into_buffer (NULL_INTERVAL, GPT - nchars, nchars,
+      graft_intervals_into_buffer (NULL, GPT - nchars, nchars,
                                   current_buffer, 0);
     }
 
@@ -1157,7 +1157,7 @@
                             PT_BYTE + outgoing_nbytes,
                             0);
 
-  if (BUF_INTERVALS (current_buffer) != 0)
+  if (BUF_INTERVALS (current_buffer))
     offset_intervals (current_buffer, PT, nchars);
 
   /* Get the intervals for the part of the string we are inserting.  */
@@ -1225,7 +1225,7 @@
     adjust_overlays_for_insert (from, len - nchars_del);
   else if (len < nchars_del)
     adjust_overlays_for_delete (from, nchars_del - len);
-  if (BUF_INTERVALS (current_buffer) != 0)
+  if (BUF_INTERVALS (current_buffer))
     {
       offset_intervals (current_buffer, from, len - nchars_del);
     }
@@ -1823,7 +1823,7 @@
   if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
     ++windows_or_buffers_changed;
 
-  if (BUF_INTERVALS (current_buffer) != 0)
+  if (BUF_INTERVALS (current_buffer))
     {
       if (preserve_ptr)
        {

=== modified file 'src/intervals.c'
--- a/src/intervals.c   2012-08-08 05:23:02 +0000
+++ b/src/intervals.c   2012-08-08 06:11:29 +0000
@@ -207,10 +207,10 @@
 traverse_intervals_noorder (INTERVAL tree, void (*function) (INTERVAL, 
Lisp_Object), Lisp_Object arg)
 {
   /* Minimize stack usage.  */
-  while (!NULL_INTERVAL_P (tree))
+  while (tree)
     {
       (*function) (tree, arg);
-      if (NULL_INTERVAL_P (tree->right))
+      if (!tree->right)
        tree = tree->left;
       else
        {
@@ -227,7 +227,7 @@
 traverse_intervals (INTERVAL tree, ptrdiff_t position,
                    void (*function) (INTERVAL, Lisp_Object), Lisp_Object arg)
 {
-  while (!NULL_INTERVAL_P (tree))
+  while (tree)
     {
       traverse_intervals (tree->left, position, function, arg);
       position += LEFT_TOTAL_LENGTH (tree);
@@ -262,7 +262,7 @@
 {
   icount = 0;
   search_interval = i;
-  found_interval = NULL_INTERVAL;
+  found_interval = NULL;
   traverse_intervals_noorder (tree, &check_for_interval, Qnil);
   return found_interval;
 }
@@ -333,7 +333,7 @@
 
   /* Make A point to c */
   interval_set_left (interval, i);
-  if (! NULL_INTERVAL_P (i))
+  if (i)
     interval_set_parent (i, interval);
 
   /* A's total length is decreased by the length of B and its left child.  */
@@ -380,7 +380,7 @@
 
   /* Make A point to c */
   interval_set_right (interval, i);
-  if (! NULL_INTERVAL_P (i))
+  if (i)
     interval_set_parent (i, interval);
 
   /* A's total length is decreased by the length of B and its right child.  */
@@ -480,12 +480,9 @@
 INTERVAL
 balance_intervals (INTERVAL tree)
 {
-  if (tree == NULL_INTERVAL)
-    return NULL_INTERVAL;
+  return tree ? balance_intervals_internal (tree) : NULL;
+}
 
-  return balance_intervals_internal (tree);
-}
-
 /* Split INTERVAL into two pieces, starting the second piece at
    character position OFFSET (counting from 0), relative to INTERVAL.
    INTERVAL becomes the left-hand piece, and the right-hand piece
@@ -589,7 +586,7 @@
 {
   Lisp_Object parent;
 
-  if (NULL_INTERVAL_P (source))
+  if (!source)
     return 0;
 
   if (! INTERVAL_HAS_OBJECT (source))
@@ -617,8 +614,8 @@
                     to POSITION.  */
   register ptrdiff_t relative_position;
 
-  if (NULL_INTERVAL_P (tree))
-    return NULL_INTERVAL;
+  if (!tree)
+    return NULL;
 
   relative_position = position;
   if (INTERVAL_HAS_OBJECT (tree))
@@ -669,8 +666,8 @@
   register INTERVAL i = interval;
   register ptrdiff_t next_position;
 
-  if (NULL_INTERVAL_P (i))
-    return NULL_INTERVAL;
+  if (!i)
+    return NULL;
   next_position = interval->position + LENGTH (interval);
 
   if (! NULL_RIGHT_CHILD (i))
@@ -695,7 +692,7 @@
       i = INTERVAL_PARENT (i);
     }
 
-  return NULL_INTERVAL;
+  return NULL;
 }
 
 /* Find the preceding interval (lexicographically) to INTERVAL.
@@ -707,8 +704,8 @@
 {
   register INTERVAL i;
 
-  if (NULL_INTERVAL_P (interval))
-    return NULL_INTERVAL;
+  if (!interval)
+    return NULL;
 
   if (! NULL_LEFT_CHILD (interval))
     {
@@ -733,7 +730,7 @@
       i = INTERVAL_PARENT (i);
     }
 
-  return NULL_INTERVAL;
+  return NULL;
 }
 
 /* Find the interval containing POS given some non-NULL INTERVAL
@@ -744,8 +741,8 @@
 INTERVAL
 update_interval (register INTERVAL i, ptrdiff_t pos)
 {
-  if (NULL_INTERVAL_P (i))
-    return NULL_INTERVAL;
+  if (!i)
+    return NULL;
 
   while (1)
     {
@@ -938,8 +935,8 @@
          struct interval newi;
 
          RESET_INTERVAL (&newi);
-         pleft = NULL_INTERVAL_P (prev) ? Qnil : prev->plist;
-         pright = NULL_INTERVAL_P (i) ? Qnil : i->plist;
+         pleft = prev ? prev->plist : Qnil;
+         pright = i ? i->plist : Qnil;
          interval_set_plist (&newi, merge_properties_sticky (pleft, pright));
 
          if (! prev) /* i.e. position == BEG */
@@ -954,8 +951,7 @@
            {
              prev = split_interval_right (prev, position - prev->position);
              interval_set_plist (prev, newi.plist);
-             if (! NULL_INTERVAL_P (i)
-                 && intervals_equal (prev, i))
+             if (i && intervals_equal (prev, i))
                merge_interval_right (prev);
            }
 
@@ -1164,16 +1160,16 @@
   register INTERVAL migrate, this;
   register ptrdiff_t migrate_amt;
 
-  if (NULL_INTERVAL_P (i->left))
+  if (!i->left)
     return i->right;
-  if (NULL_INTERVAL_P (i->right))
+  if (!i->right)
     return i->left;
 
   migrate = i->left;
   migrate_amt = i->left->total_length;
   this = i->right;
   this->total_length += migrate_amt;
-  while (! NULL_INTERVAL_P (this->left))
+  while (this->left)
     {
       this = this->left;
       this->total_length += migrate_amt;
@@ -1204,7 +1200,7 @@
       Lisp_Object owner;
       GET_INTERVAL_OBJECT (owner, i);
       parent = delete_node (i);
-      if (! NULL_INTERVAL_P (parent))
+      if (parent)
        interval_set_object (parent, owner);
 
       if (BUFFERP (owner))
@@ -1221,13 +1217,13 @@
   if (AM_LEFT_CHILD (i))
     {
       interval_set_left (parent, delete_node (i));
-      if (! NULL_INTERVAL_P (parent->left))
+      if (parent->left)
        interval_set_parent (parent->left, parent);
     }
   else
     {
       interval_set_right (parent, delete_node (i));
-      if (! NULL_INTERVAL_P (parent->right))
+      if (parent->right)
        interval_set_parent (parent->right, parent);
     }
 }
@@ -1250,7 +1246,7 @@
 {
   register ptrdiff_t relative_position = from;
 
-  if (NULL_INTERVAL_P (tree))
+  if (!tree)
     return 0;
 
   /* Left branch.  */
@@ -1317,7 +1313,7 @@
   GET_INTERVAL_OBJECT (parent, tree);
   offset = (BUFFERP (parent) ? BUF_BEG (XBUFFER (parent)) : 0);
 
-  if (NULL_INTERVAL_P (tree))
+  if (!tree)
     return;
 
   eassert (start <= offset + TOTAL_LENGTH (tree)
@@ -1325,7 +1321,7 @@
 
   if (length == TOTAL_LENGTH (tree))
     {
-      BUF_INTERVALS (buffer) = NULL_INTERVAL;
+      BUF_INTERVALS (buffer) = NULL;
       return;
     }
 
@@ -1345,7 +1341,7 @@
       tree = BUF_INTERVALS (buffer);
       if (left_to_delete == tree->total_length)
        {
-         BUF_INTERVALS (buffer) = NULL_INTERVAL;
+         BUF_INTERVALS (buffer) = NULL;
          return;
        }
     }
@@ -1363,7 +1359,7 @@
 void
 offset_intervals (struct buffer *buffer, ptrdiff_t start, ptrdiff_t length)
 {
-  if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0)
+  if (!BUF_INTERVALS (buffer) || length == 0)
     return;
 
   if (length > 0)
@@ -1580,17 +1576,17 @@
      becomes part of whatever interval it was inserted into.
      To prevent inheritance, we must clear out the properties
      of the newly inserted text.  */
-  if (NULL_INTERVAL_P (source))
+  if (!source)
     {
       Lisp_Object buf;
-      if (!inherit && !NULL_INTERVAL_P (tree) && length > 0)
+      if (!inherit && tree && length > 0)
        {
          XSETBUFFER (buf, buffer);
          set_text_properties_1 (make_number (position),
                                 make_number (position + length),
                                 Qnil, buf, 0);
        }
-      if (! NULL_INTERVAL_P (BUF_INTERVALS (buffer)))
+      if (BUF_INTERVALS (buffer))
        /* Shouldn't be necessary.  --Stef  */
        BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer));
       return;
@@ -1608,7 +1604,7 @@
       eassert (BUF_INTERVALS (buffer)->up_obj == 1);
          return;
        }
-  else if (NULL_INTERVAL_P (tree))
+  else if (!tree)
     { /* Create an interval tree in which to place a copy
         of the intervals of the inserted string.  */
        Lisp_Object buf;
@@ -1620,7 +1616,7 @@
   eassert (TOTAL_LENGTH (tree) > 0);
 
   this = under = find_interval (tree, position);
-  eassert (!NULL_INTERVAL_P (under));
+  eassert (under);
   over = find_interval (source, interval_start_pos (source));
 
   /* Here for insertion in the middle of an interval.
@@ -1662,7 +1658,7 @@
      have already been copied into target intervals.
      UNDER is the next interval in the target.  */
   over_used = 0;
-  while (! NULL_INTERVAL_P (over))
+  while (over)
     {
       /* If UNDER is longer than OVER, split it.  */
       if (LENGTH (over) - over_used < LENGTH (under))
@@ -1695,7 +1691,7 @@
       under = next_interval (this);
     }
 
-  if (! NULL_INTERVAL_P (BUF_INTERVALS (buffer)))
+  if (BUF_INTERVALS (buffer))
     BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer));
   return;
 }
@@ -1864,7 +1860,7 @@
 
   /* If we have no text properties and overlays,
      then we can do it quickly.  */
-  if (NULL_INTERVAL_P (BUF_INTERVALS (current_buffer)) && ! have_overlays)
+  if (!BUF_INTERVALS (current_buffer) && ! have_overlays)
     {
       temp_set_point_both (current_buffer, charpos, bytepos);
       return;
@@ -1911,7 +1907,7 @@
      with the same intangible property value,
      move forward or backward until a change in that property.  */
   if (NILP (Vinhibit_point_motion_hooks)
-      && ((! NULL_INTERVAL_P (to) && ! NULL_INTERVAL_P (toprev))
+      && ((to && toprev)
          || have_overlays)
       /* Intangibility never stops us from positioning at the beginning
         or end of the buffer, so don't bother checking in that case.  */
@@ -2134,7 +2130,7 @@
   else
     abort ();
 
-  if (NULL_INTERVAL_P (i) || (i->position + LENGTH (i) <= pos))
+  if (!i || (i->position + LENGTH (i) <= pos))
     return 0;
   *val = textget (i->plist, prop);
   if (NILP (*val))
@@ -2142,14 +2138,13 @@
 
   next = i;                    /* remember it in advance */
   prev = previous_interval (i);
-  while (! NULL_INTERVAL_P (prev)
+  while (prev
         && EQ (*val, textget (prev->plist, prop)))
     i = prev, prev = previous_interval (prev);
   *start = i->position;
 
   next = next_interval (i);
-  while (! NULL_INTERVAL_P (next)
-        && EQ (*val, textget (next->plist, prop)))
+  while (next && EQ (*val, textget (next->plist, prop)))
     i = next, next = next_interval (next);
   *end = i->position + LENGTH (i);
 
@@ -2220,16 +2215,16 @@
   register INTERVAL i, new, t;
   register ptrdiff_t got, prevlen;
 
-  if (NULL_INTERVAL_P (tree) || length <= 0)
-    return NULL_INTERVAL;
+  if (!tree || length <= 0)
+    return NULL;
 
   i = find_interval (tree, start);
-  eassert (!NULL_INTERVAL_P (i) && LENGTH (i) > 0);
+  eassert (i && LENGTH (i) > 0);
 
   /* If there is only one interval and it's the default, return nil.  */
   if ((start - i->position + 1 + length) < LENGTH (i)
       && DEFAULT_INTERVAL_P (i))
-    return NULL_INTERVAL;
+    return NULL;
 
   new = make_interval ();
   new->position = 0;
@@ -2260,7 +2255,7 @@
 {
   INTERVAL interval_copy = copy_intervals (BUF_INTERVALS (buffer),
                                           position, length);
-  if (NULL_INTERVAL_P (interval_copy))
+  if (!interval_copy)
     return;
 
   interval_set_object (interval_copy, string);

=== modified file 'src/intervals.h'
--- a/src/intervals.h   2012-08-08 05:23:02 +0000
+++ b/src/intervals.h   2012-08-08 06:11:29 +0000
@@ -20,9 +20,6 @@
 
 INLINE_HEADER_BEGIN
 
-#define NULL_INTERVAL ((INTERVAL)0)
-#define INTERVAL_DEFAULT NULL_INTERVAL
-
 /* Basic data type for use of intervals.  */
 
 struct interval
@@ -63,28 +60,25 @@
 
 /* These are macros for dealing with the interval tree.  */
 
-#define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL)
-
 /* True if this interval has no right child.  */
-#define NULL_RIGHT_CHILD(i) ((i)->right == NULL_INTERVAL)
+#define NULL_RIGHT_CHILD(i) ((i)->right == NULL)
 
 /* True if this interval has no left child.  */
-#define NULL_LEFT_CHILD(i) ((i)->left == NULL_INTERVAL)
+#define NULL_LEFT_CHILD(i) ((i)->left == NULL)
 
 /* True if this interval has no parent.  */
 #define NULL_PARENT(i) ((i)->up_obj || (i)->up.interval == 0)
 
 /* True if this interval is the left child of some other interval.  */
-#define AM_LEFT_CHILD(i) (! NULL_PARENT (i) \
-                         && INTERVAL_PARENT (i)->left == (i))
+#define AM_LEFT_CHILD(i)                                       \
+  (! NULL_PARENT (i) && INTERVAL_PARENT (i)->left == (i))
 
 /* True if this interval is the right child of some other interval.  */
-#define AM_RIGHT_CHILD(i) (! NULL_PARENT (i) \
-                          && INTERVAL_PARENT (i)->right == (i))
+#define AM_RIGHT_CHILD(i)                                      \
+  (! NULL_PARENT (i) && INTERVAL_PARENT (i)->right == (i))
 
 /* True if this interval has no children.  */
-#define LEAF_INTERVAL_P(i) ((i)->left == NULL_INTERVAL \
-                           && (i)->right == NULL_INTERVAL)
+#define LEAF_INTERVAL_P(i) ((i)->left == NULL && (i)->right == NULL)
 
 /* True if this interval has no parent and is therefore the root.  */
 #define ROOT_INTERVAL_P(i) (NULL_PARENT (i))
@@ -93,17 +87,16 @@
 #define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P ((i)) && LEAF_INTERVAL_P ((i)))
 
 /* True if this interval has both left and right children.  */
-#define BOTH_KIDS_P(i) ((i)->left != NULL_INTERVAL     \
-                       && (i)->right != NULL_INTERVAL)
+#define BOTH_KIDS_P(i) ((i)->left != NULL && (i)->right != NULL)
 
 /* The total size of all text represented by this interval and all its
    children in the tree.   This is zero if the interval is null.  */
-#define TOTAL_LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (i)->total_length)
+#define TOTAL_LENGTH(i) ((i) == NULL ? 0 : (i)->total_length)
 
 /* The size of text represented by this interval alone.  */
-#define LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (TOTAL_LENGTH ((i))          \
-                                              - TOTAL_LENGTH ((i)->right) \
-                                              - TOTAL_LENGTH ((i)->left)))
+#define LENGTH(i) ((i) == NULL ? 0 : (TOTAL_LENGTH ((i))               \
+                                     - TOTAL_LENGTH ((i)->right)       \
+                                     - TOTAL_LENGTH ((i)->left)))
 
 /* The position of the character just past the end of I.  Note that
    the position cache i->position must be valid for this to work.  */
@@ -115,15 +108,14 @@
 /* The total size of the right subtree of this interval.  */
 #define RIGHT_TOTAL_LENGTH(i) ((i)->right ? (i)->right->total_length : 0)
 
-
 /* These macros are for dealing with the interval properties.  */
 
 /* True if this is a default interval, which is the same as being null
    or having no properties.  */
-#define DEFAULT_INTERVAL_P(i) (NULL_INTERVAL_P (i) || EQ ((i)->plist, Qnil))
+#define DEFAULT_INTERVAL_P(i) (!i || EQ ((i)->plist, Qnil))
 
 /* Test what type of parent we have.  Three possibilities: another
-   interval, a buffer or string object, or NULL_INTERVAL.  */
+   interval, a buffer or string object, or NULL.  */
 #define INTERVAL_HAS_PARENT(i) ((i)->up_obj == 0 && (i)->up.interval != 0)
 #define INTERVAL_HAS_OBJECT(i) ((i)->up_obj)
 
@@ -187,7 +179,7 @@
 
 /* Get the parent interval, if any, otherwise a null pointer.  Useful
    for walking up to the root in a "for" loop; use this to get the
-   "next" value, and test the result to see if it's NULL_INTERVAL.  */
+   "next" value, and test the result to see if it's NULL.  */
 #define INTERVAL_PARENT_OR_NULL(i) \
    (INTERVAL_HAS_PARENT (i) ? INTERVAL_PARENT (i) : 0)
 
@@ -195,8 +187,8 @@
 #define RESET_INTERVAL(i)                    \
 {                                            \
   (i)->total_length = (i)->position = 0;      \
-  (i)->left = (i)->right = NULL_INTERVAL;     \
-  interval_set_parent (i, NULL_INTERVAL);     \
+  (i)->left = (i)->right = NULL;             \
+  interval_set_parent (i, NULL);             \
   (i)->write_protect = 0;                    \
   (i)->visible = 0;                          \
   (i)->front_sticky = (i)->rear_sticky = 0;   \
@@ -232,39 +224,36 @@
 
 /* Is this interval visible?  Replace later with cache access.  */
 #define INTERVAL_VISIBLE_P(i) \
-  (! NULL_INTERVAL_P (i) && NILP (textget ((i)->plist, Qinvisible)))
+  (i && NILP (textget ((i)->plist, Qinvisible)))
 
 /* Is this interval writable?  Replace later with cache access.  */
 #define INTERVAL_WRITABLE_P(i)                                 \
-  (! NULL_INTERVAL_P (i)                                       \
-   && (NILP (textget ((i)->plist, Qread_only))                 \
-       || ((CONSP (Vinhibit_read_only)                         \
-           ? !NILP (Fmemq (textget ((i)->plist, Qread_only),   \
-                           Vinhibit_read_only))                \
-           : !NILP (Vinhibit_read_only)))))                    \
+  (i && (NILP (textget ((i)->plist, Qread_only))               \
+        || ((CONSP (Vinhibit_read_only)                        \
+             ? !NILP (Fmemq (textget ((i)->plist, Qread_only), \
+                             Vinhibit_read_only))              \
+             : !NILP (Vinhibit_read_only)))))                  \
 
 /* Macros to tell whether insertions before or after this interval
-   should stick to it.  */
-/* Replace later with cache access */
-/*#define FRONT_STICKY_P(i) ((i)->front_sticky != 0)
-  #define END_STICKY_P(i) ((i)->rear_sticky != 0)*/
-/* As we now have Vtext_property_default_nonsticky, these macros are
-   unreliable now.  Currently, they are never used.  */
-#define FRONT_STICKY_P(i) \
-  (! NULL_INTERVAL_P (i) && ! NILP (textget ((i)->plist, Qfront_sticky)))
-#define END_NONSTICKY_P(i) \
-  (! NULL_INTERVAL_P (i) && ! NILP (textget ((i)->plist, Qrear_nonsticky)))
-#define FRONT_NONSTICKY_P(i) \
-  (! NULL_INTERVAL_P (i) && ! EQ (Qt, textget ((i)->plist, Qfront_sticky)))
+   should stick to it.  Now we have Vtext_property_default_nonsticky,
+   so these macros are unreliable now and never used.  */
 
+#if 0
+#define FRONT_STICKY_P(i)                              \
+  (i && ! NILP (textget ((i)->plist, Qfront_sticky)))
+#define END_NONSTICKY_P(i)                             \
+  (i && ! NILP (textget ((i)->plist, Qrear_nonsticky)))
+#define FRONT_NONSTICKY_P(i)                           \
+  (i && ! EQ (Qt, textget ((i)->plist, Qfront_sticky)))
+#endif
 
 /* If PROP is the `invisible' property of a character,
    this is 1 if the character should be treated as invisible,
    and 2 if it is invisible but with an ellipsis.  */
 
-#define TEXT_PROP_MEANS_INVISIBLE(prop)                                \
+#define TEXT_PROP_MEANS_INVISIBLE(prop)                                        
\
   (EQ (BVAR (current_buffer, invisibility_spec), Qt)                   \
-   ? !NILP (prop)                                              \
+   ? !NILP (prop)                                                      \
    : invisible_p (prop, BVAR (current_buffer, invisibility_spec)))
 
 /* Declared in alloc.c.  */

=== modified file 'src/print.c'
--- a/src/print.c       2012-08-07 07:42:34 +0000
+++ b/src/print.c       2012-08-08 06:11:29 +0000
@@ -1408,7 +1408,7 @@
          if (! EQ (Vprint_charset_text_property, Qt))
            obj = print_prune_string_charset (obj);
 
-         if (!NULL_INTERVAL_P (STRING_INTERVALS (obj)))
+         if (STRING_INTERVALS (obj))
            {
              PRINTCHAR ('#');
              PRINTCHAR ('(');
@@ -1499,7 +1499,7 @@
            }
          PRINTCHAR ('\"');
 
-         if (!NULL_INTERVAL_P (STRING_INTERVALS (obj)))
+         if (STRING_INTERVALS (obj))
            {
              traverse_intervals (STRING_INTERVALS (obj),
                                  0, print_interval, printcharfun);

=== modified file 'src/syntax.c'
--- a/src/syntax.c      2012-08-04 14:33:00 +0000
+++ b/src/syntax.c      2012-08-08 06:11:29 +0000
@@ -171,7 +171,7 @@
    direction than the intervals - or in an interval.  We update the
    current syntax-table basing on the property of this interval, and
    update the interval to start further than CHARPOS - or be
-   NULL_INTERVAL.  We also update lim_property to be the next value of
+   NULL.  We also update lim_property to be the next value of
    charpos to call this subroutine again - or be before/after the
    start/end of OBJECT.  */
 
@@ -192,7 +192,7 @@
       i = interval_of (charpos, object);
       gl_state.backward_i = gl_state.forward_i = i;
       invalidate = 0;
-      if (NULL_INTERVAL_P (i))
+      if (!i)
        return;
       /* interval_of updates only ->position of the return value, so
         update the parents manually to speed up update_interval.  */
@@ -217,7 +217,7 @@
 
   /* We are guaranteed to be called with CHARPOS either in i,
      or further off.  */
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     error ("Error in syntax_table logic for to-the-end intervals");
   else if (charpos < i->position)              /* Move left.  */
     {
@@ -287,7 +287,7 @@
        }
     }
 
-  while (!NULL_INTERVAL_P (i))
+  while (i)
     {
       if (cnt && !EQ (tmp_table, textget (i->plist, Qsyntax_table)))
        {
@@ -313,7 +313,7 @@
                /* e_property at EOB is not set to ZV but to ZV+1, so that
                   we can do INC(from);UPDATE_SYNTAX_TABLE_FORWARD without
                   having to check eob between the two.  */
-               + (NULL_INTERVAL_P (next_interval (i)) ? 1 : 0);
+               + (next_interval (i) ? 0 : 1);
              gl_state.forward_i = i;
            }
          else
@@ -326,7 +326,7 @@
       cnt++;
       i = count > 0 ? next_interval (i) : previous_interval (i);
     }
-  eassert (NULL_INTERVAL_P (i)); /* This property goes to the end.  */
+  eassert (i == NULL); /* This property goes to the end.  */
   if (count > 0)
     gl_state.e_property = gl_state.stop;
   else

=== modified file 'src/textprop.c'
--- a/src/textprop.c    2012-08-07 11:28:41 +0000
+++ b/src/textprop.c    2012-08-08 06:11:29 +0000
@@ -105,7 +105,7 @@
    Fprevious_property_change which call this function with BEGIN == END.
    Handle this case specially.
 
-   If FORCE is soft (0), it's OK to return NULL_INTERVAL.  Otherwise,
+   If FORCE is soft (0), it's OK to return NULL.  Otherwise,
    create an interval tree for OBJECT if one doesn't exist, provided
    the object actually contains text.  In the current design, if there
    is no text, there can be no text properties.  */
@@ -126,7 +126,7 @@
   /* If we are asked for a point, but from a subr which operates
      on a range, then return nothing.  */
   if (EQ (*begin, *end) && begin != end)
-    return NULL_INTERVAL;
+    return NULL;
 
   if (XINT (*begin) > XINT (*end))
     {
@@ -147,7 +147,7 @@
 
       /* If there's no text, there are no properties.  */
       if (BUF_BEGV (b) == BUF_ZV (b))
-       return NULL_INTERVAL;
+       return NULL;
 
       searchpos = XINT (*begin);
     }
@@ -164,12 +164,12 @@
       i = STRING_INTERVALS (object);
 
       if (len == 0)
-       return NULL_INTERVAL;
+       return NULL;
 
       searchpos = XINT (*begin);
     }
 
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     return (force ? create_root_interval (object) : i);
 
   return find_interval (i, searchpos);
@@ -500,7 +500,7 @@
   if (NILP (object))
     XSETBUFFER (object, current_buffer);
   else if (EQ (object, Qt))
-    return NULL_INTERVAL;
+    return NULL;
 
   CHECK_STRING_OR_BUFFER (object);
 
@@ -521,8 +521,8 @@
 
   if (!(beg <= position && position <= end))
     args_out_of_range (make_number (position), make_number (position));
-  if (beg == end || NULL_INTERVAL_P (i))
-    return NULL_INTERVAL;
+  if (beg == end || !i)
+    return NULL;
 
   return find_interval (i, position);
 }
@@ -542,7 +542,7 @@
     XSETBUFFER (object, current_buffer);
 
   i = validate_interval_range (object, &position, &position, soft);
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     return Qnil;
   /* If POSITION is at the end of the interval,
      it means it's the end of OBJECT.
@@ -922,12 +922,12 @@
      bother checking further intervals.  */
   if (EQ (limit, Qt))
     {
-      if (NULL_INTERVAL_P (i))
+      if (!i)
        next = i;
       else
        next = next_interval (i);
 
-      if (NULL_INTERVAL_P (next))
+      if (!next)
        XSETFASTINT (position, (STRINGP (object)
                                ? SCHARS (object)
                                : BUF_ZV (XBUFFER (object))));
@@ -936,16 +936,16 @@
       return position;
     }
 
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     return limit;
 
   next = next_interval (i);
 
-  while (!NULL_INTERVAL_P (next) && intervals_equal (i, next)
+  while (next && intervals_equal (i, next)
         && (NILP (limit) || next->position < XFASTINT (limit)))
     next = next_interval (next);
 
-  if (NULL_INTERVAL_P (next)
+  if (!next
       || (next->position
          >= (INTEGERP (limit)
              ? XFASTINT (limit)
@@ -983,17 +983,17 @@
     CHECK_NUMBER_COERCE_MARKER (limit);
 
   i = validate_interval_range (object, &position, &position, soft);
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     return limit;
 
   here_val = textget (i->plist, prop);
   next = next_interval (i);
-  while (! NULL_INTERVAL_P (next)
+  while (next
         && EQ (here_val, textget (next->plist, prop))
         && (NILP (limit) || next->position < XFASTINT (limit)))
     next = next_interval (next);
 
-  if (NULL_INTERVAL_P (next)
+  if (!next
       || (next->position
          >= (INTEGERP (limit)
              ? XFASTINT (limit)
@@ -1029,7 +1029,7 @@
     CHECK_NUMBER_COERCE_MARKER (limit);
 
   i = validate_interval_range (object, &position, &position, soft);
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     return limit;
 
   /* Start with the interval containing the char before point.  */
@@ -1037,12 +1037,12 @@
     i = previous_interval (i);
 
   previous = previous_interval (i);
-  while (!NULL_INTERVAL_P (previous) && intervals_equal (previous, i)
+  while (previous && intervals_equal (previous, i)
         && (NILP (limit)
             || (previous->position + LENGTH (previous) > XFASTINT (limit))))
     previous = previous_interval (previous);
 
-  if (NULL_INTERVAL_P (previous)
+  if (!previous
       || (previous->position + LENGTH (previous)
          <= (INTEGERP (limit)
              ? XFASTINT (limit)
@@ -1080,21 +1080,21 @@
   i = validate_interval_range (object, &position, &position, soft);
 
   /* Start with the interval containing the char before point.  */
-  if (!NULL_INTERVAL_P (i) && i->position == XFASTINT (position))
+  if (i && i->position == XFASTINT (position))
     i = previous_interval (i);
 
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     return limit;
 
   here_val = textget (i->plist, prop);
   previous = previous_interval (i);
-  while (!NULL_INTERVAL_P (previous)
+  while (previous
         && EQ (here_val, textget (previous->plist, prop))
         && (NILP (limit)
             || (previous->position + LENGTH (previous) > XFASTINT (limit))))
     previous = previous_interval (previous);
 
-  if (NULL_INTERVAL_P (previous)
+  if (!previous
       || (previous->position + LENGTH (previous)
          <= (INTEGERP (limit)
              ? XFASTINT (limit)
@@ -1130,7 +1130,7 @@
     XSETBUFFER (object, current_buffer);
 
   i = validate_interval_range (object, &start, &end, hard);
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     return Qnil;
 
   s = XINT (start);
@@ -1277,13 +1277,13 @@
       if (! STRING_INTERVALS (object))
        return Qnil;
 
-      STRING_SET_INTERVALS (object, NULL_INTERVAL);
+      STRING_SET_INTERVALS (object, NULL);
       return Qt;
     }
 
   i = validate_interval_range (object, &start, &end, soft);
 
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     {
       /* If buffer has no properties, and we want none, return now.  */
       if (NILP (properties))
@@ -1296,7 +1296,7 @@
 
       i = validate_interval_range (object, &start, &end, hard);
       /* This can return if start == end.  */
-      if (NULL_INTERVAL_P (i))
+      if (!i)
        return Qnil;
     }
 
@@ -1321,7 +1321,7 @@
 void
 set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object 
properties, Lisp_Object buffer, INTERVAL i)
 {
-  register INTERVAL prev_changed = NULL_INTERVAL;
+  register INTERVAL prev_changed = NULL;
   register ptrdiff_t s, len;
   INTERVAL unchanged;
 
@@ -1378,7 +1378,7 @@
             merge the intervals, so as to make the undo records
             and cause redisplay to happen.  */
          set_properties (properties, i, buffer);
-         if (!NULL_INTERVAL_P (prev_changed))
+         if (prev_changed)
            merge_interval_left (i);
          return;
        }
@@ -1389,7 +1389,7 @@
         merge the intervals, so as to make the undo records
         and cause redisplay to happen.  */
       set_properties (properties, i, buffer);
-      if (NULL_INTERVAL_P (prev_changed))
+      if (!prev_changed)
        prev_changed = i;
       else
        prev_changed = i = merge_interval_left (i);
@@ -1421,7 +1421,7 @@
     XSETBUFFER (object, current_buffer);
 
   i = validate_interval_range (object, &start, &end, soft);
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     return Qnil;
 
   s = XINT (start);
@@ -1508,7 +1508,7 @@
     XSETBUFFER (object, current_buffer);
 
   i = validate_interval_range (object, &start, &end, soft);
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     return Qnil;
 
   s = XINT (start);
@@ -1613,11 +1613,11 @@
   if (NILP (object))
     XSETBUFFER (object, current_buffer);
   i = validate_interval_range (object, &start, &end, soft);
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     return (!NILP (value) || EQ (start, end) ? Qnil : start);
   e = XINT (end);
 
-  while (! NULL_INTERVAL_P (i))
+  while (i)
     {
       if (i->position >= e)
        break;
@@ -1649,12 +1649,12 @@
   if (NILP (object))
     XSETBUFFER (object, current_buffer);
   i = validate_interval_range (object, &start, &end, soft);
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     return (NILP (value) || EQ (start, end)) ? Qnil : start;
   s = XINT (start);
   e = XINT (end);
 
-  while (! NULL_INTERVAL_P (i))
+  while (i)
     {
       if (i->position >= e)
        break;
@@ -1759,7 +1759,7 @@
   struct gcpro gcpro1, gcpro2;
 
   i = validate_interval_range (src, &start, &end, soft);
-  if (NULL_INTERVAL_P (i))
+  if (!i)
     return Qnil;
 
   CHECK_NUMBER_COERCE_MARKER (pos);
@@ -1811,7 +1811,7 @@
        }
 
       i = next_interval (i);
-      if (NULL_INTERVAL_P (i))
+      if (!i)
        break;
 
       p += len;
@@ -1852,7 +1852,7 @@
   result = Qnil;
 
   i = validate_interval_range (object, &start, &end, soft);
-  if (!NULL_INTERVAL_P (i))
+  if (i)
     {
       ptrdiff_t s = XINT (start);
       ptrdiff_t e = XINT (end);
@@ -1884,7 +1884,7 @@
                            result);
 
          i = next_interval (i);
-         if (NULL_INTERVAL_P (i))
+         if (!i)
            break;
          s = i->position;
        }
@@ -2007,7 +2007,7 @@
   interval_insert_behind_hooks = Qnil;
   interval_insert_in_front_hooks = Qnil;
 
-  if (NULL_INTERVAL_P (intervals))
+  if (!intervals)
     return;
 
   if (start > end)
@@ -2048,7 +2048,7 @@
             indirectly defined via the category property.  */
          if (i != prev)
            {
-             if (! NULL_INTERVAL_P (i))
+             if (i)
                {
                  after = textget (i->plist, Qread_only);
 
@@ -2068,7 +2068,7 @@
                    }
                }
 
-             if (! NULL_INTERVAL_P (prev))
+             if (prev)
                {
                  before = textget (prev->plist, Qread_only);
 
@@ -2088,7 +2088,7 @@
                    }
                }
            }
-         else if (! NULL_INTERVAL_P (i))
+         else if (i)
            {
              after = textget (i->plist, Qread_only);
 
@@ -2115,10 +2115,10 @@
        }
 
       /* Run both insert hooks (just once if they're the same).  */
-      if (!NULL_INTERVAL_P (prev))
+      if (prev)
        interval_insert_behind_hooks
          = textget (prev->plist, Qinsert_behind_hooks);
-      if (!NULL_INTERVAL_P (i))
+      if (i)
        interval_insert_in_front_hooks
          = textget (i->plist, Qinsert_in_front_hooks);
     }
@@ -2146,7 +2146,7 @@
          i = next_interval (i);
        }
       /* Keep going thru the interval containing the char before END.  */
-      while (! NULL_INTERVAL_P (i) && i->position < end);
+      while (i && i->position < end);
 
       if (!inhibit_modification_hooks)
        {

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2012-08-07 07:42:34 +0000
+++ b/src/xdisp.c       2012-08-08 06:11:29 +0000
@@ -3321,7 +3321,7 @@
      interval if there isn't such an interval.  */
   position = make_number (charpos);
   iv = validate_interval_range (object, &position, &position, 0);
-  if (!NULL_INTERVAL_P (iv))
+  if (iv)
     {
       Lisp_Object values_here[LAST_PROP_IDX];
       struct props *p;
@@ -3333,7 +3333,7 @@
       /* Look for an interval following iv that has different
         properties.  */
       for (next_iv = next_interval (iv);
-          (!NULL_INTERVAL_P (next_iv)
+          (next_iv
            && (NILP (limit)
                || XFASTINT (limit) > next_iv->position));
           next_iv = next_interval (next_iv))
@@ -3351,7 +3351,7 @@
            break;
        }
 
-      if (!NULL_INTERVAL_P (next_iv))
+      if (next_iv)
        {
          if (INTEGERP (limit)
              && next_iv->position >= XFASTINT (limit))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]