Skip to content

Commit 45d0c09

Browse files
author
jef
committed
fix gcc 4.3 warnings
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9292 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 3780322 commit 45d0c09

File tree

10 files changed

+50
-38
lines changed

10 files changed

+50
-38
lines changed

src/core/composer/qgslegendmodel.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ int QgsLegendModel::addVectorLayerItems( QStandardItem* layerItem, QgsMapLayer*
125125
const QList<QgsSymbol*> vectorSymbols = vectorRenderer->symbols();
126126
QList<QgsSymbol*>::const_iterator symbolIt = vectorSymbols.constBegin();
127127

128-
QStandardItem* currentSymbolItem = 0;
129-
130128
for ( ; symbolIt != vectorSymbols.constEnd(); ++symbolIt )
131129
{
132130
if ( !( *symbolIt ) )

src/plugins/grass/qgsgrassedit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ void QgsGrassEdit::columnTypeChanged( int row, int col )
649649

650650
QTableWidgetItem *ti = mAttributeTable->item( row, 2 );
651651
if ( ti )
652+
{
652653
if ( mAttributeTable->item( row, 1 )->text().compare( "varchar" ) == 0 )
653654
{
654655
ti->setFlags( ti->flags() | Qt::ItemIsEnabled );
@@ -657,6 +658,7 @@ void QgsGrassEdit::columnTypeChanged( int row, int col )
657658
{
658659
ti->setFlags( ti->flags() & ~Qt::ItemIsEnabled );
659660
}
661+
}
660662
}
661663

662664
void QgsGrassEdit::alterTable( void )

src/plugins/grass/qgsgrassedittools.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ void QgsGrassEditNewLine::mouseClick( QgsPoint & point, Qt::MouseButton button )
219219
}
220220
Vect_reset_line( e->mEditPoints );
221221
break;
222+
223+
default:
224+
// ignore others
225+
break;
222226
}
223227

224228
if ( e->mEditPoints->n_points == 0 )
@@ -324,7 +328,8 @@ void QgsGrassEditMoveVertex::mouseClick( QgsPoint & point, Qt::MouseButton butto
324328
e->setCanvasPropmt( QObject::tr( "Select vertex" ), "", "" );
325329
break;
326330

327-
case Qt::MidButton:
331+
default:
332+
// ignore others
328333
break;
329334
}
330335

@@ -466,7 +471,8 @@ void QgsGrassEditAddVertex::mouseClick( QgsPoint & point, Qt::MouseButton button
466471
e->setCanvasPropmt( QObject::tr( "Select line segment" ), "", "" );
467472
break;
468473

469-
case Qt::MidButton:
474+
default:
475+
// ignore others
470476
break;
471477
}
472478

@@ -595,7 +601,8 @@ void QgsGrassEditDeleteVertex::mouseClick( QgsPoint & point, Qt::MouseButton but
595601
e->setCanvasPropmt( QObject::tr( "Select vertex" ), "", "" );
596602
break;
597603

598-
case Qt::MidButton:
604+
default:
605+
// ignore others
599606
break;
600607
}
601608
}
@@ -668,7 +675,8 @@ void QgsGrassEditMoveLine::mouseClick( QgsPoint & point, Qt::MouseButton button
668675
e->setCanvasPropmt( QObject::tr( "Select element" ), "", "" );
669676
break;
670677

671-
case Qt::MidButton:
678+
default:
679+
// ignore others
672680
break;
673681
}
674682
}
@@ -750,7 +758,8 @@ void QgsGrassEditDeleteLine::mouseClick( QgsPoint & point, Qt::MouseButton butto
750758
e->setCanvasPropmt( QObject::tr( "Select element" ), "", "" );
751759
break;
752760

753-
case Qt::MidButton:
761+
default:
762+
// ignore others
754763
break;
755764
}
756765
}
@@ -844,7 +853,8 @@ void QgsGrassEditSplitLine::mouseClick( QgsPoint & point, Qt::MouseButton button
844853
e->setCanvasPropmt( QObject::tr( "Select point on line" ), "", "" );
845854
break;
846855

847-
case Qt::MidButton:
856+
default:
857+
// ignore others
848858
break;
849859
}
850860
}

src/plugins/grass/qgsgrassmapcalc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
#include "qgsmaplayer.h"
2525
#include "qgsgrassplugin.h"
2626

27-
#include <math.h>
27+
#include <cmath>
28+
#include <typeinfo>
2829

2930
#include <QDir>
3031
#include <QDomDocument>

src/plugins/grass/qgsgrassmodule.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "qgsmaplayer.h"
3232
#include "qgsvectorlayer.h"
3333

34+
#include <typeinfo>
3435
#include <QComboBox>
3536
#include <QDomDocument>
3637
#include <QFileDialog>

src/plugins/grass/qgsgrassnewmapset.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,9 +1256,9 @@ void QgsGrassNewMapset::createMapset()
12561256
// database path
12571257
QgsGrass::activeMode(); // because it calls private gsGrass::init()
12581258
#if defined(WIN32)
1259-
G__setenv( "GISDBASE", getShortPath( mDatabaseLineEdit->text() ).toAscii().data() );
1259+
G__setenv( (char *) "GISDBASE", getShortPath( mDatabaseLineEdit->text() ).toAscii().data() );
12601260
#else
1261-
G__setenv( "GISDBASE", mDatabaseLineEdit->text().toAscii().data() );
1261+
G__setenv( (char *) "GISDBASE", mDatabaseLineEdit->text().toAscii().data() );
12621262
#endif
12631263

12641264
QgsGrass::resetError();

src/plugins/grass/qgsgrassplugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ void QgsGrassPlugin::displayRegion()
548548
QgsGrass::setLocation( gisdbase, location );
549549

550550
struct Cell_head window;
551-
char *err = G__get_window( &window, "", "WIND", mapset.toLatin1().data() );
551+
char *err = G__get_window( &window, (char *) "", (char *) "WIND", mapset.toLatin1().data() );
552552

553553
if ( err )
554554
{

src/plugins/grass/qgsgrassregion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ QgsGrassRegion::QgsGrassRegion( QgsGrassPlugin *plugin, QgisInterface *iface,
165165
}
166166

167167
QgsGrass::setLocation( gisdbase, location );
168-
char *err = G__get_window( &mWindow, "", "WIND", mapset.toLatin1().data() );
168+
char *err = G__get_window( &mWindow, (char *) "", (char *) "WIND", mapset.toLatin1().data() );
169169

170170
if ( err )
171171
{
@@ -426,7 +426,7 @@ void QgsGrassRegion::accept()
426426
}
427427

428428
QgsGrass::setLocation( QgsGrass::getDefaultGisdbase(), QgsGrass::getDefaultLocation() );
429-
G__setenv( "MAPSET", QgsGrass::getDefaultMapset().toLatin1().data() );
429+
G__setenv( (char *) "MAPSET", QgsGrass::getDefaultMapset().toLatin1().data() );
430430

431431
if ( G_put_window( &mWindow ) == -1 )
432432
{

src/providers/grass/qgsgrass.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,12 @@ void QgsGrass::setLocation( QString gisdbase, QString location )
314314

315315
// Set principal GRASS variables (in memory)
316316
#if defined(WIN32)
317-
G__setenv( "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
317+
G__setenv( (char *) "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
318318
#else
319-
G__setenv( "GISDBASE", gisdbase.toAscii().data() );
319+
G__setenv( (char *) "GISDBASE", gisdbase.toAscii().data() );
320320
#endif
321-
G__setenv( "LOCATION_NAME", location.toAscii().data() );
322-
G__setenv( "MAPSET", "PERMANENT" ); // PERMANENT must always exist
321+
G__setenv( (char *) "LOCATION_NAME", location.toAscii().data() );
322+
G__setenv( (char *) "MAPSET", (char *) "PERMANENT" ); // PERMANENT must always exist
323323

324324
// Add all available mapsets to search path
325325
char **ms = G_available_mapsets();
@@ -333,12 +333,12 @@ void QgsGrass::setMapset( QString gisdbase, QString location, QString mapset )
333333

334334
// Set principal GRASS variables (in memory)
335335
#if defined(WIN32)
336-
G__setenv( "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
336+
G__setenv( (char *) "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
337337
#else
338-
G__setenv( "GISDBASE", gisdbase.toAscii().data() );
338+
G__setenv( (char *) "GISDBASE", gisdbase.toAscii().data() );
339339
#endif
340-
G__setenv( "LOCATION_NAME", location.toAscii().data() );
341-
G__setenv( "MAPSET", mapset.toAscii().data() );
340+
G__setenv( (char *) "LOCATION_NAME", location.toAscii().data() );
341+
G__setenv( (char *) "MAPSET", mapset.toAscii().data() );
342342

343343
// Add all available mapsets to search path
344344
char **ms = G_available_mapsets();
@@ -557,14 +557,14 @@ QString GRASS_EXPORT QgsGrass::openMapset( QString gisdbase, QString location, Q
557557
putenv( gisrcEnvChar );
558558

559559
// Reinitialize GRASS
560-
G__setenv( "GISRC", gisrcEnv.toAscii().data() );
560+
G__setenv( (char *) "GISRC", gisrcEnv.toAscii().data() );
561561
#if defined(WIN32)
562-
G__setenv( "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
562+
G__setenv( (char *) "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
563563
#else
564-
G__setenv( "GISDBASE", gisdbase.toAscii().data() );
564+
G__setenv( (char *) "GISDBASE", gisdbase.toAscii().data() );
565565
#endif
566-
G__setenv( "LOCATION_NAME", location.toAscii().data() );
567-
G__setenv( "MAPSET", mapset.toAscii().data() );
566+
G__setenv( (char *) "LOCATION_NAME", location.toAscii().data() );
567+
G__setenv( (char *) "MAPSET", mapset.toAscii().data() );
568568
defaultGisdbase = gisdbase;
569569
defaultLocation = location;
570570
defaultMapset = mapset;
@@ -596,13 +596,13 @@ QString QgsGrass::closeMapset( )
596596
}
597597
mMapsetLock = "";
598598

599-
putenv( "GISRC" );
599+
putenv( (char *) "GISRC" );
600600

601601
// Reinitialize GRASS
602-
G__setenv( "GISRC", "" );
603-
G__setenv( "GISDBASE", "" );
604-
G__setenv( "LOCATION_NAME", "" );
605-
G__setenv( "MAPSET", "" );
602+
G__setenv( (char *) "GISRC", (char *) "" );
603+
G__setenv( (char *) "GISDBASE", (char *) "" );
604+
G__setenv( (char *) "LOCATION_NAME", (char *) "" );
605+
G__setenv( (char *) "MAPSET", (char *) "" );
606606
defaultGisdbase = "";
607607
defaultLocation = "";
608608
defaultMapset = "";
@@ -876,7 +876,7 @@ bool GRASS_EXPORT QgsGrass::region( QString gisbase,
876876
{
877877
QgsGrass::setLocation( gisbase, location );
878878

879-
if ( G__get_window( window, "", "WIND", mapset.toLocal8Bit().data() ) )
879+
if ( G__get_window( window, (char *) "", (char *) "WIND", mapset.toLocal8Bit().data() ) )
880880
{
881881
return false;
882882
}
@@ -1009,7 +1009,7 @@ bool GRASS_EXPORT QgsGrass::mapRegion( int type, QString gisbase,
10091009
}
10101010
else if ( type == Region )
10111011
{
1012-
if ( G__get_window( window, "windows",
1012+
if ( G__get_window( window, (char *) "windows",
10131013
map.toLocal8Bit().data(),
10141014
mapset.toLocal8Bit().data() ) != NULL )
10151015
{

src/providers/grass/qgsgrassprovider.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ void QgsGrassProvider::loadAttributes( GLAYER &layer )
730730
QgsDebugMsg( "Database opened -> open select cursor" );
731731
dbString dbstr;
732732
db_init_string( &dbstr );
733-
db_set_string( &dbstr, "select * from " );
733+
db_set_string( &dbstr, (char *)"select * from " );
734734
db_append_string( &dbstr, layer.fieldInfo->table );
735735

736736
QgsDebugMsg( QString( "SQL: %1" ).arg( db_get_string( &dbstr ) ) );
@@ -1074,7 +1074,7 @@ void QgsGrassProvider::updateMap( int mapId )
10741074

10751075
// TODO: Should be done better / in other place ?
10761076
// TODO: Is it necessary for close ?
1077-
G__setenv( "MAPSET", map->mapset.toAscii().data() );
1077+
G__setenv( (char *)"MAPSET", map->mapset.toAscii().data() );
10781078

10791079
if ( closeMap ) Vect_close( map->map );
10801080

@@ -1423,7 +1423,7 @@ bool QgsGrassProvider::startEdit( void )
14231423

14241424
// Set current mapset (mapset was previously checked by isGrassEditable() )
14251425
// TODO: Should be done better / in other place ?
1426-
G__setenv( "MAPSET", map->mapset.toAscii().data() );
1426+
G__setenv( (char *)"MAPSET", map->mapset.toAscii().data() );
14271427

14281428
Vect_close( map->map );
14291429

@@ -1499,7 +1499,7 @@ bool QgsGrassProvider::closeEdit( bool newMap )
14991499
// Set current mapset (mapset was previously checked by isGrassEditable() )
15001500
// TODO: Should be done better / in other place ?
15011501
// TODO: Is it necessary for build/close ?
1502-
G__setenv( "MAPSET", map->mapset.toAscii().data() );
1502+
G__setenv( (char *) "MAPSET", map->mapset.toAscii().data() );
15031503

15041504
Vect_build_partial( map->map, GV_BUILD_NONE, NULL );
15051505
Vect_build( map->map, stderr );

0 commit comments

Comments
 (0)