summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--apt-pkg/contrib/progress.cc2
-rw-r--r--apt-pkg/install-progress.cc2
3 files changed, 3 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ecfa5ed1d..3607bba2b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,6 +68,7 @@ add_optional_compile_options(Wmissing-include-dirs)
add_optional_compile_options(Wnoexcept)
add_optional_compile_options(Wsign-promo)
add_optional_compile_options(Wundef)
+add_optional_compile_options(Wdouble-promotion)
# apt-ftparchive dependencies
find_package(BerkeleyDB REQUIRED)
diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc
index 5499f0946..6743889b8 100644
--- a/apt-pkg/contrib/progress.cc
+++ b/apt-pkg/contrib/progress.cc
@@ -118,7 +118,7 @@ bool OpProgress::CheckChange(float Interval)
// Check time delta
struct timeval Now;
gettimeofday(&Now,0);
- double Diff = Now.tv_sec - LastTime.tv_sec + (Now.tv_usec - LastTime.tv_usec)/1000000.0;
+ decltype(Interval) const Diff = Now.tv_sec - LastTime.tv_sec + (Now.tv_usec - LastTime.tv_usec)/1000000.0;
if (Diff < Interval)
return false;
LastTime = Now;
diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc
index f9c8b6d96..2e8fac236 100644
--- a/apt-pkg/install-progress.cc
+++ b/apt-pkg/install-progress.cc
@@ -383,7 +383,7 @@ bool PackageManagerFancy::DrawStatusLine()
{
int padding = 4;
auto const progressbar_size = size.columns - padding - progress_str.size();
- auto const current_percent = percentage / 100.0;
+ auto const current_percent = percentage / 100.0f;
std::cout << " "
<< GetTextProgressStr(current_percent, progressbar_size)
<< " ";