commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r809101 - in /commons/sandbox/runtime/trunk/src/main/native: os/win32/time.c test/testsuite.c
Date Sat, 29 Aug 2009 08:42:33 GMT
Author: mturk
Date: Sat Aug 29 08:42:32 2009
New Revision: 809101

URL: http://svn.apache.org/viewvc?rev=809101&view=rev
Log:
Round up to seconds

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/win32/time.c
    commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/time.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/time.c?rev=809101&r1=809100&r2=809101&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/time.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/time.c Sat Aug 29 08:42:32 2009
@@ -128,7 +128,9 @@
     struct tm    tm;
     acr_uint32_t rv;
 
-    UsecTimeToFileTime(&ft, t);
+    /* Round up to seconds */
+    t = t / ACR_USEC_PER_SEC;
+    UsecTimeToFileTime(&ft, t * ACR_USEC_PER_SEC);
     FileTimeToSystemTime(&ft, &st);
     /* The Platform SDK documents that SYSTEMTIME/FILETIME are
      * generally UTC, so no timezone info needed
@@ -149,7 +151,9 @@
     WORD         dd;
     WORD         dt;
 
-    UsecTimeToFileTime(&ft, t);
+    /* Round up to seconds */
+    t = t / ACR_USEC_PER_SEC;
+    UsecTimeToFileTime(&ft, t * ACR_USEC_PER_SEC);
     if (FileTimeToDosDateTime(&ft, &dd, &dt))
         return ((acr_uint32_t)dd << 16) | (acr_uint32_t)dt;
     else

Modified: commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c?rev=809101&r1=809100&r2=809101&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c Sat Aug 29 08:42:32 2009
@@ -434,8 +434,8 @@
     }
     d2 = ACR_Acr2DosTime(test_now);
     printf("Dos Time 0 is %d\n",  d2);
-    printf("Acr Time 0 is %ld\n", ACR_Dos2AcrTime(d2));
-    printf("Acr Time 0 is %ld\n", ACR_Dos2AcrTime(d2+1));
+    printf("Acr Time 0 is %lld\n", ACR_Dos2AcrTime(d2));
+    printf("Acr Time 0 is %lld\n", ACR_Dos2AcrTime(d2+1));
     tests_failed += failed;
     if (failed)
         fprintf(stderr, "times:         Failed (%d)\n", failed);



Mime
View raw message