Skip to content

Commit bb17e82

Browse files
committed
Changed from int to size_t in some places
1 parent 35f7a1c commit bb17e82

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/core/qgsrasterdataprovider.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void QgsRasterDataProvider::readBlock( int bandNo, QgsRectangle
6464
return;
6565

6666
// Allocate memory for not projected source data
67-
int mySize = dataTypeSize( bandNo ) / 8;
67+
size_t mySize = dataTypeSize( bandNo ) / 8;
6868
void *mySrcData = malloc( mySize * myProjector.srcRows() * myProjector.srcCols() );
6969

7070
time.restart();
@@ -265,9 +265,9 @@ QString QgsRasterDataProvider::lastErrorFormat()
265265
QByteArray QgsRasterDataProvider::noValueBytes( int theBandNo )
266266
{
267267
int type = dataType( theBandNo );
268-
int size = dataTypeSize( theBandNo ) / 8;
268+
size_t size = dataTypeSize( theBandNo ) / 8;
269269
QByteArray ba;
270-
ba.resize( size );
270+
ba.resize(( int )size );
271271
char * data = ba.data();
272272
double noval = mNoDataValue[theBandNo-1];
273273
unsigned char uc;

src/core/qgsrasterprojector.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void QgsRasterProjector::calc()
194194
}
195195
// What is the maximum reasonable size of transformatio matrix?
196196
// TODO: consider better when to break - ratio
197-
if ( mCPRows * mCPCols > 0.0625 * mDestRows * mDestCols )
197+
if ( mCPRows * mCPCols > 0.25 * mDestRows * mDestCols )
198198
{
199199
QgsDebugMsg( "Too large CP matrix" );
200200
mApproximate = false;
@@ -679,11 +679,11 @@ void * QgsRasterProjector::readBlock( int bandNo, QgsRectangle const & extent,
679679

680680
if ( !inputData ) return 0;
681681

682-
int pixelSize = mInput->typeSize( mInput->dataType( bandNo ) ) / 8;
682+
size_t pixelSize = mInput->typeSize( mInput->dataType( bandNo ) ) / 8;
683683

684-
int inputSize = pixelSize * srcCols() * srcRows();
684+
size_t inputSize = pixelSize * srcCols() * srcRows();
685685

686-
int outputSize = width * height * pixelSize;
686+
size_t outputSize = width * height * pixelSize;
687687
void * outputData = malloc( outputSize );
688688

689689
// Check for allcoation error
@@ -701,8 +701,8 @@ void * QgsRasterProjector::readBlock( int bandNo, QgsRectangle const & extent,
701701
for ( int j = 0; j < width; ++j )
702702
{
703703
srcRowCol( i, j, &srcRow, &srcCol );
704-
int srcIndex = pixelSize * ( srcRow * mSrcCols + srcCol );
705-
int destIndex = pixelSize * ( i * width + j );
704+
size_t srcIndex = pixelSize * ( srcRow * mSrcCols + srcCol );
705+
size_t destIndex = pixelSize * ( i * width + j );
706706

707707
if ( srcIndex >= inputSize || destIndex >= outputSize ) continue; // should not happen
708708

0 commit comments

Comments
 (0)