Commit bcab0df4 authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

COMP: fix compile errors on GCC 4.1.2

parent 8d98bfe1
......@@ -17,7 +17,7 @@
=========================================================================*/
#include "mvdProcessObjectObserver.h"
#include <cassert>
/*****************************************************************************/
/* INCLUDE SECTION */
......
......@@ -29,6 +29,8 @@
//
// System includes (sorted by alphabetic order)
#include <cassert>
#include <cmath>
//
// ITK includes (sorted by alphabetic order)
......@@ -40,7 +42,6 @@
// Monteverdi includes (sorted by alphabetic order)
#include "Gui/mvdGui.h"
namespace mvd
{
......@@ -250,12 +251,21 @@ MultiResolutionPyramidWidget
m_UI->sizeSpinBox->setRange( 1, size );
assert(m_GDALOverviewsBuilder->CountResolutions() >= m_GDALOverviewsBuilder->GetNbResolutions() );
// Force C++ implicit cast by declaring local variables to force compiler
// to find correct std::pow() signature.
//
// It fixes compile-time:
// error: call of pow(unsigned int, unsigned int) is ambiguous
double rf = m_GDALOverviewsBuilder->GetResolutionFactor();
int m = m_GDALOverviewsBuilder->CountResolutions() -
m_GDALOverviewsBuilder->GetNbResolutions();
m_UI->sizeSpinBox->setValue(
std::pow(
m_GDALOverviewsBuilder->GetResolutionFactor(),
m_GDALOverviewsBuilder->CountResolutions() -
m_GDALOverviewsBuilder->GetNbResolutions()
)
static_cast< int >(
std::pow ( rf,
m
) )
);
m_UI->sizeSpinBox->blockSignals( signalsBlocked );
......@@ -306,18 +316,17 @@ MultiResolutionPyramidWidget
unsigned int count = m_GDALOverviewsBuilder->CountResolutions();
m_UI->sizeSpinBox->setValue(
static_cast< int >(
std::pow(
m_GDALOverviewsBuilder->GetResolutionFactor(),
count -
std::min(
m_GDALOverviewsBuilder->GetNbResolutions(),
count
)
)
)
);
// Force C++ implicit cast by declaring local variables to force compiler
// to find correct std::pow() signature.
//
// It fixes compile-time:
// error: call of pow(unsigned int, unsigned int) is ambiguous
double rf = m_GDALOverviewsBuilder->GetResolutionFactor();
int m = count -
std::min(
m_GDALOverviewsBuilder->GetNbResolutions(),
count
);
m_UI->sizeSpinBox->blockSignals( signalsBlocked );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment