Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Dec 30, 2014
1 parent 916a27f commit f32dfe9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2749,7 +2749,7 @@ QString QgisApp::crsAndFormatAdjustedLayerUri( const QString &uri , const QStrin
foreach ( QString c, supportedCrs )
{
testCrs.createFromOgcWmsCrs( c );
if ( testCrs == mMapCanvas->mapRenderer()->destinationCrs() )
if ( testCrs == mMapCanvas->mapSettings().destinationCrs() )
{
newuri.replace( QRegExp( "crs=[^&]+" ), "crs=" + c );
QgsDebugMsg( QString( "Changing layer crs to %1, new uri: %2" ).arg( c, uri ) );
Expand Down
7 changes: 5 additions & 2 deletions src/app/qgsadvanceddigitizingdockwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ QgsAdvancedDigitizingDockWidget::QgsAdvancedDigitizingDockWidget( QgsMapCanvas*
commonAngles << QPair<int, QString>( 45, tr( "Snap to 45%1 angles" ).arg( QString::fromUtf8( "°" ) ) );
commonAngles << QPair<int, QString>( 90, tr( "Snap to 90%1 angles" ).arg( QString::fromUtf8( "°" ) ) );
commonAngles << QPair<int, QString>( 0, tr( "Do not snap to common angles" ) );
for ( QList< QPair< int, QString > >::const_iterator it = commonAngles.begin(); it != commonAngles.end(); it++ )
for ( QList< QPair< int, QString > >::const_iterator it = commonAngles.begin(); it != commonAngles.end(); ++it )
{
QAction* action = new QAction( it->second, menu );
action->setCheckable( true );
Expand Down Expand Up @@ -642,6 +642,10 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent* e )
else if ( mYConstraint->isLocked() )
{
if ( sina == 0 )
{
res = false;
}
else
{
double y = mYConstraint->value();
if ( !mYConstraint->relative() )
Expand Down Expand Up @@ -1110,7 +1114,6 @@ bool QgsAdvancedDigitizingDockWidget::filterKeyPress( QKeyEvent* e )
default:
{
return false; // continues
break;
}
}
return true; // stop the event
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/dxf2shp_converter/shapelib-1.2.10/dbfopen.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,7 @@ DBFOpen( const char * pszFilename, const char * pszAccess )
/* Read in Field Definitions */
/* -------------------------------------------------------------------- */

pabyBuf = ( unsigned char * ) SfRealloc( pabyBuf, nHeadLen );
psDBF->pszHeader = ( char * ) pabyBuf;
pabyBuf = psDBF->pszHeader = ( unsigned char * ) SfRealloc( pabyBuf, nHeadLen );

fseek( psDBF->fp, 32, 0 );
if ( fread( pabyBuf, nHeadLen - 32, 1, psDBF->fp ) != 1 )
Expand Down
12 changes: 6 additions & 6 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ bool QgsOgrProvider::addFeature( QgsFeature& f )

const QgsAttributes& attrs = f.attributes();

const char *oldlocale = setlocale( LC_NUMERIC, NULL );
char *oldlocale = setlocale( LC_NUMERIC, NULL );
if ( oldlocale )
oldlocale = strdup( oldlocale );

Expand Down Expand Up @@ -1067,8 +1067,8 @@ bool QgsOgrProvider::addFeature( QgsFeature& f )
OGR_F_Destroy( feature );

setlocale( LC_NUMERIC, oldlocale );
if (oldlocale)
free(oldlocale);
if ( oldlocale )
free( oldlocale );

return returnValue;
}
Expand Down Expand Up @@ -1200,7 +1200,7 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap & attr

const QgsAttributeMap& attr = it.value();

const char *oldlocale = setlocale( LC_NUMERIC, NULL );
char *oldlocale = setlocale( LC_NUMERIC, NULL );
if ( oldlocale )
oldlocale = strdup( oldlocale );
setlocale( LC_NUMERIC, "C" );
Expand Down Expand Up @@ -1267,8 +1267,8 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap & attr
}

setlocale( LC_NUMERIC, oldlocale );
if (oldlocale)
free(oldlocale);
if ( oldlocale )
free( oldlocale );
}

if ( OGR_L_SyncToDisk( ogrLayer ) != OGRERR_NONE )
Expand Down

0 comments on commit f32dfe9

Please sign in to comment.