Browse Source

Avoid implicitly promotion of float to double

Reported-By: gcc -Wdouble-promotion
Gbp-Dch: Ignore
tags/debian/1.7.0_alpha0ubuntu2
David Kalnischkies 3 years ago
parent
commit
5f9c05db78
3 changed files with 3 additions and 2 deletions
  1. +1
    -0
      CMakeLists.txt
  2. +1
    -1
      apt-pkg/contrib/progress.cc
  3. +1
    -1
      apt-pkg/install-progress.cc

+ 1
- 0
CMakeLists.txt View File

@@ -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)


+ 1
- 1
apt-pkg/contrib/progress.cc View File

@@ -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;


+ 1
- 1
apt-pkg/install-progress.cc View File

@@ -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)
<< " ";


Loading…
Cancel
Save