Skip to content
Snippets Groups Projects
Commit 34eb9acf authored by Thomas Feuvrier's avatar Thomas Feuvrier
Browse files

BUG: correction on Visual error C2668: 'floor' : ambiguous call to overloaded...

BUG: correction on Visual error C2668: 'floor' : ambiguous call to overloaded function: replace ::floor by vcl_floor
parent af8db17c
Branches
Tags
No related merge requests found
......@@ -18,8 +18,9 @@ PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbImageRegionTileMapSplitter_txx
#define __otbImageRegionTileMapSplitter_txx
#include "otbImageRegionTileMapSplitter.h"
#include <math.h>
#include "otbMath.h"
namespace otb
{
......@@ -49,8 +50,8 @@ ImageRegionTileMapSplitter<VImageDimension>
// determine the actual number of pieces that will be generated
SizeValueType range = regionSize[splitAxis];
int valuesPerPiece = ((int)::ceil(range/((double)requestedNumber*256))) * 256;
int maxPieceUsed = (int)::ceil(range/(double)valuesPerPiece);
int valuesPerPiece = static_cast<int>(vcl_ceil(static_cast<double>(range/((double)requestedNumber*256)) ) ) * 256;
int maxPieceUsed = static_cast<int>(vcl_ceil(static_cast<double>(range/(double)valuesPerPiece)));
return maxPieceUsed + 1;
}
......@@ -90,8 +91,8 @@ ImageRegionTileMapSplitter<VImageDimension>
// determine the actual number of pieces that will be generated
SizeValueType range = regionSize[splitAxis];
int valuesPerPiece = ((int)::ceil(range/((double)numberOfPieces*256))) * 256;
int maxPieceUsed = (int)::ceil(range/(double)valuesPerPiece);
int valuesPerPiece = static_cast<int>((int)vcl_ceil(static_cast<double>(range/((double)numberOfPieces*256)))) * 256;
int maxPieceUsed = static_cast<int>(vcl_ceil(static_cast<double>(range/(double)valuesPerPiece)));
// Split the region
if ((int) i == maxPieceUsed-1)
......@@ -105,7 +106,7 @@ ImageRegionTileMapSplitter<VImageDimension>
{
//First piece may not contain a whole piece
//splitIndex stay at splitRegion.GetIndex();
splitSize[splitAxis] = (((int)::floor(splitIndex[splitAxis]/valuesPerPiece))+1)
splitSize[splitAxis] = ((static_cast<int>(vcl_floor(static_cast<double>(splitIndex[splitAxis]/valuesPerPiece))))+1)
*valuesPerPiece - splitIndex[splitAxis];
}
if ((int) i < maxPieceUsed-1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment