diff options
| author | Paul Eggert | 2011-06-15 23:19:26 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-06-15 23:19:26 -0700 |
| commit | 28177adde9132702ed05b411a12c95f05dc2ba89 (patch) | |
| tree | 79eb6a53248e3f039f557ca56a2229c909e6c659 /src/buffer.h | |
| parent | 8aeb5be96aa28c4770299a54758a8fb339993a97 (diff) | |
| download | emacs-28177adde9132702ed05b411a12c95f05dc2ba89.tar.gz emacs-28177adde9132702ed05b411a12c95f05dc2ba89.zip | |
* buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/buffer.h b/src/buffer.h index dc1d62beb00..a13351b5ea6 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -309,8 +309,10 @@ while (0) | |||
| 309 | 309 | ||
| 310 | /* Maximum number of bytes in a buffer. | 310 | /* Maximum number of bytes in a buffer. |
| 311 | A buffer cannot contain more bytes than a 1-origin fixnum can represent, | 311 | A buffer cannot contain more bytes than a 1-origin fixnum can represent, |
| 312 | nor can it be so large that C pointer arithmetic stops working. */ | 312 | nor can it be so large that C pointer arithmetic stops working. |
| 313 | #define BUF_BYTES_MAX min (MOST_POSITIVE_FIXNUM - 1, min (SIZE_MAX, PTRDIFF_MAX)) | 313 | The ptrdiff_t cast ensures that this is signed, not unsigned. */ |
| 314 | #define BUF_BYTES_MAX \ | ||
| 315 | (ptrdiff_t) min (MOST_POSITIVE_FIXNUM - 1, min (SIZE_MAX, PTRDIFF_MAX)) | ||
| 314 | 316 | ||
| 315 | /* Return the address of byte position N in current buffer. */ | 317 | /* Return the address of byte position N in current buffer. */ |
| 316 | 318 | ||