Skip to content
Permalink
Browse files

fix warnings

  • Loading branch information
jef-n committed Dec 30, 2014
1 parent 916a27f commit f32dfe99c2004f07a711c7fac615062cb903c14f
@@ -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 ) );
@@ -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 );
@@ -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() )
@@ -1110,7 +1114,6 @@ bool QgsAdvancedDigitizingDockWidget::filterKeyPress( QKeyEvent* e )
default:
{
return false; // continues
break;
}
}
return true; // stop the event
@@ -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 )
@@ -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 );

@@ -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;
}
@@ -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" );
@@ -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 )

0 comments on commit f32dfe9

Please sign in to comment.
You can’t perform that action at this time.