From d989984247fb616f8b7e1608937ba48a6e4a472f Mon Sep 17 00:00:00 2001 From: Rune Tynan Date: Sat, 7 Dec 2024 20:51:57 -0800 Subject: [PATCH] Improve extract_windows_epoch impl comments --- src/shims/windows/fs.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shims/windows/fs.rs b/src/shims/windows/fs.rs index 83d6d93c5e..2d235b6fa6 100644 --- a/src/shims/windows/fs.rs +++ b/src/shims/windows/fs.rs @@ -332,8 +332,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { fn extract_windows_epoch<'tcx>( time: io::Result, ) -> InterpResult<'tcx, Option<(u32, u32)>> { - // (seconds in a year * (years between 1970 and 1601)) + (89 leap days in that span) * 10 million (nanoseconds/second / 100) - const TIME_TO_EPOCH: u64 = (3600 * 24 * 365 * (1970 - 1601) + (3600 * 24 * 89)) * 10_000_000; + // (seconds in a year * years between 1970 and 1601) + (89 leap days in that span) + const SECONDS_TO_EPOCH: u64 = 3600 * 24 * 365 * (1970 - 1601) + 3600 * 24 * 89; + // seconds between unix and windows epochs * 10 million (nanoseconds/second / 100) + const TIME_TO_EPOCH: u64 = SECONDS_TO_EPOCH * 10_000_000; match time.ok() { Some(time) => { let duration = system_time_to_duration(&time)?;