The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
isn't needed on 32-bit machines.
* xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
- * buffer.h (PTR_BYTE_POS): Don't assume a byte count fits in 'unsigned'.
+ * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
+ The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
+ isn't needed on 32-bit machines.
* buffer.c (Fgenerate_new_buffer_name): Use EMACS_INT for count, not int.
(advance_to_char_boundary): Return EMACS_INT, not int.
#define PTR_BYTE_POS(ptr) \
((ptr) - (current_buffer)->text->beg \
- - (ptr - (current_buffer)->text->beg <= (size_t) (GPT_BYTE - BEG_BYTE) ? 0 : GAP_SIZE) \
+ - (ptr - (current_buffer)->text->beg <= GPT_BYTE - BEG_BYTE ? 0 : GAP_SIZE) \
+ BEG_BYTE)
/* Return character at byte position POS. */
#define BUF_PTR_BYTE_POS(buf, ptr) \
((ptr) - (buf)->text->beg \
- - (ptr - (buf)->text->beg <= (unsigned) (BUF_GPT_BYTE ((buf)) - BEG_BYTE)\
+ - (ptr - (buf)->text->beg <= BUF_GPT_BYTE (buf) - BEG_BYTE \
? 0 : BUF_GAP_SIZE ((buf))) \
+ BEG_BYTE)