From: Slava Pestov Date: Mon, 15 Dec 2008 09:47:13 +0000 (-0600) Subject: Fix windows-time>FILETIME (why was this broken for so long?) X-Git-Tag: 0.94~2233 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=b14c49f1a539b6b35b8f2d67cd408ac8fd731f51 Fix windows-time>FILETIME (why was this broken for so long?) --- diff --git a/basis/windows/time/time.factor b/basis/windows/time/time.factor index 54a7a8e32a..e63834d369 100644 --- a/basis/windows/time/time.factor +++ b/basis/windows/time/time.factor @@ -11,8 +11,9 @@ IN: windows.time 1601 1 1 0 0 0 instant ; : FILETIME>windows-time ( FILETIME -- n ) - [ FILETIME-dwLowDateTime ] keep - FILETIME-dwHighDateTime >64bit ; + [ FILETIME-dwLowDateTime ] + [ FILETIME-dwHighDateTime ] + bi >64bit ; : windows-time>timestamp ( n -- timestamp ) 10000000 /i seconds windows-1601 swap time+ ; @@ -28,12 +29,12 @@ IN: windows.time : windows-time>FILETIME ( n -- FILETIME ) "FILETIME" [ - [ 32 bits set-FILETIME-dwLowDateTime ] 2keep - [ -32 shift ] dip set-FILETIME-dwHighDateTime + [ [ 32 bits ] dip set-FILETIME-dwLowDateTime ] + [ [ -32 shift ] dip set-FILETIME-dwHighDateTime ] 2bi ] keep ; : timestamp>FILETIME ( timestamp -- FILETIME/f ) - [ >gmt timestamp>windows-time windows-time>FILETIME ] [ f ] if* ; + dup [ >gmt timestamp>windows-time windows-time>FILETIME ] when ; : FILETIME>timestamp ( FILETIME -- timestamp/f ) FILETIME>windows-time windows-time>timestamp ;