summaryrefslogtreecommitdiff
path: root/apt-pkg/install-progress.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2017-12-13 23:54:38 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2017-12-13 23:54:38 +0100
commit99813a2eaa7c0cce1d7d8c811827733ed66458de (patch)
tree61fe422eeca8c5bd5cb2de6060f11e71343d4602 /apt-pkg/install-progress.cc
parentd30b30ad1e1ce434df84e15e2573c43ac152f9e3 (diff)
parent0b5e329a8ba2461ccb7017d3adfc972f9dccd830 (diff)
Merge branch 'feature/happy-gcc'
Fixing various real and imagined bugs reported by gcc warnings
Diffstat (limited to 'apt-pkg/install-progress.cc')
-rw-r--r--apt-pkg/install-progress.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc
index 2c2205d2b..09bf465bf 100644
--- a/apt-pkg/install-progress.cc
+++ b/apt-pkg/install-progress.cc
@@ -55,8 +55,8 @@ bool PackageManager::StatusChanged(std::string /*PackageName*/,
std::string /*HumanReadableAction*/)
{
int reporting_steps = _config->FindI("DpkgPM::Reporting-Steps", 1);
- percentage = StepsDone/(float)TotalSteps * 100.0;
- strprintf(progress_str, _("Progress: [%3i%%]"), (int)percentage);
+ percentage = StepsDone/(double)TotalSteps * 100.0;
+ strprintf(progress_str, _("Progress: [%3li%%]"), std::lround(percentage));
if(percentage < (last_reported_progress + reporting_steps))
return false;
@@ -382,8 +382,8 @@ bool PackageManagerFancy::DrawStatusLine()
if (_config->FindB("Dpkg::Progress-Fancy::Progress-Bar", true))
{
int padding = 4;
- float progressbar_size = size.columns - padding - progress_str.size();
- float current_percent = percentage / 100.0;
+ auto const progressbar_size = size.columns - padding - progress_str.size();
+ auto const current_percent = percentage / 100.0;
std::cout << " "
<< GetTextProgressStr(current_percent, progressbar_size)
<< " ";