From 8f95c75c34009a63ab9c04e99477f979cd417830 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 8 Jun 2011 18:10:27 -0700 Subject: [PATCH] * buffer.h (PTR_BYTE_POS): Don't assume a byte count fits in 'unsigned'. --- src/ChangeLog | 2 ++ src/buffer.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1929638a442..f3ed5f66161 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2011-06-09 Paul Eggert + * buffer.h (PTR_BYTE_POS): Don't assume a byte count fits in 'unsigned'. + * buffer.c (Fgenerate_new_buffer_name): Use EMACS_INT for count, not int. (advance_to_char_boundary): Return EMACS_INT, not int. diff --git a/src/buffer.h b/src/buffer.h index 3c91bdfe570..ba48a8105a2 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -337,7 +337,7 @@ while (0) #define PTR_BYTE_POS(ptr) \ ((ptr) - (current_buffer)->text->beg \ - - (ptr - (current_buffer)->text->beg <= (unsigned) (GPT_BYTE - BEG_BYTE) ? 0 : GAP_SIZE) \ + - (ptr - (current_buffer)->text->beg <= (size_t) (GPT_BYTE - BEG_BYTE) ? 0 : GAP_SIZE) \ + BEG_BYTE) /* Return character at byte position POS. */ -- 2.39.2