summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-06-03 11:12:45 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-06-03 11:12:45 -0700
commit4c97dba58f46f9d6d6d33438958b4d8ee8b79bc4 (patch)
tree7d6481339b9a18ea3a2aff7530703927e2959768 /src
parent39bc618abbfc4805d4d7dec195826577ef71da77 (diff)
parent84acfcf06be242f35063c719ca5643ad969437fd (diff)
downloademacs-4c97dba58f46f9d6d6d33438958b4d8ee8b79bc4.tar.gz
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/ChangeLog5
-rw-r--r--src/buffer.h2
-rw-r--r--src/fileio.c2
-rw-r--r--src/undo.c2
4 files changed, 8 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 431bd2acdb5..94cfd944adc 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2011-06-03 Paul Eggert <eggert@cs.ucla.edu>
+ 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.
+
Minor fixes for signed vs unsigned integers.
* character.h (MAYBE_UNIFY_CHAR):
* 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
-1 means visited file was nonexistent.
0 means visited file modtime unknown; in no case complain
about any mismatch on next save attempt. */
- int modtime;
+ time_t modtime;
/* Size of the file when modtime was set. This is used to detect the
case where the file grew while we were reading it, so the modtime
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. */)
{
if (! current_buffer->modtime)
return make_number (0);
- return make_time ((time_t) current_buffer->modtime);
+ return make_time (current_buffer->modtime);
}
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. */)
{
/* Element (t high . low) records previous modtime. */
Lisp_Object high, low;
- int mod_time;
+ time_t mod_time;
struct buffer *base_buffer = current_buffer;
high = Fcar (cdr);