Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@6620 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Feb 18, 2007
1 parent e32f8e7 commit 4869951
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 90 deletions.
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassattributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ void QgsGrassAttributes::tabChanged ( QWidget *widget )
std::cerr << "QgsGrassAttributes::tabChanged()" << std::endl;
#endif

Q3Table *tb = (Q3Table *) tabCats->currentPage();
//Q3Table *tb = (Q3Table *) tabCats->currentPage();

resultLabel->setText ( "" );
}
Expand Down
28 changes: 14 additions & 14 deletions src/plugins/grass/qgsgrassedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ bool QgsGrassEdit::mRunning = false;

QgsGrassEdit::QgsGrassEdit ( QgisInterface *iface,
QWidget * parent, Qt::WFlags f )
:QMainWindow(parent,f), QgsGrassEditBase (), mMapTool(0),
mCanvasEdit(0), mRubberBandLine(0), mRubberBandIcon(0), mInited(false)
:QMainWindow(parent,f), QgsGrassEditBase (), mInited(false),
mMapTool(0), mCanvasEdit(0), mRubberBandLine(0), mRubberBandIcon(0)
{
#ifdef QGISDEBUG
std::cerr << "QgsGrassEdit()" << std::endl;
Expand Down Expand Up @@ -201,8 +201,8 @@ void QgsGrassEdit::keyPress(QKeyEvent *e)
QgsGrassEdit::QgsGrassEdit ( QgisInterface *iface,
QgsGrassProvider *provider,
QWidget * parent, Qt::WFlags f )
:QMainWindow(parent, 0, f), QgsGrassEditBase (), mMapTool(0),
mCanvasEdit(0), mRubberBandLine(0), mRubberBandIcon(0), mInited(false)
:QMainWindow(parent, 0, f), QgsGrassEditBase (), mInited(false),
mMapTool(0), mCanvasEdit(0), mRubberBandLine(0), mRubberBandIcon(0)
{
#ifdef QGISDEBUG
std::cerr << "QgsGrassEdit()" << std::endl;
Expand Down Expand Up @@ -567,7 +567,7 @@ void QgsGrassEdit::setAttributeTable ( int field )
mAttributeTable->setNumRows ( cols->size() );


for ( int c = 0; c < cols->size(); c++ ) {
for ( unsigned int c = 0; c < cols->size(); c++ ) {
QgsField col = (*cols)[c];

Q3TableItem *ti;
Expand Down Expand Up @@ -746,7 +746,7 @@ void QgsGrassEdit::changeSymbology(Q3ListViewItem * item, const QPoint & pnt, in
Q3CheckListItem *clvi = (Q3CheckListItem *) item;
mSymbDisplay[index] = clvi->isOn();

int ww = settings.readNumEntry("/GRASS/windows/edit/w", 420);
//int ww = settings.readNumEntry("/GRASS/windows/edit/w", 420);
QString sn;
// TODO use a name instead of index
sn.sprintf( "/GRASS/edit/symb/display/%d", index );
Expand Down Expand Up @@ -822,25 +822,25 @@ void QgsGrassEdit::updateSymb ( void )
#endif

// Set lines symbology from map
int nlines = mProvider->numLines();
unsigned int nlines = mProvider->numLines();
if ( nlines+1 >= mLineSymb.size() )
mLineSymb.resize(nlines+1000);

nlines = mProvider->numUpdatedLines();
for ( int i = 0; i < nlines; i++ ) {
for ( unsigned int i = 0; i < nlines; i++ ) {
int line = mProvider->updatedLine(i);
std::cerr << "updated line = " << line << std::endl;
if ( !(mProvider->lineAlive(line)) ) continue;
mLineSymb[line] = lineSymbFromMap ( line );
}

// Set nodes symbology from map
int nnodes = mProvider->numNodes();
unsigned int nnodes = mProvider->numNodes();
if ( nnodes+1 >= mNodeSymb.size() )
mNodeSymb.resize(nnodes+1000);

nnodes = mProvider->numUpdatedNodes();
for ( int i = 0; i < nnodes; i++ ) {
for ( unsigned int i = 0; i < nnodes; i++ ) {
int node = mProvider->updatedNode(i);
if ( !(mProvider->nodeAlive(node)) ) continue;
mNodeSymb[node] = nodeSymbFromMap ( node );
Expand Down Expand Up @@ -1028,7 +1028,7 @@ void QgsGrassEdit::catModeChanged ( void )

if ( mode == CAT_MODE_NEXT ) { // Find next not used
QString c = "1"; // Default for new field
for (int i = 0; i < mMaxCats.size(); i++ ) {
for (unsigned int i = 0; i < mMaxCats.size(); i++ ) {
if ( mMaxCats[i].field == field ) {
c.sprintf("%d", mMaxCats[i].maxCat+1);
break;
Expand Down Expand Up @@ -1057,7 +1057,7 @@ void QgsGrassEdit::fieldChanged ( void )

if ( mode == CAT_MODE_NEXT ) { // Find next not used
QString c = "1"; // Default for new field
for (int i = 0; i < mMaxCats.size(); i++ ) {
for (unsigned int i = 0; i < mMaxCats.size(); i++ ) {
if ( mMaxCats[i].field == field ) {
c.sprintf("%d", mMaxCats[i].maxCat+1);
break;
Expand Down Expand Up @@ -1110,7 +1110,7 @@ void QgsGrassEdit::increaseMaxCat ( void )

if ( mode == CAT_MODE_NEXT || mode == CAT_MODE_MANUAL ) {
int found = 0;
for (int i = 0; i < mMaxCats.size(); i++ ) {
for (unsigned int i = 0; i < mMaxCats.size(); i++ ) {
if ( mMaxCats[i].field == field ) {
if ( cat > mMaxCats[i].maxCat ) {
mMaxCats[i].maxCat = cat;
Expand Down Expand Up @@ -1410,7 +1410,7 @@ void QgsGrassEdit::addAttributes ( int field, int cat )
else
size = cols->size();

for ( int j = 0; j < cols->size(); j++ ) {
for ( unsigned int j = 0; j < cols->size(); j++ ) {
QgsField col = (*cols)[j];
QgsFeatureAttribute att = (*atts)[j];
std::cerr << " name = " << col.name().toLocal8Bit().data() << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,9 @@ public slots:
bool mProjectionEnabled;

// Canvas items
QgsGrassEditLayer* mCanvasEdit;
QgsRubberBand *mRubberBandLine;
QgsVertexMarker *mRubberBandIcon;
QgsGrassEditLayer* mCanvasEdit;

// edit tools are friend classes so they can
// access proteced/private members of QgsGrassEdit
Expand Down
24 changes: 12 additions & 12 deletions src/plugins/grass/qgsgrassmapcalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ QgsGrassMapcalc::QgsGrassMapcalc (
QgisInterface *iface,
QWidget * parent, const char * name, Qt::WFlags f )
: QMainWindow(0,Qt::WType_Dialog),
QgsGrassModuleOptions( tools, module, iface),
QgsGrassMapcalcBase ( ),
mObject(0), mConnector(0), mTool(-1)
QgsGrassModuleOptions( tools, module, iface),
mTool(-1), mObject(0), mConnector(0)
{
#ifdef QGISDEBUG
std::cerr << "QgsGrassMapcalc()" << std::endl;
Expand Down Expand Up @@ -231,7 +231,7 @@ QgsGrassMapcalc::QgsGrassMapcalc (
mFunctions.push_back(QgsGrassMapcalcFunction( t, "x", 0, tr("Current x-coordinate of moving window" )));
mFunctions.push_back(QgsGrassMapcalcFunction( t, "y", 0, tr("Current y-coordinate of moving window" )));

for ( int i =0; i < mFunctions.size(); i++ )
for ( unsigned int i =0; i < mFunctions.size(); i++ )
{
mFunctionComboBox->insertItem( mFunctions[i].label()
+ " " + mFunctions[i].description() );
Expand Down Expand Up @@ -688,7 +688,7 @@ void QgsGrassMapcalc::setOption()
case QgsGrassMapcalcObject::Map :
{
bool found = false;
for ( int i = 0 ; i < mMaps.size(); i++ )
for ( unsigned int i = 0 ; i < mMaps.size(); i++ )
{
if ( mMapComboBox->text(i) == mObject->label()
&& mMaps[i] == mObject->value() )
Expand All @@ -711,7 +711,7 @@ void QgsGrassMapcalc::setOption()
break;

case QgsGrassMapcalcObject::Function :
for ( int i = 0; i < mFunctions.size(); i++ )
for ( unsigned int i = 0; i < mFunctions.size(); i++ )
{
if ( mFunctions[i].name() != mObject->function().name() ) continue;
if ( mFunctions[i].inputCount() != mObject->function().inputCount() ) continue;
Expand Down Expand Up @@ -1340,7 +1340,7 @@ void QgsGrassMapcalc::load()
if( e.isNull() ) continue;

std::cerr << "id = " << e.attribute("id","?").local8Bit().data() << std::endl;
int id = e.attribute("id","0").toInt();
unsigned int id = e.attribute("id","0").toInt();
int x = e.attribute("x","0").toInt();
int y = e.attribute("y","0").toInt();
QString typeName = e.attribute("type","constant");
Expand Down Expand Up @@ -1394,7 +1394,7 @@ void QgsGrassMapcalc::load()
int inputCount = e.attribute("inputCount","1").toInt();
// Find function
int fn = -1;
for ( int i = 0; i < mFunctions.size(); i++ )
for ( unsigned int i = 0; i < mFunctions.size(); i++ )
{
if ( mFunctions[i].name() != value ) continue;
if ( mFunctions[i].inputCount() != inputCount ) continue;
Expand All @@ -1420,7 +1420,7 @@ void QgsGrassMapcalc::load()
if( e.isNull() ) continue;

std::cerr << "id = " << e.attribute("id","?").local8Bit().data() << std::endl;
int id = e.attribute("id","0").toInt();
unsigned int id = e.attribute("id","0").toInt();
if ( id >= mNextId ) mNextId = id+1;

QgsGrassMapcalcConnector *con = new QgsGrassMapcalcConnector ( mCanvas );
Expand All @@ -1447,7 +1447,7 @@ void QgsGrassMapcalc::load()
std::cerr << "objId = " << objId << std::endl;
if ( objId < 0 ) continue; // not connected

if ( objId < objects.size() && objects[objId] )
if ( static_cast<uint>(objId) < objects.size() && objects[objId] )
{
QString socketTypeName = e2.attribute("socketType","out");
int socketType;
Expand Down Expand Up @@ -2131,9 +2131,9 @@ QgsGrassMapcalcObject *QgsGrassMapcalcConnector::object( int end )
QgsGrassMapcalcFunction::QgsGrassMapcalcFunction ( int type, QString name,
int count, QString description, QString label, QString labels,
bool drawLabel ) :
mType(type), mName(name), mInputCount(count),
mDescription(description),
mLabel(label), mDrawLabel(drawLabel)
mName(name), mType(type), mInputCount(count),
mLabel(label), mDescription(description),
mDrawLabel(drawLabel)

{
if ( mLabel.isEmpty() ) mLabel = mName;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassmapcalc.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public slots:
QString mFileName;

//! Item id
int mNextId;
unsigned int mNextId;

//! Background
Q3CanvasRectangle *mPaper;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class QgsGrassModelItem
};

QgsGrassModelItem::QgsGrassModelItem()
:mParent(0),mPopulated(false),mType(QgsGrassModel::None)
:mParent(0),mType(QgsGrassModel::None),mPopulated(false)
{
}

Expand Down
Loading

0 comments on commit 4869951

Please sign in to comment.