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
This commit is contained in:
jef 2008-06-21 15:35:32 +00:00
parent 5e58eb576b
commit 41f62a8e3a
9 changed files with 42 additions and 29 deletions

View File

@ -326,12 +326,18 @@ template<TYPE>
Py_DECREF(d);
if (kobj)
{
Py_DECREF(kobj);
}
if (tobj)
{
Py_DECREF(tobj);
}
else
{
delete t;
}
return NULL;
}
@ -547,7 +553,9 @@ template<double, TYPE2>
PyObject *lst = PyList_New(0);
PyDict_SetItem(d, t1obj, lst);
if (lst)
{
Py_DECREF(lst);
}
}
if (t1obj == NULL || t2obj == NULL ||
@ -555,10 +563,14 @@ template<double, TYPE2>
{
Py_DECREF(d);
if (t1obj)
{
Py_DECREF(t1obj);
}
if (t2obj)
{
Py_DECREF(t2obj);
}
return NULL;
}

View File

@ -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();

View File

@ -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
@ -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);
@ -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!
@ -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. */

View File

@ -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() )

View File

@ -53,7 +53,7 @@ QgsMapLayerRegistry::~QgsMapLayerRegistry()
}
// get the layer count (number of registered layers)
const int QgsMapLayerRegistry::count()
int QgsMapLayerRegistry::count()
{
return mMapLayers.size();
}

View File

@ -44,7 +44,7 @@ public:
/*! Return the number of registered layers.
*
* */
const int count();
int count();
~QgsMapLayerRegistry();

View File

@ -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
@ -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)
{
@ -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())
{
@ -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
@ -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 )
@ -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)
@ -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)
@ -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 )
@ -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)
@ -5110,7 +5110,7 @@ const QgsRasterDataProvider* QgsRasterLayer::getDataProvider() const
return mDataProvider;
}
const unsigned int QgsRasterLayer::getBandCount()
unsigned int QgsRasterLayer::getBandCount()
{
return mRasterStatsList.size();
}

View File

@ -284,10 +284,10 @@ public:
// 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
@ -296,7 +296,7 @@ public:
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);
@ -349,11 +349,11 @@ public:
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!
@ -362,7 +362,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. */

View File

@ -18,6 +18,8 @@
/* $Id$ */
#include <fstream>
#include <cstdlib>
#include <QEvent>
#include <QApplication>
#include <QEvent>