[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r105970: * buffer.h (struct buffer):
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r105970: * buffer.h (struct buffer): Use time_t, not int, for a time stamp. |
Date: |
Fri, 30 Sep 2011 13:22:01 -0700 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 105970
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Fri 2011-09-30 13:22:01 -0700
message:
* buffer.h (struct buffer): Use time_t, not int, for a time stamp.
This fixes a Y2038 bug on 64-bit hosts.
* buffer.c (reset_buffer):
* fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
(Fclear_buffer_auto_save_failure):
Use 0, not -1, to represent an unset failure time, since time_t
might not be signed.
modified:
src/ChangeLog
src/buffer.c
src/buffer.h
src/fileio.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2011-09-30 17:07:40 +0000
+++ b/src/ChangeLog 2011-09-30 20:22:01 +0000
@@ -1,5 +1,13 @@
2011-09-30 Paul Eggert <address@hidden>
+ * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
+ This fixes a Y2038 bug on 64-bit hosts.
+ * buffer.c (reset_buffer):
+ * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
+ (Fclear_buffer_auto_save_failure):
+ Use 0, not -1, to represent an unset failure time, since time_t
+ might not be signed.
+
Remove dependency on glibc malloc internals.
* alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
Move back here from lisp.h, but with their new implementations.
=== modified file 'src/buffer.c'
--- a/src/buffer.c 2011-09-25 02:30:31 +0000
+++ b/src/buffer.c 2011-09-30 20:22:01 +0000
@@ -724,7 +724,7 @@
b->prevent_redisplay_optimizations_p = 1;
BVAR (b, backed_up) = Qnil;
BUF_AUTOSAVE_MODIFF (b) = 0;
- b->auto_save_failure_time = -1;
+ b->auto_save_failure_time = 0;
BVAR (b, auto_save_file_name) = Qnil;
BVAR (b, read_only) = Qnil;
b->overlays_before = NULL;
=== modified file 'src/buffer.h'
--- a/src/buffer.h 2011-09-10 19:41:33 +0000
+++ b/src/buffer.h 2011-09-30 20:22:01 +0000
@@ -566,8 +566,8 @@
Redisplay of this buffer is inhibited until it changes again. */
int display_error_modiff;
/* The time at which we detected a failure to auto-save,
- Or -1 if we didn't have a failure. */
- int auto_save_failure_time;
+ Or 0 if we didn't have a failure. */
+ time_t auto_save_failure_time;
/* Position in buffer at which display started
the last time this buffer was displayed. */
EMACS_INT last_window_start;
=== modified file 'src/fileio.c'
--- a/src/fileio.c 2011-09-18 08:34:09 +0000
+++ b/src/fileio.c 2011-09-30 20:22:01 +0000
@@ -5344,7 +5344,7 @@
EMACS_GET_TIME (before_time);
/* If we had a failure, don't try again for 20 minutes. */
- if (b->auto_save_failure_time >= 0
+ if (b->auto_save_failure_time > 0
&& EMACS_SECS (before_time) - b->auto_save_failure_time < 1200)
continue;
@@ -5423,7 +5423,7 @@
they're not autosaved. */
BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF;
XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
- current_buffer->auto_save_failure_time = -1;
+ current_buffer->auto_save_failure_time = 0;
return Qnil;
}
@@ -5432,7 +5432,7 @@
doc: /* Clear any record of a recent auto-save failure in the current
buffer. */)
(void)
{
- current_buffer->auto_save_failure_time = -1;
+ current_buffer->auto_save_failure_time = 0;
return Qnil;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r105970: * buffer.h (struct buffer): Use time_t, not int, for a time stamp.,
Paul Eggert <=