From b14c49f1a539b6b35b8f2d67cd408ac8fd731f51 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 15 Dec 2008 03:47:13 -0600 Subject: [PATCH] Fix windows-time>FILETIME (why was this broken for so long?) --- basis/windows/time/time.factor | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 ; -- 2.34.1