diff options
| author | David Kalnischkies <david@kalnischkies.de> | 2022-08-31 16:15:33 +0200 |
|---|---|---|
| committer | David Kalnischkies <david@kalnischkies.de> | 2023-01-29 12:21:24 +0100 |
| commit | 896286ecf151620e5e2b88c74e8f361e04224da9 (patch) | |
| tree | 0f75bf0683b743bffabfe2e0a04641183094eca7 | |
| parent | 136f3829940ad4bc8361085645f18795f34c905c (diff) | |
Avoid comparison of integers of different signedness for ETA
Reported-By: gcc -Wsign-compare
Gbp-Dch: Ignore
| -rw-r--r-- | apt-pkg/acquire.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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<decltype(ETA)>(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); |
