Mercurial > emacs
diff src/lisp.h @ 112332:28ca83ef1128
Merge from mainline.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Mon, 17 Jan 2011 11:24:36 -0800 |
parents | deae5bb3f0f6 a805278575f4 |
children | 19348bd13f81 |
line wrap: on
line diff
--- a/src/lisp.h Mon Jan 17 11:20:37 2011 -0800 +++ b/src/lisp.h Mon Jan 17 11:24:36 2011 -0800 @@ -327,13 +327,14 @@ #define LISP_MAKE_RVALUE(o) (0+(o)) #endif /* USE_LISP_UNION_TYPE */ -/* In the size word of a vector, this bit means the vector has been marked. */ - -#define ARRAY_MARK_FLAG ((EMACS_UINT) 1 << (BITS_PER_EMACS_INT - 1)) +/* In the size word of a vector, this bit means the vector has been marked. + (Shift -1 left, not 1, to avoid provoking overflow diagnostics.) */ + +#define ARRAY_MARK_FLAG ((EMACS_INT) -1 << (BITS_PER_EMACS_INT - 1)) /* In the size word of a struct Lisp_Vector, this bit means it's really some other vector-like object. */ -#define PSEUDOVECTOR_FLAG ((ARRAY_MARK_FLAG >> 1)) +#define PSEUDOVECTOR_FLAG ((EMACS_INT) 1 << (BITS_PER_EMACS_INT - 2)) /* In a pseudovector, the size field actually contains a word with one PSEUDOVECTOR_FLAG bit set, and exactly one of the following bits to @@ -437,8 +438,9 @@ ((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS) #endif -#define XSET(var, type, ptr) \ - ((var) = ((EMACS_INT)(type) << VALBITS) + ((EMACS_INT) (ptr) & VALMASK)) +#define XSET(var, type, ptr) \ + ((var) = ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \ + + ((EMACS_INT) (ptr) & VALMASK))) #define XPNTR(a) ((EMACS_UINT) ((a) & VALMASK)) @@ -3671,4 +3673,3 @@ #endif /* EMACS_LISP_H */ -