Skip to content

Commit 5a36a33

Browse files
committedJul 16, 2018
fix build on osx
1 parent f9fc708 commit 5a36a33

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed
 

‎external/mdal/frmts/mdal_gdal.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ void MDAL::GdalDataset::init( const std::string &dsName )
2929

3030
void MDAL::GdalDataset::parseParameters()
3131
{
32-
mNBands = static_cast<uint>( GDALGetRasterCount( mHDataset ) );
32+
mNBands = static_cast<unsigned int>( GDALGetRasterCount( mHDataset ) );
3333
if ( mNBands == 0 ) throw MDAL_Status::Err_InvalidData;
3434

3535
GDALGetGeoTransform( mHDataset, mGT ); // in case of error it returns Identid
3636

37-
mXSize = static_cast<uint>( GDALGetRasterXSize( mHDataset ) ); //raster width in pixels
37+
mXSize = static_cast<unsigned int>( GDALGetRasterXSize( mHDataset ) ); //raster width in pixels
3838
if ( mXSize == 0 ) throw MDAL_Status::Err_InvalidData;
3939

40-
mYSize = static_cast<uint>( GDALGetRasterYSize( mHDataset ) ); //raster height in pixels
40+
mYSize = static_cast<unsigned int>( GDALGetRasterYSize( mHDataset ) ); //raster height in pixels
4141
if ( mYSize == 0 ) throw MDAL_Status::Err_InvalidData;
4242

4343
mNPoints = mXSize * mYSize;
@@ -72,13 +72,13 @@ bool MDAL::LoaderGdal::meshes_equals( const MDAL::GdalDataset *ds1, const MDAL::
7272
bool MDAL::LoaderGdal::initVertices( Vertices &vertices )
7373
{
7474
Vertex *VertexsPtr = vertices.data();
75-
uint mXSize = meshGDALDataset()->mXSize;
76-
uint mYSize = meshGDALDataset()->mYSize;
75+
unsigned int mXSize = meshGDALDataset()->mXSize;
76+
unsigned int mYSize = meshGDALDataset()->mYSize;
7777
const double *mGT = meshGDALDataset()->mGT;
7878

79-
for ( uint y = 0; y < mYSize; ++y )
79+
for ( unsigned int y = 0; y < mYSize; ++y )
8080
{
81-
for ( uint x = 0; x < mXSize; ++x, ++VertexsPtr )
81+
for ( unsigned int x = 0; x < mXSize; ++x, ++VertexsPtr )
8282
{
8383
// VertexsPtr->setId(x + mXSize*y);
8484
VertexsPtr->x = mGT[0] + ( x + 0.5 ) * mGT[1] + ( y + 0.5 ) * mGT[2];
@@ -111,14 +111,14 @@ bool MDAL::LoaderGdal::initVertices( Vertices &vertices )
111111
void MDAL::LoaderGdal::initFaces( Vertices &Vertexs, Faces &Faces, bool is_longitude_shifted )
112112
{
113113
int reconnected = 0;
114-
uint mXSize = meshGDALDataset()->mXSize;
115-
uint mYSize = meshGDALDataset()->mYSize;
114+
unsigned int mXSize = meshGDALDataset()->mXSize;
115+
unsigned int mYSize = meshGDALDataset()->mYSize;
116116

117117
size_t i = 0;
118118

119-
for ( uint y = 0; y < mYSize - 1; ++y )
119+
for ( unsigned int y = 0; y < mYSize - 1; ++y )
120120
{
121-
for ( uint x = 0; x < mXSize - 1; ++x )
121+
for ( unsigned int x = 0; x < mXSize - 1; ++x )
122122
{
123123
if ( is_longitude_shifted &&
124124
( Vertexs[x + mXSize * y].x > 0.0 ) &&
@@ -195,7 +195,7 @@ MDAL::LoaderGdal::metadata_hash MDAL::LoaderGdal::parseMetadata( GDALMajorObject
195195

196196
void MDAL::LoaderGdal::parseRasterBands( const MDAL::GdalDataset *cfGDALDataset )
197197
{
198-
for ( uint i = 1; i <= cfGDALDataset->mNBands; ++i ) // starts with 1 .... ehm....
198+
for ( unsigned int i = 1; i <= cfGDALDataset->mNBands; ++i ) // starts with 1 .... ehm....
199199
{
200200
// Get Band
201201
GDALRasterBandH gdalBand = GDALGetRasterBand( cfGDALDataset->mHDataset, static_cast<int>( i ) );
@@ -262,10 +262,10 @@ void MDAL::LoaderGdal::addDataToOutput( GDALRasterBandH raster_band, std::shared
262262
assert( raster_band );
263263

264264
double nodata = GDALGetRasterNoDataValue( raster_band, nullptr );
265-
uint mXSize = meshGDALDataset()->mXSize;
266-
uint mYSize = meshGDALDataset()->mYSize;
265+
unsigned int mXSize = meshGDALDataset()->mXSize;
266+
unsigned int mYSize = meshGDALDataset()->mYSize;
267267

268-
for ( uint y = 0; y < mYSize; ++y )
268+
for ( unsigned int y = 0; y < mYSize; ++y )
269269
{
270270
// buffering per-line
271271
CPLErr err = GDALRasterIO(
@@ -287,9 +287,9 @@ void MDAL::LoaderGdal::addDataToOutput( GDALRasterBandH raster_band, std::shared
287287
throw MDAL_Status::Err_InvalidData;
288288
}
289289

290-
for ( uint x = 0; x < mXSize; ++x )
290+
for ( unsigned int x = 0; x < mXSize; ++x )
291291
{
292-
uint idx = x + mXSize * y;
292+
unsigned int idx = x + mXSize * y;
293293
double val = mPafScanline[x];
294294
bool noData = false;
295295
if ( MDAL::equals( val, nodata ) )
@@ -324,7 +324,7 @@ void MDAL::LoaderGdal::addDataToOutput( GDALRasterBandH raster_band, std::shared
324324
void MDAL::LoaderGdal::activateFaces( std::shared_ptr<Dataset> tos )
325325
{
326326
// Activate only Faces that do all Vertex's outputs with some data
327-
for ( uint idx = 0; idx < meshGDALDataset()->mNVolumes; ++idx )
327+
for ( unsigned int idx = 0; idx < meshGDALDataset()->mNVolumes; ++idx )
328328
{
329329
Face elem = mMesh->faces.at( idx );
330330

‎external/mdal/frmts/mdal_gdal.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ namespace MDAL
3535
std::string mProj;
3636
GDALDatasetH mHDataset;
3737

38-
uint mNBands; /* number of bands */
39-
uint mXSize; /* number of x pixels */
40-
uint mYSize; /* number of y pixels */
41-
uint mNPoints; /* nodes count */
42-
uint mNVolumes; /* Faces count */
38+
unsigned int mNBands; /* number of bands */
39+
unsigned int mXSize; /* number of x pixels */
40+
unsigned int mYSize; /* number of y pixels */
41+
unsigned int mNPoints; /* nodes count */
42+
unsigned int mNVolumes; /* Faces count */
4343
double mGT[6]; /* affine transform matrix */
4444

4545
private:

0 commit comments

Comments
 (0)
Please sign in to comment.