2000-04-05 Ken Raeburn <raeburn@gnu.org>
+ * intervals.h (SET_INTERVAL_PARENT): Use INT_LISPLIKE to test for
+ a pointer that looks like a lisp object.
+ (SET_INTERVAL_OBJECT): Don't explicitly compare the object with
+ zero, instead see whether it's an integer object, since they can't
+ have intervals.
+ (GET_INTERVAL_OBJECT): Simply assign to the destination.
+
* dispnew.c (allocate_matrices_for_frame_redisplay,
direct_output_forward_char): Use X(U)INT and make_number as needed
to convert between (unsigned) int values and lisp integers.
The choice of macros is dependent on the type needed. Don't add
casts to get around this, it will break some development work in
progress. */
-#define SET_INTERVAL_PARENT(i,p) (eassert (!BUFFERP ((Lisp_Object)(p)) && !STRINGP ((Lisp_Object)(p))),(i)->up_obj = 0, (i)->up.interval = (p))
-#define SET_INTERVAL_OBJECT(i,o) (eassert ((o) != 0), eassert (BUFFERP (o) || STRINGP (o)),(i)->up_obj = 1, (i)->up.obj = (o))
+#define SET_INTERVAL_PARENT(i,p) (eassert (!INT_LISPLIKE (p)),(i)->up_obj = 0, (i)->up.interval = (p))
+#define SET_INTERVAL_OBJECT(i,o) (eassert (!INTEGERP (o)), eassert (BUFFERP (o) || STRINGP (o)),(i)->up_obj = 1, (i)->up.obj = (o))
#define INTERVAL_PARENT(i) (eassert((i) != 0 && (i)->up_obj == 0),(i)->up.interval)
-/* Because XSETFASTINT has to be used, this can't simply be
- value-returning. */
-#define GET_INTERVAL_OBJECT(d,s) (eassert((s)->up_obj == 1),XSETFASTINT ((d), (s)->up.obj))
+#define GET_INTERVAL_OBJECT(d,s) (eassert((s)->up_obj == 1), (d) = (s)->up.obj)
/* Make the parent of D be whatever the parent of S is, regardless of
type. This is used when balancing an interval tree. */