Gnus development mailing list
 help / color / mirror / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: xemacs-beta@xemacs.org, ben@xemacs.org, hniksic@xemacs.org
Subject: Re: expiry problems?
Date: 21 Nov 2001 15:32:20 +0900	[thread overview]
Message-ID: <87itc4eirv.fsf@tleepslib.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <iluu1w2moqm.fsf@dhcp128.extundo.com>

>>>>> "Simon" == Simon Josefsson <jas@extundo.com> writes:

    Simon> Yes.  The patch below fixes it, someone at xemacs-patches
    Simon> please have a look at it.

    Simon> XEmacs 21.1, 21.4 (without patch):

    Simon> (encode-time 0 0 1 1 1 1969 nil nil 3600)
    Simon> (65054 52352)

wasteful_word_to_lisp() is required to produce this result by the C
standard.

    Simon> Emacs 20.7, 21.1 (and XEmacs 21.4 with patch):

    Simon> (encode-time 0 0 1 1 1 1969 nil nil 3600)
    Simon> (-482 52352)

This result is plausible, but the C standard does not require GNU's
make_time to produce it AFAIK.

For XEmacs 21.4.6, I'm going to (1) use GNU's make_time(), but divide
by 2^16 when time is negative to guarantee the desired result (how
Martinesque), and (2) eliminate use of (wasteful_)?word_to_lisp() to
decode time (only in dired.c).

Comments?

Simon's patch follows in full for those who just joined us.  The
semantic difference between Simon's version and the current XEmacs
code can be summarized by "s/time_t/unsigned int/".

2001-11-10  Simon Josefsson  <jas@extundo.com>

	* editfns.c (make_time): New function, from Emacs.
	(Fencode_time): Use it, instead of `wasteful_word_to_lisp'.

--- editfns.c.~1.27.2.2.~	Wed Nov  7 20:43:02 2001
+++ editfns.c	Sat Nov 10 19:57:27 2001
@@ -1176,6 +1176,14 @@
 
 static void set_time_zone_rule (char *tzstring);
 
+Lisp_Object
+make_time (time)
+     time_t time;
+{
+  return Fcons (make_int (time >> 16),
+		Fcons (make_int (time & 0177777), Qnil));
+}
+
 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 +1257,7 @@
   if (the_time == (time_t) -1)
     error ("Specified time is not representable");
 
-  return wasteful_word_to_lisp (the_time);
+  return make_time (the_time);
 }
 
 DEFUN ("current-time-string", Fcurrent_time_string, 0, 1, 0, /*



-- 
Institute of Policy and Planning Sciences     http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
              Don't ask how you can "do" free software business;
              ask what your business can "do for" free software.



      reply	other threads:[~2001-11-21  6:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-09 14:32 Josh Huber
2001-11-09 15:53 ` Harry Putnam
2001-11-09 16:56 ` Matt Armstrong
2001-11-09 18:09   ` Josh Huber
2001-11-09 19:17     ` Matt Armstrong
2001-11-09 23:00       ` Josh Huber
2001-11-10 11:11         ` Simon Josefsson
2001-11-10 17:52           ` Josh Huber
2001-11-10 19:04             ` Simon Josefsson
2001-11-21  6:32               ` Stephen J. Turnbull [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87itc4eirv.fsf@tleepslib.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=ben@xemacs.org \
    --cc=hniksic@xemacs.org \
    --cc=xemacs-beta@xemacs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).