[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: file-attributes returns wrong info on Windows
From: |
Chris Britton |
Subject: |
Re: file-attributes returns wrong info on Windows |
Date: |
Sun, 23 Jul 2006 00:22:20 -0500 |
Works for me. Excellent work. Thanks.
--
Chris Britton
address@hidden
Eli Zaretskii writes:
> > Date: Fri, 21 Jul 2006 19:59:58 +0300
> > From: Eli Zaretskii <address@hidden>
> > Cc: address@hidden, address@hidden
> >
> > So the question is not why 21.3 succeeded whereas 22.0 fails, but
> > rather how come the results returned by Emacs are one second off. I
> > will try to look into this, but anyone is invited to beat me to it.
>
> Bug squashed, I think. The patch is below (I already committed it to
> CVS); please see if this solves the problem.
>
>
> 2006-07-21 Eli Zaretskii <address@hidden>
>
> * w32.c (convert_time): Use explicit long double constants to
> ensure long double arithmetics is used throughout.
>
> Index: src/w32.c
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/src/w32.c,v
> retrieving revision 1.104
> retrieving revision 1.105
> diff -u -p -r1.104 -r1.105
> --- src/w32.c 14 Jul 2006 14:18:40 -0000 1.104
> +++ src/w32.c 21 Jul 2006 17:27:34 -0000 1.105
> @@ -2256,16 +2256,17 @@ convert_time (FILETIME ft)
>
> SystemTimeToFileTime (&st, &utc_base_ft);
> utc_base = (long double) utc_base_ft.dwHighDateTime
> - * 4096 * 1024 * 1024 + utc_base_ft.dwLowDateTime;
> + * 4096.0L * 1024.0L * 1024.0L + utc_base_ft.dwLowDateTime;
> init = 1;
> }
>
> if (CompareFileTime (&ft, &utc_base_ft) < 0)
> return 0;
>
> - ret = (long double) ft.dwHighDateTime * 4096 * 1024 * 1024 +
> ft.dwLowDateTime;
> + ret = (long double) ft.dwHighDateTime
> + * 4096.0L * 1024.0L * 1024.0L + ft.dwLowDateTime;
> ret -= utc_base;
> - return (time_t) (ret * 1e-7);
> + return (time_t) (ret * 1e-7L);
> }
>
> void
>
- Re: file-attributes returns wrong info on Windows, (continued)
- Re: file-attributes returns wrong info on Windows, Eli Zaretskii, 2006/07/17
- Re: file-attributes returns wrong info on Windows, Lennart Borgman, 2006/07/17
- Re: file-attributes returns wrong info on Windows, Eli Zaretskii, 2006/07/21
- Re: file-attributes returns wrong info on Windows, Eli Zaretskii, 2006/07/21
- Re: file-attributes returns wrong info on Windows, martin rudalics, 2006/07/21
- Re: file-attributes returns wrong info on Windows, Eli Zaretskii, 2006/07/22
- Re: file-attributes returns wrong info on Windows,
Chris Britton <=
- Re: file-attributes returns wrong info on Windows, Eli Zaretskii, 2006/07/23
- Re: file-attributes returns wrong info on Windows, Chris Britton, 2006/07/17
- Re: file-attributes returns wrong info on Windows, Eli Zaretskii, 2006/07/17
- Re: file-attributes returns wrong info on Windows, Eli Zaretskii, 2006/07/17
- Re: file-attributes returns wrong info on Windows, Chris Britton, 2006/07/18
- Re: file-attributes returns wrong info on Windows, Eli Zaretskii, 2006/07/18
file-attributes returns wrong info on Windows, Chris Britton, 2006/07/16