Skip to content

Commit f32dfe9

Browse files
committed
fix warnings
1 parent 916a27f commit f32dfe9

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2749,7 +2749,7 @@ QString QgisApp::crsAndFormatAdjustedLayerUri( const QString &uri , const QStrin
27492749
foreach ( QString c, supportedCrs )
27502750
{
27512751
testCrs.createFromOgcWmsCrs( c );
2752-
if ( testCrs == mMapCanvas->mapRenderer()->destinationCrs() )
2752+
if ( testCrs == mMapCanvas->mapSettings().destinationCrs() )
27532753
{
27542754
newuri.replace( QRegExp( "crs=[^&]+" ), "crs=" + c );
27552755
QgsDebugMsg( QString( "Changing layer crs to %1, new uri: %2" ).arg( c, uri ) );

src/app/qgsadvanceddigitizingdockwidget.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ QgsAdvancedDigitizingDockWidget::QgsAdvancedDigitizingDockWidget( QgsMapCanvas*
154154
commonAngles << QPair<int, QString>( 45, tr( "Snap to 45%1 angles" ).arg( QString::fromUtf8( "°" ) ) );
155155
commonAngles << QPair<int, QString>( 90, tr( "Snap to 90%1 angles" ).arg( QString::fromUtf8( "°" ) ) );
156156
commonAngles << QPair<int, QString>( 0, tr( "Do not snap to common angles" ) );
157-
for ( QList< QPair< int, QString > >::const_iterator it = commonAngles.begin(); it != commonAngles.end(); it++ )
157+
for ( QList< QPair< int, QString > >::const_iterator it = commonAngles.begin(); it != commonAngles.end(); ++it )
158158
{
159159
QAction* action = new QAction( it->second, menu );
160160
action->setCheckable( true );
@@ -642,6 +642,10 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent* e )
642642
else if ( mYConstraint->isLocked() )
643643
{
644644
if ( sina == 0 )
645+
{
646+
res = false;
647+
}
648+
else
645649
{
646650
double y = mYConstraint->value();
647651
if ( !mYConstraint->relative() )
@@ -1110,7 +1114,6 @@ bool QgsAdvancedDigitizingDockWidget::filterKeyPress( QKeyEvent* e )
11101114
default:
11111115
{
11121116
return false; // continues
1113-
break;
11141117
}
11151118
}
11161119
return true; // stop the event

src/plugins/dxf2shp_converter/shapelib-1.2.10/dbfopen.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ DBFOpen( const char * pszFilename, const char * pszAccess )
389389
/* Read in Field Definitions */
390390
/* -------------------------------------------------------------------- */
391391

392-
pabyBuf = ( unsigned char * ) SfRealloc( pabyBuf, nHeadLen );
393-
psDBF->pszHeader = ( char * ) pabyBuf;
392+
pabyBuf = psDBF->pszHeader = ( unsigned char * ) SfRealloc( pabyBuf, nHeadLen );
394393

395394
fseek( psDBF->fp, 32, 0 );
396395
if ( fread( pabyBuf, nHeadLen - 32, 1, psDBF->fp ) != 1 )

src/providers/ogr/qgsogrprovider.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ bool QgsOgrProvider::addFeature( QgsFeature& f )
985985

986986
const QgsAttributes& attrs = f.attributes();
987987

988-
const char *oldlocale = setlocale( LC_NUMERIC, NULL );
988+
char *oldlocale = setlocale( LC_NUMERIC, NULL );
989989
if ( oldlocale )
990990
oldlocale = strdup( oldlocale );
991991

@@ -1067,8 +1067,8 @@ bool QgsOgrProvider::addFeature( QgsFeature& f )
10671067
OGR_F_Destroy( feature );
10681068

10691069
setlocale( LC_NUMERIC, oldlocale );
1070-
if (oldlocale)
1071-
free(oldlocale);
1070+
if ( oldlocale )
1071+
free( oldlocale );
10721072

10731073
return returnValue;
10741074
}
@@ -1200,7 +1200,7 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap & attr
12001200

12011201
const QgsAttributeMap& attr = it.value();
12021202

1203-
const char *oldlocale = setlocale( LC_NUMERIC, NULL );
1203+
char *oldlocale = setlocale( LC_NUMERIC, NULL );
12041204
if ( oldlocale )
12051205
oldlocale = strdup( oldlocale );
12061206
setlocale( LC_NUMERIC, "C" );
@@ -1267,8 +1267,8 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap & attr
12671267
}
12681268

12691269
setlocale( LC_NUMERIC, oldlocale );
1270-
if (oldlocale)
1271-
free(oldlocale);
1270+
if ( oldlocale )
1271+
free( oldlocale );
12721272
}
12731273

12741274
if ( OGR_L_SyncToDisk( ogrLayer ) != OGRERR_NONE )

0 commit comments

Comments
 (0)