Skip to content
Permalink
Browse files
fix gcc 4.3 warnings, a gcc 4.3 compile error and a MSVC warning
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8666 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 21, 2008
1 parent 4bdf54e commit 4a3d59358c08c239e3cad38b1ce15ef6a56efa7f
@@ -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,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;
}
@@ -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();

@@ -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. */
@@ -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() )
@@ -53,7 +53,7 @@ QgsMapLayerRegistry::~QgsMapLayerRegistry()
}

// get the layer count (number of registered layers)
const int QgsMapLayerRegistry::count()
int QgsMapLayerRegistry::count()
{
return mMapLayers.size();
}
@@ -44,7 +44,7 @@ class CORE_EXPORT QgsMapLayerRegistry : public QObject
/*! Return the number of registered layers.
*
* */
const int count();
int count();

~QgsMapLayerRegistry();

@@ -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();
}
@@ -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
@@ -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);
@@ -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!
@@ -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. */
@@ -18,6 +18,8 @@
/* $Id$ */

#include <fstream>
#include <cstdlib>

#include <QEvent>
#include <QApplication>
#include <QEvent>

0 comments on commit 4a3d593

Please sign in to comment.