X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fbuffer.h;h=6e3d980e41b61347bc72e889e70fb907242239ee;hp=11c037efcf1f0ce994afd722e984745ce77ad36c;hb=afa9772e3fcbb4e80e3e4cfd1a40b4fccc6d08b8;hpb=1e7fd761ecf5fd2208bde8e30fc6f7cbf789b7db diff --git a/src/buffer.h b/src/buffer.h index 11c037e..6e3d980 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -219,7 +219,6 @@ DECLARE_LRECORD (buffer, struct buffer); #define XBUFFER(x) XRECORD (x, buffer, struct buffer) #define XSETBUFFER(x, p) XSETRECORD (x, p, buffer) #define BUFFERP(x) RECORDP (x, buffer) -#define GC_BUFFERP(x) GC_RECORDP (x, buffer) #define CHECK_BUFFER(x) CHECK_RECORD (x, buffer) #define CONCHECK_BUFFER(x) CONCHECK_RECORD (x, buffer) @@ -568,7 +567,7 @@ XCHAR_OR_CHAR_INT (Lisp_Object obj) #else -#define XCHAR_OR_CHAR_INT(obj) (CHARP ((obj)) ? XCHAR ((obj)) : XINT ((obj))) +#define XCHAR_OR_CHAR_INT(obj) (CHARP (obj) ? XCHAR (obj) : XINT (obj)) #endif @@ -627,9 +626,9 @@ INLINE Bytind BI_BUF_PTR_BYTE_POS (struct buffer *buf, Bufbyte *ptr); INLINE Bytind BI_BUF_PTR_BYTE_POS (struct buffer *buf, Bufbyte *ptr) { - return ((ptr) - (buf)->text->beg + 1 - - ((ptr - (buf)->text->beg + 1) > (buf)->text->gpt - ? (buf)->text->gap_size : 0)); + return (ptr - buf->text->beg + 1 + - ((ptr - buf->text->beg + 1) > buf->text->gpt + ? buf->text->gap_size : 0)); } #define BUF_PTR_BYTE_POS(buf, ptr) \ @@ -640,8 +639,8 @@ INLINE Bufbyte * BI_BUF_BYTE_ADDRESS (struct buffer *buf, Bytind pos); INLINE Bufbyte * BI_BUF_BYTE_ADDRESS (struct buffer *buf, Bytind pos) { - return ((buf)->text->beg + - ((pos >= (buf)->text->gpt ? (pos + (buf)->text->gap_size) : pos) + return (buf->text->beg + + ((pos >= buf->text->gpt ? (pos + buf->text->gap_size) : pos) - 1)); } @@ -653,8 +652,8 @@ INLINE Bufbyte * BI_BUF_BYTE_ADDRESS_BEFORE (struct buffer *buf, Bytind pos); INLINE Bufbyte * BI_BUF_BYTE_ADDRESS_BEFORE (struct buffer *buf, Bytind pos) { - return ((buf)->text->beg + - ((pos > (buf)->text->gpt ? (pos + (buf)->text->gap_size) : pos) + return (buf->text->beg + + ((pos > buf->text->gpt ? (pos + buf->text->gap_size) : pos) - 2)); } @@ -669,16 +668,16 @@ INLINE int valid_memind_p (struct buffer *buf, Memind x); INLINE int valid_memind_p (struct buffer *buf, Memind x) { - return ((x >= 1 && x <= (Memind) (buf)->text->gpt) || - (x > (Memind) ((buf)->text->gpt + (buf)->text->gap_size) && - x <= (Memind) ((buf)->text->z + (buf)->text->gap_size))); + return ((x >= 1 && x <= (Memind) buf->text->gpt) || + (x > (Memind) (buf->text->gpt + buf->text->gap_size) && + x <= (Memind) (buf->text->z + buf->text->gap_size))); } INLINE Memind bytind_to_memind (struct buffer *buf, Bytind x); INLINE Memind bytind_to_memind (struct buffer *buf, Bytind x) { - return (Memind) ((x > (buf)->text->gpt) ? (x + (buf)->text->gap_size) : x); + return (Memind) ((x > buf->text->gpt) ? (x + buf->text->gap_size) : x); } @@ -689,8 +688,8 @@ memind_to_bytind (struct buffer *buf, Memind x) #ifdef ERROR_CHECK_BUFPOS assert (valid_memind_p (buf, x)); #endif - return (Bytind) ((x > (Memind) (buf)->text->gpt) ? - x - (buf)->text->gap_size : + return (Bytind) ((x > (Memind) buf->text->gpt) ? + x - buf->text->gap_size : x); }