gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31836 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r31836 - gnunet/src/util
Date: Wed, 8 Jan 2014 15:14:47 +0100

Author: LRN
Date: 2014-01-08 15:14:47 +0100 (Wed, 08 Jan 2014)
New Revision: 31836

Modified:
   gnunet/src/util/strings.c
   gnunet/src/util/test_strings.c
Log:
Remove the W32 timezone hack to match r31771

Modified: gnunet/src/util/strings.c
===================================================================
--- gnunet/src/util/strings.c   2014-01-08 14:14:44 UTC (rev 31835)
+++ gnunet/src/util/strings.c   2014-01-08 14:14:47 UTC (rev 31836)
@@ -367,17 +367,6 @@
     return GNUNET_SYSERR;
   t = mktime (&tv);
   atime->abs_value_us = (uint64_t) ((uint64_t) t * 1000LL * 1000LL);
-#if WINDOWS
-  {
-    DWORD tzv;
-    TIME_ZONE_INFORMATION tzi;
-    tzv = GetTimeZoneInformation (&tzi);
-    if (TIME_ZONE_ID_INVALID != tzv)
-    {
-      atime->abs_value_us -= 1000LL * 1000LL * tzi.Bias * 60LL;
-    }
-  }
-#endif
   return GNUNET_OK;
 }
 

Modified: gnunet/src/util/test_strings.c
===================================================================
--- gnunet/src/util/test_strings.c      2014-01-08 14:14:44 UTC (rev 31835)
+++ gnunet/src/util/test_strings.c      2014-01-08 14:14:47 UTC (rev 31836)
@@ -108,10 +108,27 @@
 
   at.abs_value_us = 50000000000;
   bc = GNUNET_STRINGS_absolute_time_to_string (at);
+
   GNUNET_assert (GNUNET_OK ==
-                GNUNET_STRINGS_fancy_time_to_absolute (bc, &atx));
-  GNUNET_assert (atx.abs_value_us == at.abs_value_us);
+                 GNUNET_STRINGS_fancy_time_to_absolute (bc, &atx));
 
+  if (atx.abs_value_us != at.abs_value_us)
+  {
+#ifdef WINDOWS
+    DWORD tzv;
+    TIME_ZONE_INFORMATION tzi;
+    tzv = GetTimeZoneInformation (&tzi);
+    if (TIME_ZONE_ID_INVALID != tzv)
+    {
+      atx.abs_value_us -= 1000LL * 1000LL * tzi.Bias * 60LL;
+    }
+    if (atx.abs_value_us == at.abs_value_us)
+      fprintf (stderr,
+               "WARNING:  GNUNET_STRINGS_fancy_time_to_absolute() 
miscalculates timezone!\n");
+#endif
+    GNUNET_assert (0);
+  }
+
   GNUNET_log_skip (2, GNUNET_NO);
   b = GNUNET_STRINGS_to_utf8 ("TEST", 4, "unknown");
   GNUNET_log_skip (0, GNUNET_YES);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]