summaryrefslogtreecommitdiff
path: root/ftparchive
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-09-16 20:00:30 -0700
committerKhem Raj <raj.khem@gmail.com>2022-09-16 20:07:40 -0700
commit66b305f86fdee1c27edcb39f299b052c87d2d82e (patch)
treec5e5469a651d19030ebca8f5f99f3617552752c7 /ftparchive
parent6499f7dc842ebd621f11ea01e83ccbe4125a0581 (diff)
typecast time_t and suseconds_t from std::chrono
This fixes build on some architectures like mips progress.cc:125:31: error: non-constant-expression cannot be narrowed from type 'std::chrono::duration<long long>::rep' (aka 'long long') to '__time_t' (aka 'long') in initializer list [-Wc++11-narrowing] struct timeval NowTime = { Now_sec.count(), Now_usec.count() }; Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'ftparchive')
-rw-r--r--ftparchive/apt-ftparchive.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index 87ce9153c..bbba0834b 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -53,7 +53,7 @@ static struct timeval GetTimevalFromSteadyClock() /*{{{*/
auto const Time = std::chrono::steady_clock::now().time_since_epoch();
auto const Time_sec = std::chrono::duration_cast<std::chrono::seconds>(Time);
auto const Time_usec = std::chrono::duration_cast<std::chrono::microseconds>(Time - Time_sec);
- return { Time_sec.count(), Time_usec.count() };
+ return { static_cast<time_t>(Time_sec.count()), static_cast<suseconds_t>(Time_usec.count()) };
}
/*}}}*/
static auto GetTimeDeltaSince(struct timeval StartTime) /*{{{*/