# HG changeset patch
# User Mario de Sousa <msousa@fe.up.pt>
# Date 1545825118 0
# Node ID d8ed548e2f9b4f44d9107060c1b61b67ffb7f6d9
# Parent  81e2a100db145395407a20882955502dc095cc3b
return storage of task interval back to 1 ns resolution (when calculating least common multiple et. al. of task intervals).

diff -r 81e2a100db14 -r d8ed548e2f9b stage4/generate_c/generate_c.cc
--- a/stage4/generate_c/generate_c.cc	Wed Dec 26 11:12:27 2018 +0000
+++ b/stage4/generate_c/generate_c.cc	Wed Dec 26 11:51:58 2018 +0000
@@ -544,7 +544,7 @@
 /***********************************************************************/
 /***********************************************************************/
 
-#define MILLISECOND 1
+#define MILLISECOND 1000000
 #define SECOND 1000 * MILLISECOND
 
 #define ULL_MAX std::numeric_limits<unsigned long long>::max()
@@ -626,8 +626,12 @@
       ovflow |= ((ULL_MAX - time_ull) < (unsigned long long)time_ld);
       time_ull += time_ld;
       
-      if (ovflow)
-        STAGE4_ERROR(symbol, symbol, "Internal overflow calculating task interval (must be <= 49 days).");
+      if (ovflow) {
+        /* time is being stored in ns resolution (MILLISECOND #define is set to 1000000)    */
+        /* time is being stored in unsigned long long (ISO C99 guarantees at least 64 bits) */
+        /* 2⁶64ns works out to around 584.5 years, assuming 365.25 days per year            */
+        STAGE4_ERROR(symbol, symbol, "Internal overflow calculating task interval (must be < 584 years).");
+      }
 
       return time_ull;
   };