From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/40439 Path: main.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.gnus.general Subject: Re: expiry problems? Date: 21 Nov 2001 15:32:20 +0900 Organization: University of Tsukuba Sender: owner-ding@hpc.uh.edu Message-ID: <87itc4eirv.fsf@tleepslib.sk.tsukuba.ac.jp> References: <87668kggle.fsf@mclinux.com> <87adxvrihi.fsf@squeaker.lickey.com> <87itcjg6jy.fsf@mclinux.com> <874ro369fj.fsf@squeaker.lickey.com> <87wv0z35yw.fsf@mclinux.com> <87vggitswm.fsf@mclinux.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035175989 909 80.91.224.250 (21 Oct 2002 04:53:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:53:09 +0000 (UTC) Cc: xemacs-beta@xemacs.org, ben@xemacs.org, hniksic@xemacs.org Return-Path: Original-Received: (qmail 25380 invoked from network); 21 Nov 2001 06:35:35 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 21 Nov 2001 06:35:35 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 166Qye-0004Q7-00; Wed, 21 Nov 2001 00:35:20 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 21 Nov 2001 00:34:13 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id AAA13162 for ; Wed, 21 Nov 2001 00:33:34 -0600 (CST) Original-Received: (qmail 25343 invoked by alias); 21 Nov 2001 06:33:13 -0000 Original-Received: (qmail 25338 invoked from network); 21 Nov 2001 06:33:12 -0000 Original-Received: from tleepslib.sk.tsukuba.ac.jp (mail@130.158.98.109) by gnus.org with SMTP; 21 Nov 2001 06:33:12 -0000 Original-Received: from steve by tleepslib.sk.tsukuba.ac.jp with local (Exim 3.32 #1 (Debian)) id 166Qvk-0008Pd-00; Wed, 21 Nov 2001 15:32:20 +0900 Original-To: ding@gnus.org In-Reply-To: Original-Lines: 71 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:40439 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:40439 >>>>> "Simon" == Simon Josefsson 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 * 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.