Skip to content

Commit 41f62a8

Browse files
author
jef
committedJun 21, 2008
fix gcc 4.3 warnings, a gcc 4.3 compile error and a MSVC warning
git-svn-id: http://svn.osgeo.org/qgis/trunk@8666 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 5e58eb5 commit 41f62a8

File tree

9 files changed

+42
-29
lines changed

9 files changed

+42
-29
lines changed
 

‎python/core/conversions.sip

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,18 @@ template<TYPE>
326326
Py_DECREF(d);
327327

328328
if (kobj)
329+
{
329330
Py_DECREF(kobj);
331+
}
330332

331333
if (tobj)
334+
{
332335
Py_DECREF(tobj);
336+
}
333337
else
338+
{
334339
delete t;
340+
}
335341

336342
return NULL;
337343
}
@@ -547,18 +553,24 @@ template<double, TYPE2>
547553
PyObject *lst = PyList_New(0);
548554
PyDict_SetItem(d, t1obj, lst);
549555
if (lst)
556+
{
550557
Py_DECREF(lst);
558+
}
551559
}
552560

553561
if (t1obj == NULL || t2obj == NULL ||
554562
PyList_Append(PyDict_GetItem(d, t1obj), t2obj) < 0)
555563
{
556564
Py_DECREF(d);
557565
if (t1obj)
566+
{
558567
Py_DECREF(t1obj);
568+
}
559569

560570
if (t2obj)
571+
{
561572
Py_DECREF(t2obj);
573+
}
562574

563575
return NULL;
564576
}

‎python/core/qgsmaplayerregistry.sip

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ public:
1414

1515
//! Returns the instance pointer, creating the object on the first call
1616
static QgsMapLayerRegistry * instance();
17-
/*! Return the number of registered layers.
18-
*
19-
* */
20-
const int count();
17+
18+
//! Return the number of registered layers.
19+
int count();
2120

2221
~QgsMapLayerRegistry();
2322

‎python/core/qgsrasterlayer.sip

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ public:
114114
// Accessors for image height and width
115115
//
116116
/** \brief Accessor that returns the width of the (unclipped) raster */
117-
const int getRasterXDim();
117+
int getRasterXDim();
118118

119119
/** \brief Accessor that returns the height of the (unclipped) raster */
120-
const int getRasterYDim();
120+
int getRasterYDim();
121121

122122
//
123123
// Accessor and mutator for no data double
@@ -126,7 +126,7 @@ public:
126126
bool isNoDataValueValid();
127127

128128
/** \brief Accessor that returns the NO_DATA entry for this raster. */
129-
const double getNoDataValue(bool* isValid=0);
129+
double getNoDataValue(bool* isValid=0);
130130

131131
/** \brief Mutator that allows the NO_DATA entry for this raster to be overridden. */
132132
void setNoDataValue(double theNoData);
@@ -152,11 +152,11 @@ public:
152152
void setStdDevsToPlot(double the);
153153

154154
/** \brief Get the number of bands in this layer */
155-
const unsigned int getBandCount();
155+
unsigned int getBandCount();
156156
/** \brief Get RasterBandStats for a band given its number (read only) */
157157
const QgsRasterBandStats getRasterBandStats(int);
158158
/** \brief Check whether a given band number has stats associated with it */
159-
const bool hasStats(int theBandNoInt);
159+
bool hasStats(int theBandNoInt);
160160
/** \brief Overloaded method that also returns stats for a band, but uses the band colour name
161161
* Note this approach is not recommeneded because it is possible for two gdal raster
162162
* bands to have the same name!
@@ -165,7 +165,7 @@ public:
165165
/** \brief Get the number of a band given its name. Note this will be the rewritten name set
166166
* up in the constructor, and will not necessarily be the same as the name retrieved directly from gdal!
167167
* If no matching band is found zero will be returned! */
168-
const int getRasterBandNumber (const QString & theBandNameQString);
168+
int getRasterBandNumber (const QString & theBandNameQString);
169169
/** \brief Get the name of a band given its number. */
170170
const QString getRasterBandName(int theBandNoInt);
171171
/** \brief Find out whether a given band exists. */

‎src/app/qgsrasterlayerproperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ void QgsRasterLayerProperties::on_buttonBuildPyramids_clicked()
15601560
// as true so that we can generate pyramids for them.
15611561
//
15621562
QgsRasterLayer::RasterPyramidList myPyramidList = mRasterLayer->buildRasterPyramidList();
1563-
for ( unsigned int myCounterInt = 0; myCounterInt < lbxPyramidResolutions->count(); myCounterInt++ )
1563+
for ( int myCounterInt = 0; myCounterInt < lbxPyramidResolutions->count(); myCounterInt++ )
15641564
{
15651565
QListWidgetItem *myItem = lbxPyramidResolutions->item( myCounterInt );
15661566
if ( myItem->isSelected() )

‎src/core/qgsmaplayerregistry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ QgsMapLayerRegistry::~QgsMapLayerRegistry()
5353
}
5454

5555
// get the layer count (number of registered layers)
56-
const int QgsMapLayerRegistry::count()
56+
int QgsMapLayerRegistry::count()
5757
{
5858
return mMapLayers.size();
5959
}

‎src/core/qgsmaplayerregistry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class CORE_EXPORT QgsMapLayerRegistry : public QObject
4444
/*! Return the number of registered layers.
4545
*
4646
* */
47-
const int count();
47+
int count();
4848

4949
~QgsMapLayerRegistry();
5050

‎src/core/raster/qgsrasterlayer.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ bool QgsRasterLayer::draw(QgsRenderContext& renderContext)
11901190
}
11911191
else
11921192
{
1193-
if ((myRasterViewPort->drawableAreaXDim) > 4000 && (myRasterViewPort->drawableAreaYDim > 4000))
1193+
if ((myRasterViewPort->drawableAreaXDim) > 4000 && (myRasterViewPort->drawableAreaYDim > 4000))
11941194
{
11951195
// We have scaled one raster pixel to more than 4000 screen pixels. What's the point of showing this layer?
11961196
// Instead, we just stop displaying the layer. Prevents allocating the entire world of memory for showing
@@ -2238,7 +2238,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(QString const & theB
22382238
//note this should be the rewritten name set up in the constructor,
22392239
//not the name retrieved directly from gdal!
22402240
//if no matching band is found zero will be returned!
2241-
const int QgsRasterLayer::getRasterBandNumber(QString const & theBandNameQString)
2241+
int QgsRasterLayer::getRasterBandNumber(QString const & theBandNameQString)
22422242
{
22432243
for (int myIterator = 0; myIterator < mRasterStatsList.size(); ++myIterator)
22442244
{
@@ -2280,7 +2280,7 @@ const QString QgsRasterLayer::getRasterBandName(int theBandNo)
22802280

22812281

22822282
/** Check whether a given band number has stats associated with it */
2283-
const bool QgsRasterLayer::hasStats(int theBandNo)
2283+
bool QgsRasterLayer::hasStats(int theBandNo)
22842284
{
22852285
if (theBandNo <= mRasterStatsList.size())
22862286
{
@@ -2637,7 +2637,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNo)
26372637

26382638

26392639
//mutator for red band name (allows alternate mappings e.g. map blue as red colour)
2640-
void QgsRasterLayer::setRedBandName(QString const & theBandNameQString)
2640+
void QgsRasterLayer::setRedBandName(QString const & theBandNameQString)
26412641
{
26422642
QgsDebugMsg("setRedBandName : " + theBandNameQString);
26432643
//check if the band is unset
@@ -2674,7 +2674,7 @@ void QgsRasterLayer::setRedBandName(QString const & theBandNameQString)
26742674

26752675

26762676
//mutator for green band name
2677-
void QgsRasterLayer::setGreenBandName(QString const & theBandNameQString)
2677+
void QgsRasterLayer::setGreenBandName(QString const & theBandNameQString)
26782678
{
26792679
//check if the band is unset
26802680
if (theBandNameQString == TRSTRING_NOT_SET || theBandNameQString == QSTRING_NOT_SET )
@@ -2708,7 +2708,7 @@ void QgsRasterLayer::setGreenBandName(QString const & theBandNameQString)
27082708
}
27092709

27102710
//mutator for blue band name
2711-
void QgsRasterLayer::setBlueBandName(QString const & theBandNameQString)
2711+
void QgsRasterLayer::setBlueBandName(QString const & theBandNameQString)
27122712
{
27132713
//check if the band is unset
27142714
if (theBandNameQString == TRSTRING_NOT_SET || theBandNameQString == QSTRING_NOT_SET)
@@ -2742,7 +2742,7 @@ void QgsRasterLayer::setBlueBandName(QString const & theBandNameQString)
27422742
}
27432743

27442744
//mutator for transparent band name
2745-
void QgsRasterLayer::setTransparentBandName(QString const & theBandNameQString)
2745+
void QgsRasterLayer::setTransparentBandName(QString const & theBandNameQString)
27462746
{
27472747
//check if the band is unset
27482748
if (theBandNameQString == TRSTRING_NOT_SET)
@@ -2776,7 +2776,7 @@ void QgsRasterLayer::setTransparentBandName(QString const & theBandNameQString)
27762776

27772777

27782778
//mutator for gray band name
2779-
void QgsRasterLayer::setGrayBandName(QString const & theBandNameQString)
2779+
void QgsRasterLayer::setGrayBandName(QString const & theBandNameQString)
27802780
{
27812781
//check if the band is unset
27822782
if (theBandNameQString == TRSTRING_NOT_SET || theBandNameQString == QSTRING_NOT_SET )
@@ -3348,7 +3348,7 @@ void QgsRasterLayer::setLayerOrder(QStringList const & layers)
33483348

33493349
// Useful for Provider mode
33503350

3351-
void QgsRasterLayer::setSubLayerVisibility(QString const & name, bool vis)
3351+
void QgsRasterLayer::setSubLayerVisibility(QString const & name, bool vis)
33523352
{
33533353

33543354
if (mDataProvider)
@@ -5110,7 +5110,7 @@ const QgsRasterDataProvider* QgsRasterLayer::getDataProvider() const
51105110
return mDataProvider;
51115111
}
51125112

5113-
const unsigned int QgsRasterLayer::getBandCount()
5113+
unsigned int QgsRasterLayer::getBandCount()
51145114
{
51155115
return mRasterStatsList.size();
51165116
}

‎src/core/raster/qgsrasterlayer.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
284284
// Accessors for image height and width
285285
//
286286
/** \brief Accessor that returns the width of the (unclipped) raster */
287-
const int getRasterXDim() {return mRasterXDim;}
287+
int getRasterXDim() {return mRasterXDim;}
288288

289289
/** \brief Accessor that returns the height of the (unclipped) raster */
290-
const int getRasterYDim() {return mRasterYDim;}
290+
int getRasterYDim() {return mRasterYDim;}
291291

292292
//
293293
// Accessor and mutator for no data double
@@ -296,7 +296,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
296296
bool isNoDataValueValid() {return mValidNoDataValue;}
297297

298298
/** \brief Accessor that returns the NO_DATA entry for this raster. */
299-
const double getNoDataValue(bool* isValid=0) { if(isValid) { *isValid = mValidNoDataValue;} return mNoDataValue;}
299+
double getNoDataValue(bool* isValid=0) { if(isValid) { *isValid = mValidNoDataValue;} return mNoDataValue;}
300300

301301
/** \brief Mutator that allows the NO_DATA entry for this raster to be overridden. */
302302
void setNoDataValue(double theNoData);
@@ -349,11 +349,11 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
349349
mStandardDeviations = theStdDevsToPlot;
350350
}
351351
/** \brief Get the number of bands in this layer */
352-
const unsigned int getBandCount();
352+
unsigned int getBandCount();
353353
/** \brief Get RasterBandStats for a band given its number (read only) */
354354
const QgsRasterBandStats getRasterBandStats(int);
355355
/** \brief Check whether a given band number has stats associated with it */
356-
const bool hasStats(int theBandNoInt);
356+
bool hasStats(int theBandNoInt);
357357
/** \brief Overloaded method that also returns stats for a band, but uses the band colour name
358358
* Note this approach is not recommeneded because it is possible for two gdal raster
359359
* bands to have the same name!
@@ -362,7 +362,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
362362
/** \brief Get the number of a band given its name. Note this will be the rewritten name set
363363
* up in the constructor, and will not necessarily be the same as the name retrieved directly from gdal!
364364
* If no matching band is found zero will be returned! */
365-
const int getRasterBandNumber (const QString & theBandNameQString);
365+
int getRasterBandNumber (const QString & theBandNameQString);
366366
/** \brief Get the name of a band given its number. */
367367
const QString getRasterBandName(int theBandNoInt);
368368
/** \brief Find out whether a given band exists. */

‎src/providers/postgres/qgspostgresextentthread.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
/* $Id$ */
1919

2020
#include <fstream>
21+
#include <cstdlib>
22+
2123
#include <QEvent>
2224
#include <QApplication>
2325
#include <QEvent>

0 commit comments

Comments
 (0)
Please sign in to comment.