diff src/editfns.c @ 707:a307f9a2021d

[xemacs-hg @ 2001-12-20 05:49:28 by andyp] sync with 21-4-6-windows
author andyp
date Thu, 20 Dec 2001 05:49:48 +0000
parents fdefd0186b75
children 943eaba38521
line wrap: on
line diff
--- a/src/editfns.c	Wed Dec 19 00:40:26 2001 +0000
+++ b/src/editfns.c	Thu Dec 20 05:49:48 2001 +0000
@@ -1176,6 +1176,15 @@
 
 static void set_time_zone_rule (char *tzstring);
 
+/* from GNU Emacs 21, per Simon Josefsson, modified by stephen
+   The slight inefficiency is justified since negative times are weird. */
+Lisp_Object
+make_time (time_t time)
+{
+  return list2 (make_int (time < 0 ? time / 0x10000 : time >> 16),
+		make_int (time & 0xFFFF));
+}
+
 DEFUN ("encode-time", Fencode_time, 6, MANY, 0, /*
   Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time.
 This is the reverse operation of `decode-time', which see.
@@ -1249,7 +1258,7 @@
   if (the_time == (time_t) -1)
     invalid_argument ("Specified time is not representable", Qunbound);
 
-  return wasteful_word_to_lisp (the_time);
+  return make_time (the_time);
 }
 
 DEFUN ("current-time-string", Fcurrent_time_string, 0, 1, 0, /*