From: Paul Eggert Date: Thu, 9 Jun 2011 01:10:27 +0000 (-0700) Subject: * buffer.h (PTR_BYTE_POS): Don't assume a byte count fits in 'unsigned'. X-Git-Tag: emacs-pretest-24.0.90~104^2~548^2~54 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8f95c75c34009a63ab9c04e99477f979cd417830;p=emacs.git * buffer.h (PTR_BYTE_POS): Don't assume a byte count fits in 'unsigned'. --- 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. */