CLEANUP: time: use __tv_to_ms() in tv_update_date() instead of open-coding
Instead of calculating the current date in milliseconds by hand, let's
use __tv_to_ms() which was made exactly for this purpose.
diff --git a/src/time.c b/src/time.c
index cb106ca..4ebde37 100644
--- a/src/time.c
+++ b/src/time.c
@@ -236,7 +236,7 @@
do {
tmp_now.tv_sec = (unsigned int)(old_now >> 32);
tmp_now.tv_usec = old_now & 0xFFFFFFFFU;
- old_now_ms = tmp_now.tv_sec * 1000 + tmp_now.tv_usec / 1000;
+ old_now_ms = __tv_to_ms(&tmp_now);
if (__tv_islt(&now, &tmp_now))
now = tmp_now;
@@ -245,7 +245,7 @@
* equal to <global_now> or newer.
*/
new_now = ((ullong)now.tv_sec << 32) + (uint)now.tv_usec;
- now_ms = now.tv_sec * 1000 + now.tv_usec / 1000;
+ now_ms = __tv_to_ms(&now);
if (tick_is_lt(now_ms, old_now_ms))
now_ms = old_now_ms;