Navigation Menu

Skip to content

Commit

Permalink
fix gcc 4.3 warnings
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9292 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 10, 2008
1 parent 2624cde commit d049698
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 38 deletions.
2 changes: 0 additions & 2 deletions src/core/composer/qgslegendmodel.cpp
Expand Up @@ -125,8 +125,6 @@ int QgsLegendModel::addVectorLayerItems( QStandardItem* layerItem, QgsMapLayer*
const QList<QgsSymbol*> vectorSymbols = vectorRenderer->symbols();
QList<QgsSymbol*>::const_iterator symbolIt = vectorSymbols.constBegin();

QStandardItem* currentSymbolItem = 0;

for ( ; symbolIt != vectorSymbols.constEnd(); ++symbolIt )
{
if ( !( *symbolIt ) )
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/grass/qgsgrassedit.cpp
Expand Up @@ -649,6 +649,7 @@ void QgsGrassEdit::columnTypeChanged( int row, int col )

QTableWidgetItem *ti = mAttributeTable->item( row, 2 );
if ( ti )
{
if ( mAttributeTable->item( row, 1 )->text().compare( "varchar" ) == 0 )
{
ti->setFlags( ti->flags() | Qt::ItemIsEnabled );
Expand All @@ -657,6 +658,7 @@ void QgsGrassEdit::columnTypeChanged( int row, int col )
{
ti->setFlags( ti->flags() & ~Qt::ItemIsEnabled );
}
}
}

void QgsGrassEdit::alterTable( void )
Expand Down
22 changes: 16 additions & 6 deletions src/plugins/grass/qgsgrassedittools.cpp
Expand Up @@ -219,6 +219,10 @@ void QgsGrassEditNewLine::mouseClick( QgsPoint & point, Qt::MouseButton button )
}
Vect_reset_line( e->mEditPoints );
break;

default:
// ignore others
break;
}

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

case Qt::MidButton:
default:
// ignore others
break;
}

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

case Qt::MidButton:
default:
// ignore others
break;
}

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

case Qt::MidButton:
default:
// ignore others
break;
}
}
Expand Down Expand Up @@ -668,7 +675,8 @@ void QgsGrassEditMoveLine::mouseClick( QgsPoint & point, Qt::MouseButton button
e->setCanvasPropmt( QObject::tr( "Select element" ), "", "" );
break;

case Qt::MidButton:
default:
// ignore others
break;
}
}
Expand Down Expand Up @@ -750,7 +758,8 @@ void QgsGrassEditDeleteLine::mouseClick( QgsPoint & point, Qt::MouseButton butto
e->setCanvasPropmt( QObject::tr( "Select element" ), "", "" );
break;

case Qt::MidButton:
default:
// ignore others
break;
}
}
Expand Down Expand Up @@ -844,7 +853,8 @@ void QgsGrassEditSplitLine::mouseClick( QgsPoint & point, Qt::MouseButton button
e->setCanvasPropmt( QObject::tr( "Select point on line" ), "", "" );
break;

case Qt::MidButton:
default:
// ignore others
break;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/grass/qgsgrassmapcalc.cpp
Expand Up @@ -24,7 +24,8 @@
#include "qgsmaplayer.h"
#include "qgsgrassplugin.h"

#include <math.h>
#include <cmath>
#include <typeinfo>

#include <QDir>
#include <QDomDocument>
Expand Down
1 change: 1 addition & 0 deletions src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -31,6 +31,7 @@
#include "qgsmaplayer.h"
#include "qgsvectorlayer.h"

#include <typeinfo>
#include <QComboBox>
#include <QDomDocument>
#include <QFileDialog>
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/grass/qgsgrassnewmapset.cpp
Expand Up @@ -1256,9 +1256,9 @@ void QgsGrassNewMapset::createMapset()
// database path
QgsGrass::activeMode(); // because it calls private gsGrass::init()
#if defined(WIN32)
G__setenv( "GISDBASE", getShortPath( mDatabaseLineEdit->text() ).toAscii().data() );
G__setenv( (char *) "GISDBASE", getShortPath( mDatabaseLineEdit->text() ).toAscii().data() );
#else
G__setenv( "GISDBASE", mDatabaseLineEdit->text().toAscii().data() );
G__setenv( (char *) "GISDBASE", mDatabaseLineEdit->text().toAscii().data() );
#endif

QgsGrass::resetError();
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassplugin.cpp
Expand Up @@ -548,7 +548,7 @@ void QgsGrassPlugin::displayRegion()
QgsGrass::setLocation( gisdbase, location );

struct Cell_head window;
char *err = G__get_window( &window, "", "WIND", mapset.toLatin1().data() );
char *err = G__get_window( &window, (char *) "", (char *) "WIND", mapset.toLatin1().data() );

if ( err )
{
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/grass/qgsgrassregion.cpp
Expand Up @@ -165,7 +165,7 @@ QgsGrassRegion::QgsGrassRegion( QgsGrassPlugin *plugin, QgisInterface *iface,
}

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

if ( err )
{
Expand Down Expand Up @@ -426,7 +426,7 @@ void QgsGrassRegion::accept()
}

QgsGrass::setLocation( QgsGrass::getDefaultGisdbase(), QgsGrass::getDefaultLocation() );
G__setenv( "MAPSET", QgsGrass::getDefaultMapset().toLatin1().data() );
G__setenv( (char *) "MAPSET", QgsGrass::getDefaultMapset().toLatin1().data() );

if ( G_put_window( &mWindow ) == -1 )
{
Expand Down
40 changes: 20 additions & 20 deletions src/providers/grass/qgsgrass.cpp
Expand Up @@ -314,12 +314,12 @@ void QgsGrass::setLocation( QString gisdbase, QString location )

// Set principal GRASS variables (in memory)
#if defined(WIN32)
G__setenv( "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
G__setenv( (char *) "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
#else
G__setenv( "GISDBASE", gisdbase.toAscii().data() );
G__setenv( (char *) "GISDBASE", gisdbase.toAscii().data() );
#endif
G__setenv( "LOCATION_NAME", location.toAscii().data() );
G__setenv( "MAPSET", "PERMANENT" ); // PERMANENT must always exist
G__setenv( (char *) "LOCATION_NAME", location.toAscii().data() );
G__setenv( (char *) "MAPSET", (char *) "PERMANENT" ); // PERMANENT must always exist

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

// Set principal GRASS variables (in memory)
#if defined(WIN32)
G__setenv( "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
G__setenv( (char *) "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
#else
G__setenv( "GISDBASE", gisdbase.toAscii().data() );
G__setenv( (char *) "GISDBASE", gisdbase.toAscii().data() );
#endif
G__setenv( "LOCATION_NAME", location.toAscii().data() );
G__setenv( "MAPSET", mapset.toAscii().data() );
G__setenv( (char *) "LOCATION_NAME", location.toAscii().data() );
G__setenv( (char *) "MAPSET", mapset.toAscii().data() );

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

// Reinitialize GRASS
G__setenv( "GISRC", gisrcEnv.toAscii().data() );
G__setenv( (char *) "GISRC", gisrcEnv.toAscii().data() );
#if defined(WIN32)
G__setenv( "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
G__setenv( (char *) "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
#else
G__setenv( "GISDBASE", gisdbase.toAscii().data() );
G__setenv( (char *) "GISDBASE", gisdbase.toAscii().data() );
#endif
G__setenv( "LOCATION_NAME", location.toAscii().data() );
G__setenv( "MAPSET", mapset.toAscii().data() );
G__setenv( (char *) "LOCATION_NAME", location.toAscii().data() );
G__setenv( (char *) "MAPSET", mapset.toAscii().data() );
defaultGisdbase = gisdbase;
defaultLocation = location;
defaultMapset = mapset;
Expand Down Expand Up @@ -596,13 +596,13 @@ QString QgsGrass::closeMapset( )
}
mMapsetLock = "";

putenv( "GISRC" );
putenv( (char *) "GISRC" );

// Reinitialize GRASS
G__setenv( "GISRC", "" );
G__setenv( "GISDBASE", "" );
G__setenv( "LOCATION_NAME", "" );
G__setenv( "MAPSET", "" );
G__setenv( (char *) "GISRC", (char *) "" );
G__setenv( (char *) "GISDBASE", (char *) "" );
G__setenv( (char *) "LOCATION_NAME", (char *) "" );
G__setenv( (char *) "MAPSET", (char *) "" );
defaultGisdbase = "";
defaultLocation = "";
defaultMapset = "";
Expand Down Expand Up @@ -876,7 +876,7 @@ bool GRASS_EXPORT QgsGrass::region( QString gisbase,
{
QgsGrass::setLocation( gisbase, location );

if ( G__get_window( window, "", "WIND", mapset.toLocal8Bit().data() ) )
if ( G__get_window( window, (char *) "", (char *) "WIND", mapset.toLocal8Bit().data() ) )
{
return false;
}
Expand Down Expand Up @@ -1009,7 +1009,7 @@ bool GRASS_EXPORT QgsGrass::mapRegion( int type, QString gisbase,
}
else if ( type == Region )
{
if ( G__get_window( window, "windows",
if ( G__get_window( window, (char *) "windows",
map.toLocal8Bit().data(),
mapset.toLocal8Bit().data() ) != NULL )
{
Expand Down
8 changes: 4 additions & 4 deletions src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -730,7 +730,7 @@ void QgsGrassProvider::loadAttributes( GLAYER &layer )
QgsDebugMsg( "Database opened -> open select cursor" );
dbString dbstr;
db_init_string( &dbstr );
db_set_string( &dbstr, "select * from " );
db_set_string( &dbstr, (char *)"select * from " );
db_append_string( &dbstr, layer.fieldInfo->table );

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

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

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

Expand Down Expand Up @@ -1423,7 +1423,7 @@ bool QgsGrassProvider::startEdit( void )

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

Vect_close( map->map );

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

Vect_build_partial( map->map, GV_BUILD_NONE, NULL );
Vect_build( map->map, stderr );
Expand Down

0 comments on commit d049698

Please sign in to comment.