From 896286ecf151620e5e2b88c74e8f361e04224da9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 31 Aug 2022 16:15:33 +0200 Subject: Avoid comparison of integers of different signedness for ETA Reported-By: gcc -Wsign-compare Gbp-Dch: Ignore --- apt-pkg/acquire.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apt-pkg/acquire.cc') diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index dd0624ad6..cdb2c5257 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -1470,7 +1470,8 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner) std::string msg; long i = CurrentItems < TotalItems ? CurrentItems + 1 : CurrentItems; // only show the ETA if it makes sense - if (ETA > 0 && ETA < std::chrono::seconds(std::chrono::hours(24 * 2)).count()) + auto const twodays = std::chrono::seconds(std::chrono::hours(24 * 2)).count(); + if (ETA > 0 && ETA < static_cast(twodays)) strprintf(msg, _("Retrieving file %li of %li (%s remaining)"), i, TotalItems, TimeToStr(ETA).c_str()); else strprintf(msg, _("Retrieving file %li of %li"), i, TotalItems); -- cgit v1.2.3-70-g09d2