Skip to content

Commit 269d32c

Browse files
committed
fix build errors and warnings on windows (interface apparently is a keyword in VC++)
1 parent b64b3fc commit 269d32c

10 files changed

+24
-24
lines changed

src/app/qgsmaptoolfreezelabels.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "qgscoordinatetransform.h"
2525

2626
class QgsHighlight;
27-
class QgsLabelPosition;
27+
struct QgsLabelPosition;
2828

2929
/**A map tool for freezing (writing to attribute table) and thawing label positions and rotation*/
3030
class QgsMapToolFreezeLabels: public QgsMapToolLabel

src/app/qgsrasterlayerproperties.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,12 +1566,12 @@ void QgsRasterLayerProperties::updatePipeItems()
15661566
for ( int i = 0; i < pipe->size(); i++ )
15671567
{
15681568
if ( i >= mPipeTreeWidget->topLevelItemCount() ) break;
1569-
QgsRasterInterface * interface = pipe->at( i );
15701569
QTreeWidgetItem *item = mPipeTreeWidget->topLevelItem( i );
15711570
if ( !item ) continue;
15721571
// Checkboxes disabled for now, see above
15731572
#if 0
1574-
bool on = interface->on();
1573+
QgsRasterInterface * iface = pipe->at( i );
1574+
bool on = iface->on();
15751575
Qt::ItemFlags flags = item->flags();
15761576
if ( pipe->canSetOn( i, !on ) )
15771577
{

src/core/raster/qgsrasterdrawer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
class QPainter;
2525
class QImage;
2626
class QgsMapToPixel;
27-
class QgsRasterViewPort;
27+
struct QgsRasterViewPort;
2828
class QgsRasterIterator;
2929

3030
class QgsRasterDrawer

src/core/raster/qgsrasterfilewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ QgsRasterFileWriter::WriterError QgsRasterFileWriter::writeImageRaster( QgsRaste
188188
void* blueData = VSIMalloc( mMaxTileWidth * mMaxTileHeight );
189189
void* alphaData = VSIMalloc( mMaxTileWidth * mMaxTileHeight );
190190
QgsRectangle mapRect;
191-
int iterLeft, iterTop, iterCols, iterRows;
191+
int iterLeft = 0, iterTop = 0, iterCols = 0, iterRows = 0;
192192
int fileIndex = 0;
193193

194194
//create destProvider for whole dataset here

src/core/raster/qgsrasteriterator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
class QgsMapToPixel;
88
class QgsRasterInterface;
99
class QgsRasterProjector;
10-
class QgsRasterViewPort;
10+
struct QgsRasterViewPort;
1111

12-
class QgsRasterIterator
12+
class CORE_EXPORT QgsRasterIterator
1313
{
1414
public:
1515
//Stores information about reading of a raster band. Columns and rows are in unsampled coordinates

src/core/raster/qgsrasterpipe.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,34 +174,34 @@ bool QgsRasterPipe::set( QgsRasterInterface* theInterface )
174174
return insert( idx, theInterface ); // insert may still fail and return false
175175
}
176176

177-
QgsRasterInterface * QgsRasterPipe::interface( Role role ) const
177+
QgsRasterInterface * QgsRasterPipe::iface( Role role ) const
178+
{
179+
QgsDebugMsg( QString( "role = %1" ).arg( role ) );
180+
if ( mRoleMap.contains( role ) )
178181
{
179-
QgsDebugMsg( QString( "role = %1" ).arg( role ) );
180-
if ( mRoleMap.contains( role ) )
181-
{
182-
return mInterfaces.value( mRoleMap.value( role ) );
183-
}
184-
return 0;
182+
return mInterfaces.value( mRoleMap.value( role ) );
185183
}
184+
return 0;
185+
}
186186

187187
QgsRasterDataProvider * QgsRasterPipe::provider() const
188188
{
189-
return dynamic_cast<QgsRasterDataProvider *>( interface( ProviderRole ) );
189+
return dynamic_cast<QgsRasterDataProvider *>( iface( ProviderRole ) );
190190
}
191191

192192
QgsRasterRenderer * QgsRasterPipe::renderer() const
193193
{
194-
return dynamic_cast<QgsRasterRenderer *>( interface( RendererRole ) );
194+
return dynamic_cast<QgsRasterRenderer *>( iface( RendererRole ) );
195195
}
196196

197197
QgsRasterResampleFilter * QgsRasterPipe::resampleFilter() const
198198
{
199-
return dynamic_cast<QgsRasterResampleFilter *>( interface( ResamplerRole ) );
199+
return dynamic_cast<QgsRasterResampleFilter *>( iface( ResamplerRole ) );
200200
}
201201

202202
QgsRasterProjector * QgsRasterPipe::projector() const
203203
{
204-
return dynamic_cast<QgsRasterProjector*>( interface( ProjectorRole ) );
204+
return dynamic_cast<QgsRasterProjector*>( iface( ProjectorRole ) );
205205
}
206206

207207
bool QgsRasterPipe::remove( int idx )

src/core/raster/qgsrasterpipe.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class CORE_EXPORT QgsRasterPipe
6969
bool set( QgsRasterInterface * theInterface );
7070

7171
/** Get known interface by role */
72-
QgsRasterInterface * interface( Role role ) const;
72+
QgsRasterInterface * iface( Role role ) const;
7373

7474
/** Remove and delete interface at given index if possible */
7575
bool remove( int idx );
@@ -99,7 +99,7 @@ class CORE_EXPORT QgsRasterPipe
9999

100100
private:
101101
/** Get known parent type_info of interface parent */
102-
Role interfaceRole( QgsRasterInterface * interface ) const;
102+
Role interfaceRole( QgsRasterInterface * iface ) const;
103103

104104
// Interfaces in pipe, the first is always provider
105105
QVector<QgsRasterInterface*> mInterfaces;

src/core/raster/qgsrasterresamplefilter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ bool QgsRasterResampleFilter::setInput( QgsRasterInterface* input )
9090

9191
if ( input->dataType( 1 ) != QgsRasterInterface::ARGB32_Premultiplied )
9292
{
93-
return false;
9493
QgsDebugMsg( "Unknown input data type" );
94+
return false;
9595
}
9696

9797
mInput = input;
@@ -191,7 +191,7 @@ void QgsRasterResampleFilter::writeXML( QDomDocument& doc, QDomElement& parentEl
191191

192192
QDomElement rasterRendererElem = doc.createElement( "rasterresampler" );
193193

194-
rasterRendererElem.setAttribute( "maxOversampling", mMaxOversampling );
194+
rasterRendererElem.setAttribute( "maxOversampling", QString::number( mMaxOversampling ) );
195195
if ( mZoomedInResampler )
196196
{
197197
rasterRendererElem.setAttribute( "zoomedInResampler", mZoomedInResampler->type() );

src/core/raster/qgsrasterresamplefilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class QgsRasterResampler;
2525

2626
class QDomElement;
2727

28-
class QgsRasterResampleFilter : public QgsRasterInterface
28+
class CORE_EXPORT QgsRasterResampleFilter : public QgsRasterInterface
2929
{
3030
public:
3131
QgsRasterResampleFilter( QgsRasterInterface* input = 0 );

src/gui/qgsrasterformatsaveoptionswidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ bool QgsRasterFormatSaveOptionsWidget::validateOptions( bool gui )
262262
{
263263
// print error string?
264264
char** papszOptions = papszFromStringList( createOptions );
265-
ok = ( GDALValidateCreationOptions( myGdalDriver, papszOptions ) == TRUE );
265+
ok = GDALValidateCreationOptions( myGdalDriver, papszOptions );
266266
CSLDestroy( papszOptions );
267267
if ( gui )
268268
{

0 commit comments

Comments
 (0)