From: Ken Raeburn Date: Wed, 5 Apr 2000 18:53:39 +0000 (+0000) Subject: * intervals.h (SET_INTERVAL_PARENT): Use INT_LISPLIKE to test for a pointer X-Git-Tag: emacs-pretest-21.0.90~4321 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c0333abccb3e0997fad7d6a62bc317a49fbf6d07;p=emacs.git * 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index b42ccbb177a..b957c146a83 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2000-04-05 Ken Raeburn + * 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. diff --git a/src/intervals.h b/src/intervals.h index 5db02e78629..1a6bb341d0c 100644 --- a/src/intervals.h +++ b/src/intervals.h @@ -113,12 +113,10 @@ Boston, MA 02111-1307, USA. */ 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. */