definitive fix of issue #76: remove internal overflow of u64 when calculating least common multiple of task intervals.
--- a/stage4/generate_c/generate_c.cc Tue Dec 25 12:15:29 2018 +0000
+++ b/stage4/generate_c/generate_c.cc Wed Dec 26 11:40:45 2018 +0000
@@ -544,7 +544,7 @@
/***********************************************************************/
/***********************************************************************/
-#define MILLISECOND 1
+#define MILLISECOND 1000000
#define SECOND 1000 * MILLISECOND
unsigned long long calculate_time(symbol_c *symbol) {
@@ -649,7 +649,7 @@
if (least_common_ticktime == 0)
least_common_ticktime = time;
else
- least_common_ticktime = (least_common_ticktime * time) / common_ticktime;
+ least_common_ticktime = least_common_ticktime * (time / common_ticktime);
}
unsigned long long get_common_ticktime(void) {