aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
authorPaul Eggert2011-06-06 11:36:36 -0700
committerPaul Eggert2011-06-06 11:36:36 -0700
commit0c1477cd00313d6aa13c40550a0b413a01d188c6 (patch)
treefecfa94a4e32d8bbe5d7c62f38ccbbc030bbe4ac /src/buffer.h
parentd6d100dd7c48e124ca9ce4bbb761f24b8e052493 (diff)
parent695e5b41ac15af4bcd635606db86995900617057 (diff)
downloademacs-0c1477cd00313d6aa13c40550a0b413a01d188c6.tar.gz
emacs-0c1477cd00313d6aa13c40550a0b413a01d188c6.zip
Merge: Cons<->int and similar integer overflow fixes.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 2f33065cd1a..3c91bdfe570 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -306,6 +306,11 @@ do \
306 } \ 306 } \
307while (0) 307while (0)
308 308
309/* Maximum number of bytes in a buffer.
310 A buffer cannot contain more bytes than a 1-origin fixnum can represent,
311 nor can it be so large that C pointer arithmetic stops working. */
312#define BUF_BYTES_MAX min (MOST_POSITIVE_FIXNUM - 1, min (SIZE_MAX, PTRDIFF_MAX))
313
309/* Return the address of byte position N in current buffer. */ 314/* Return the address of byte position N in current buffer. */
310 315
311#define BYTE_POS_ADDR(n) \ 316#define BYTE_POS_ADDR(n) \
@@ -545,7 +550,7 @@ struct buffer
545 -1 means visited file was nonexistent. 550 -1 means visited file was nonexistent.
546 0 means visited file modtime unknown; in no case complain 551 0 means visited file modtime unknown; in no case complain
547 about any mismatch on next save attempt. */ 552 about any mismatch on next save attempt. */
548 int modtime; 553 time_t modtime;
549 /* Size of the file when modtime was set. This is used to detect the 554 /* Size of the file when modtime was set. This is used to detect the
550 case where the file grew while we were reading it, so the modtime 555 case where the file grew while we were reading it, so the modtime
551 is still the same (since it's rounded up to seconds) but we're actually 556 is still the same (since it's rounded up to seconds) but we're actually