Skip to content

Commit e982da1

Browse files
author
g_j_m
committed
Fix some compiler warnings
git-svn-id: http://svn.osgeo.org/qgis/trunk@6448 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 92d9665 commit e982da1

7 files changed

+12
-11
lines changed

src/app/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ void myMessageOutput( QtMsgType type, const char *msg )
193193
case QtDebugMsg:
194194
fprintf( stderr, "Debug: %s\n", msg );
195195
break;
196+
case QtCriticalMsg:
197+
fprintf( stderr, "Critical: %s\n", msg );
198+
break;
196199
case QtWarningMsg:
197200
fprintf( stderr, "Warning: %s\n", msg );
198201

src/app/qgisapp.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,13 +1264,13 @@ bool QgisApp::createDB()
12641264
//now copy the master file into the users .qgis dir
12651265
bool isDbFileCopied = masterFile.copy(qgisPrivateDbFile.name());
12661266

1267-
#ifdef QGISDEBUG
12681267
if (!isDbFileCopied)
12691268
{
1269+
#ifdef QGISDEBUG
12701270
std::cout << "[ERROR] Can not make qgis.db private copy" << std::endl;
12711271
return FALSE;
1272-
}
12731272
#endif
1273+
}
12741274
}
12751275
return TRUE;
12761276
}
@@ -2590,8 +2590,6 @@ void QgisApp::newVectorLayer()
25902590
//try to create the new layer with OGRProvider instead of QgsVectorFileWriter
25912591
QgsProviderRegistry * pReg = QgsProviderRegistry::instance();
25922592
QString ogrlib = pReg->library("ogr");
2593-
// This var is not used...remove? TS FIXME
2594-
const char *cOgrLib = (const char *) ogrlib;
25952593
// load the data provider
25962594
QLibrary* myLib = new QLibrary((const char *) ogrlib);
25972595
bool loaded = myLib->load();

src/app/qgsabout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void QgsAbout::init()
6161
if ( file.open( QIODevice::ReadOnly ) ) {
6262
QTextStream stream( &file );
6363
QString line;
64-
int i = 1;
64+
6565
while ( !stream.atEnd() )
6666
{
6767
line = stream.readLine(); // line of text excluding '\n'

src/app/qgsattributetable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void QgsAttributeTable::sortColumn(int col, bool ascending, bool wholeRows)
162162
//if the first entry contains a letter, sort alphanumerically, otherwise numerically
163163
QString firstentry = text(0, col);
164164
bool containsletter = false;
165-
for (uint i = 0; i < firstentry.length(); i++)
165+
for (int i = 0; i < firstentry.length(); i++)
166166
{
167167
if (firstentry.ref(i).isLetter())
168168
{
@@ -278,7 +278,7 @@ void QgsAttributeTable::popupMenu(int row, int col, const QPoint& pos)
278278
if (mActionPopup == 0)
279279
{
280280
mActionPopup = new QMenu();
281-
QAction *a = mActionPopup->addAction( tr("Run action") );
281+
mActionPopup->addAction( tr("Run action") );
282282
mActionPopup->addSeparator();
283283

284284
QgsAttributeAction::aIter iter = mActions.begin();

src/core/qgshttptransaction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ QgsHttpTransaction::QgsHttpTransaction(QString uri,
3737
int proxyPort,
3838
QString proxyUser,
3939
QString proxyPass)
40-
: httpurl(uri),
40+
: httpresponsecontenttype(0),
41+
httpurl(uri),
4142
httphost(proxyHost),
4243
httpport(proxyPort),
4344
httpuser(proxyUser),
4445
httppass(proxyPass),
45-
httpresponsecontenttype(0),
4646
mError(0)
4747
{
4848

src/core/qgslabel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ void QgsLabel::setLabelField ( int attr, const QString str )
433433
mLabelField[attr] = str;
434434

435435
mLabelFieldIdx[attr] = -1;
436-
for ( uint i = 0; i < mField.size(); i++ )
436+
for ( int i = 0; i < mField.size(); i++ )
437437
{
438438
if ( mField[i].name().compare(str) == 0 )
439439
{

src/core/qgsvectorfilewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ QString QgsVectorFileWriter::writeVectorLayerAsShapefile(QString shapefileName,
492492
// create the fields
493493
QgsDebugMsg("creating " + QString("%d").arg(attributeFields.size()) + " fields");
494494

495-
for (uint i = 0; i < attributeFields.size(); i++)
495+
for (int i = 0; i < attributeFields.size(); i++)
496496
{
497497
// check the field length - if > 10 we need to truncate it
498498
QgsField attrField = attributeFields[i];

0 commit comments

Comments
 (0)