diff options
| author | Paul Eggert | 2011-06-01 23:15:15 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-06-01 23:15:15 -0700 |
| commit | 84acfcf06be242f35063c719ca5643ad969437fd (patch) | |
| tree | 37c7d16b9def0b1f64d9d879a8bfd9ec052c1ee9 /src | |
| parent | 369b7e5ac5a6609433fc017d09e1f31750f033a7 (diff) | |
| download | emacs-84acfcf06be242f35063c719ca5643ad969437fd.tar.gz emacs-84acfcf06be242f35063c719ca5643ad969437fd.zip | |
Don't assume time_t can fit into int.
* buffer.h (struct buffer.modtime): Now time_t, not int.
* fileio.c (Fvisited_file_modtime): No need for time_t cast now.
* undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/buffer.h | 2 | ||||
| -rw-r--r-- | src/fileio.c | 2 | ||||
| -rw-r--r-- | src/undo.c | 2 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6e12a97d641..1c97b0ac9f5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2011-06-02 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-06-02 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Don't assume time_t can fit into int. | ||
| 4 | * buffer.h (struct buffer.modtime): Now time_t, not int. | ||
| 5 | * fileio.c (Fvisited_file_modtime): No need for time_t cast now. | ||
| 6 | * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value. | ||
| 7 | |||
| 3 | Minor fixes for signed vs unsigned integers. | 8 | Minor fixes for signed vs unsigned integers. |
| 4 | * character.h (MAYBE_UNIFY_CHAR): | 9 | * character.h (MAYBE_UNIFY_CHAR): |
| 5 | * charset.c (maybe_unify_char): | 10 | * charset.c (maybe_unify_char): |
diff --git a/src/buffer.h b/src/buffer.h index 2f33065cd1a..8c64a24e804 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -545,7 +545,7 @@ struct buffer | |||
| 545 | -1 means visited file was nonexistent. | 545 | -1 means visited file was nonexistent. |
| 546 | 0 means visited file modtime unknown; in no case complain | 546 | 0 means visited file modtime unknown; in no case complain |
| 547 | about any mismatch on next save attempt. */ | 547 | about any mismatch on next save attempt. */ |
| 548 | int modtime; | 548 | time_t modtime; |
| 549 | /* Size of the file when modtime was set. This is used to detect the | 549 | /* 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 | 550 | 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 | 551 | is still the same (since it's rounded up to seconds) but we're actually |
diff --git a/src/fileio.c b/src/fileio.c index 7e6fd8c82a8..94894b97a6e 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -4990,7 +4990,7 @@ See Info node `(elisp)Modification Time' for more details. */) | |||
| 4990 | { | 4990 | { |
| 4991 | if (! current_buffer->modtime) | 4991 | if (! current_buffer->modtime) |
| 4992 | return make_number (0); | 4992 | return make_number (0); |
| 4993 | return make_time ((time_t) current_buffer->modtime); | 4993 | return make_time (current_buffer->modtime); |
| 4994 | } | 4994 | } |
| 4995 | 4995 | ||
| 4996 | DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime, | 4996 | DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime, |
diff --git a/src/undo.c b/src/undo.c index 80aff50d18a..142960545a7 100644 --- a/src/undo.c +++ b/src/undo.c | |||
| @@ -500,7 +500,7 @@ Return what remains of the list. */) | |||
| 500 | { | 500 | { |
| 501 | /* Element (t high . low) records previous modtime. */ | 501 | /* Element (t high . low) records previous modtime. */ |
| 502 | Lisp_Object high, low; | 502 | Lisp_Object high, low; |
| 503 | int mod_time; | 503 | time_t mod_time; |
| 504 | struct buffer *base_buffer = current_buffer; | 504 | struct buffer *base_buffer = current_buffer; |
| 505 | 505 | ||
| 506 | high = Fcar (cdr); | 506 | high = Fcar (cdr); |