Skip to content

Commit

Permalink
fix gcc 4.3 warnings, a gcc 4.3 compile error and a MSVC warning
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@8666 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 21, 2008
1 parent 5e58eb5 commit 41f62a8
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 29 deletions.
12 changes: 12 additions & 0 deletions python/core/conversions.sip
Expand Up @@ -326,12 +326,18 @@ template<TYPE>
Py_DECREF(d);

if (kobj)
{
Py_DECREF(kobj);
}

if (tobj)
{
Py_DECREF(tobj);
}
else
{
delete t;
}

return NULL;
}
Expand Down Expand Up @@ -547,18 +553,24 @@ template<double, TYPE2>
PyObject *lst = PyList_New(0);
PyDict_SetItem(d, t1obj, lst);
if (lst)
{
Py_DECREF(lst);
}
}

if (t1obj == NULL || t2obj == NULL ||
PyList_Append(PyDict_GetItem(d, t1obj), t2obj) < 0)
{
Py_DECREF(d);
if (t1obj)
{
Py_DECREF(t1obj);
}

if (t2obj)
{
Py_DECREF(t2obj);
}

return NULL;
}
Expand Down
7 changes: 3 additions & 4 deletions python/core/qgsmaplayerregistry.sip
Expand Up @@ -14,10 +14,9 @@ public:

//! Returns the instance pointer, creating the object on the first call
static QgsMapLayerRegistry * instance();
/*! Return the number of registered layers.
*
* */
const int count();

//! Return the number of registered layers.
int count();

~QgsMapLayerRegistry();

Expand Down
12 changes: 6 additions & 6 deletions python/core/qgsrasterlayer.sip
Expand Up @@ -114,10 +114,10 @@ public:
// Accessors for image height and width
//
/** \brief Accessor that returns the width of the (unclipped) raster */
const int getRasterXDim();
int getRasterXDim();

/** \brief Accessor that returns the height of the (unclipped) raster */
const int getRasterYDim();
int getRasterYDim();

//
// Accessor and mutator for no data double
Expand All @@ -126,7 +126,7 @@ public:
bool isNoDataValueValid();

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

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

/** \brief Get the number of bands in this layer */
const unsigned int getBandCount();
unsigned int getBandCount();
/** \brief Get RasterBandStats for a band given its number (read only) */
const QgsRasterBandStats getRasterBandStats(int);
/** \brief Check whether a given band number has stats associated with it */
const bool hasStats(int theBandNoInt);
bool hasStats(int theBandNoInt);
/** \brief Overloaded method that also returns stats for a band, but uses the band colour name
* Note this approach is not recommeneded because it is possible for two gdal raster
* bands to have the same name!
Expand All @@ -165,7 +165,7 @@ public:
/** \brief Get the number of a band given its name. Note this will be the rewritten name set
* up in the constructor, and will not necessarily be the same as the name retrieved directly from gdal!
* If no matching band is found zero will be returned! */
const int getRasterBandNumber (const QString & theBandNameQString);
int getRasterBandNumber (const QString & theBandNameQString);
/** \brief Get the name of a band given its number. */
const QString getRasterBandName(int theBandNoInt);
/** \brief Find out whether a given band exists. */
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -1560,7 +1560,7 @@ void QgsRasterLayerProperties::on_buttonBuildPyramids_clicked()
// as true so that we can generate pyramids for them.
//
QgsRasterLayer::RasterPyramidList myPyramidList = mRasterLayer->buildRasterPyramidList();
for ( unsigned int myCounterInt = 0; myCounterInt < lbxPyramidResolutions->count(); myCounterInt++ )
for ( int myCounterInt = 0; myCounterInt < lbxPyramidResolutions->count(); myCounterInt++ )
{
QListWidgetItem *myItem = lbxPyramidResolutions->item( myCounterInt );
if ( myItem->isSelected() )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayerregistry.cpp
Expand Up @@ -53,7 +53,7 @@ QgsMapLayerRegistry::~QgsMapLayerRegistry()
}

// get the layer count (number of registered layers)
const int QgsMapLayerRegistry::count()
int QgsMapLayerRegistry::count()
{
return mMapLayers.size();
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayerregistry.h
Expand Up @@ -44,7 +44,7 @@ class CORE_EXPORT QgsMapLayerRegistry : public QObject
/*! Return the number of registered layers.
*
* */
const int count();
int count();

~QgsMapLayerRegistry();

Expand Down
20 changes: 10 additions & 10 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -1190,7 +1190,7 @@ bool QgsRasterLayer::draw(QgsRenderContext& renderContext)
}
else
{
if ((myRasterViewPort->drawableAreaXDim) > 4000 && (myRasterViewPort->drawableAreaYDim > 4000))
if ((myRasterViewPort->drawableAreaXDim) > 4000 && (myRasterViewPort->drawableAreaYDim > 4000))
{
// We have scaled one raster pixel to more than 4000 screen pixels. What's the point of showing this layer?
// Instead, we just stop displaying the layer. Prevents allocating the entire world of memory for showing
Expand Down Expand Up @@ -2238,7 +2238,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(QString const & theB
//note this should be the rewritten name set up in the constructor,
//not the name retrieved directly from gdal!
//if no matching band is found zero will be returned!
const int QgsRasterLayer::getRasterBandNumber(QString const & theBandNameQString)
int QgsRasterLayer::getRasterBandNumber(QString const & theBandNameQString)
{
for (int myIterator = 0; myIterator < mRasterStatsList.size(); ++myIterator)
{
Expand Down Expand Up @@ -2280,7 +2280,7 @@ const QString QgsRasterLayer::getRasterBandName(int theBandNo)


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


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


//mutator for green band name
void QgsRasterLayer::setGreenBandName(QString const & theBandNameQString)
void QgsRasterLayer::setGreenBandName(QString const & theBandNameQString)
{
//check if the band is unset
if (theBandNameQString == TRSTRING_NOT_SET || theBandNameQString == QSTRING_NOT_SET )
Expand Down Expand Up @@ -2708,7 +2708,7 @@ void QgsRasterLayer::setGreenBandName(QString const & theBandNameQString)
}

//mutator for blue band name
void QgsRasterLayer::setBlueBandName(QString const & theBandNameQString)
void QgsRasterLayer::setBlueBandName(QString const & theBandNameQString)
{
//check if the band is unset
if (theBandNameQString == TRSTRING_NOT_SET || theBandNameQString == QSTRING_NOT_SET)
Expand Down Expand Up @@ -2742,7 +2742,7 @@ void QgsRasterLayer::setBlueBandName(QString const & theBandNameQString)
}

//mutator for transparent band name
void QgsRasterLayer::setTransparentBandName(QString const & theBandNameQString)
void QgsRasterLayer::setTransparentBandName(QString const & theBandNameQString)
{
//check if the band is unset
if (theBandNameQString == TRSTRING_NOT_SET)
Expand Down Expand Up @@ -2776,7 +2776,7 @@ void QgsRasterLayer::setTransparentBandName(QString const & theBandNameQString)


//mutator for gray band name
void QgsRasterLayer::setGrayBandName(QString const & theBandNameQString)
void QgsRasterLayer::setGrayBandName(QString const & theBandNameQString)
{
//check if the band is unset
if (theBandNameQString == TRSTRING_NOT_SET || theBandNameQString == QSTRING_NOT_SET )
Expand Down Expand Up @@ -3348,7 +3348,7 @@ void QgsRasterLayer::setLayerOrder(QStringList const & layers)

// Useful for Provider mode

void QgsRasterLayer::setSubLayerVisibility(QString const & name, bool vis)
void QgsRasterLayer::setSubLayerVisibility(QString const & name, bool vis)
{

if (mDataProvider)
Expand Down Expand Up @@ -5110,7 +5110,7 @@ const QgsRasterDataProvider* QgsRasterLayer::getDataProvider() const
return mDataProvider;
}

const unsigned int QgsRasterLayer::getBandCount()
unsigned int QgsRasterLayer::getBandCount()
{
return mRasterStatsList.size();
}
Expand Down
12 changes: 6 additions & 6 deletions src/core/raster/qgsrasterlayer.h
Expand Up @@ -284,10 +284,10 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
// Accessors for image height and width
//
/** \brief Accessor that returns the width of the (unclipped) raster */
const int getRasterXDim() {return mRasterXDim;}
int getRasterXDim() {return mRasterXDim;}

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

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

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

/** \brief Mutator that allows the NO_DATA entry for this raster to be overridden. */
void setNoDataValue(double theNoData);
Expand Down Expand Up @@ -349,11 +349,11 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
mStandardDeviations = theStdDevsToPlot;
}
/** \brief Get the number of bands in this layer */
const unsigned int getBandCount();
unsigned int getBandCount();
/** \brief Get RasterBandStats for a band given its number (read only) */
const QgsRasterBandStats getRasterBandStats(int);
/** \brief Check whether a given band number has stats associated with it */
const bool hasStats(int theBandNoInt);
bool hasStats(int theBandNoInt);
/** \brief Overloaded method that also returns stats for a band, but uses the band colour name
* Note this approach is not recommeneded because it is possible for two gdal raster
* bands to have the same name!
Expand All @@ -362,7 +362,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
/** \brief Get the number of a band given its name. Note this will be the rewritten name set
* up in the constructor, and will not necessarily be the same as the name retrieved directly from gdal!
* If no matching band is found zero will be returned! */
const int getRasterBandNumber (const QString & theBandNameQString);
int getRasterBandNumber (const QString & theBandNameQString);
/** \brief Get the name of a band given its number. */
const QString getRasterBandName(int theBandNoInt);
/** \brief Find out whether a given band exists. */
Expand Down
2 changes: 2 additions & 0 deletions src/providers/postgres/qgspostgresextentthread.cpp
Expand Up @@ -18,6 +18,8 @@
/* $Id$ */

#include <fstream>
#include <cstdlib>

#include <QEvent>
#include <QApplication>
#include <QEvent>
Expand Down

0 comments on commit 41f62a8

Please sign in to comment.