Author: mturk Date: Sat Aug 8 06:50:33 2009 New Revision: 802304 URL: http://svn.apache.org/viewvc?rev=802304&view=rev Log: Use LARGE_INTERGER for time transformation
Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h?rev=802304&r1=802303&r2=802304&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h Sat Aug 8 06:50:33 2009 @@ -320,9 +320,7 @@ static ACR_INLINE void FileTimeToAprTime(acr_time_t *result, FILETIME *input) { /* Convert FILETIME one 64 bit number so we can work with it. */ - *result = input->dwHighDateTime; - *result = (*result) << 32; - *result |= input->dwLowDateTime; + *result = ((LARGE_INTEGER *)input)->QuadPart; /* Convert from 100 nano-sec periods to micro-seconds. */ *result /= 10; /* Convert from Windows epoch to Unix epoch */ @@ -331,13 +329,9 @@ } -static ACR_INLINE void AprTimeToFileTime(LPFILETIME pft, acr_time_t t) +static ACR_INLINE void AprTimeToFileTime(LPFILETIME result, acr_time_t t) { - LONGLONG ll; - - ll = (t + ACR_DELTA_EPOCH_IN_USEC) * 10; - pft->dwLowDateTime = (DWORD)(ll); - pft->dwHighDateTime = (DWORD)(ll >> 32); + ((LARGE_INTEGER *)result)->QuadPart = (t + ACR_DELTA_EPOCH_IN_USEC) * 10; return; } Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c?rev=802304&r1=802303&r2=802304&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c Sat Aug 8 06:50:33 2009 @@ -41,5 +41,7 @@ ACR_Sha1Base16W(fname, wcslen(fname), rname + wcslen(prefix)); else ACR_Sha1Base16W(pname, wcslen(pname), rname + wcslen(prefix)); + fprintf(stdout, "Converted %S from %S\n", rname, pname); + fflush(stdout); return rname; }