Skip to content

Commit

Permalink
Apply warnings for unused vars patch from karl
Browse files Browse the repository at this point in the history
[ 1325870 ] removing trivial warnings (unused variables)


git-svn-id: http://svn.osgeo.org/qgis/trunk@4088 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Oct 16, 2005
1 parent fdd8974 commit 76694f5
Show file tree
Hide file tree
Showing 35 changed files with 22 additions and 164 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,5 +1,11 @@
/* ChangeLog,v 1.214 2004/11/12 00:42:21 gsherman Exp */
------------------------------------------------------------------------------
Version 0.8 'Joesephine' .... development version
2005-10-13 [timlinux] 0.7.9
** Added capability to generate point and polygon based graticules to the
grid_maker plugin


Version 0.6 'Simon' .... development version
QGIS Change Log
2005-07-03 [morb_au] 0.7.devel2
Expand Down
1 change: 0 additions & 1 deletion plugins/copyright_label/plugin.cpp
Expand Up @@ -166,7 +166,6 @@ void QgsCopyrightLabelPlugin::renderLabel(QPainter * theQPainter)
if (mEnable)
{
//@todo softcode this!myQSimpleText.height()
int myRotationInt = 90;
// need width/height of paint device
QPaintDeviceMetrics myMetrics( theQPainter->device() );
int myHeight = myMetrics.height();
Expand Down
1 change: 0 additions & 1 deletion plugins/delimited_text/qgsdelimitedtextplugingui.cpp
Expand Up @@ -103,7 +103,6 @@ void QgsDelimitedTextPluginGui::updateFieldLists()
//
// We don't know anything about a text based field other
// than its name. All fields are assumed to be text
int fieldPos = 0;
for ( QStringList::Iterator it = fieldList.begin(); it != fieldList.end(); ++it ) {
// add item to both drop-downs (X field and Y field)
if((*it).length() > 0)
Expand Down
2 changes: 0 additions & 2 deletions plugins/north_arrow/plugin.cpp
Expand Up @@ -314,8 +314,6 @@ bool QgsNorthArrowPlugin::calculateNorthDirection()
QgsMapLayer& mapLayer = *(mapCanvas.getZpos(0));
QgsSpatialRefSys& outputSRS = mapLayer.coordinateTransform()->destSRS();

bool yy = outputSRS.geographicFlag();

if (outputSRS.isValid() && !outputSRS.geographicFlag())
{
// Use a geographic SRS to get lat/long to work out direction
Expand Down
1 change: 0 additions & 1 deletion plugins/scale_bar/plugin.cpp
Expand Up @@ -210,7 +210,6 @@ void QgsScaleBarPlugin::renderScaleBar(QPainter * theQPainter)
// Hard coded sizes
int myMajorTickSize=8;
int myTextOffsetX=3;
int myTextOffsetY=3;
double myActualSize=mPreferredSize;
int myMargin=20;

Expand Down
2 changes: 0 additions & 2 deletions providers/gpx/qgsgpxprovider.cpp
Expand Up @@ -277,7 +277,6 @@ bool QgsGPXProvider::getNextFeature(QgsFeature* feature,

if (rte->points.size() == 0)
continue;
const Routepoint& rtept(rte->points[0]);
const QgsRect& b(*mSelectionRectangle);
if ((rte->xMax >= b.xMin()) && (rte->xMin <= b.xMax()) &&
(rte->yMax >= b.yMin()) && (rte->yMin <= b.yMax())) {
Expand Down Expand Up @@ -337,7 +336,6 @@ bool QgsGPXProvider::getNextFeature(QgsFeature* feature,
continue;
if (trk->segments[0].points.size() == 0)
continue;
const Trackpoint& trkpt(trk->segments[0].points[0]);
const QgsRect& b(*mSelectionRectangle);
if ((trk->xMax >= b.xMin()) && (trk->xMin <= b.xMax()) &&
(trk->yMax >= b.yMin()) && (trk->yMin <= b.yMax())) {
Expand Down
18 changes: 9 additions & 9 deletions providers/ogr/qgsogrprovider.cpp
Expand Up @@ -127,8 +127,8 @@ QgsOgrProvider::QgsOgrProvider(QString const & uri)
#endif
} else {
std::cerr << "Data source is invalid" << std::endl;
const char *er = CPLGetLastErrorMsg();
#ifdef QGISDEBUG
const char *er = CPLGetLastErrorMsg();
std::cerr << er << std::endl;
#endif
valid = false;
Expand Down Expand Up @@ -1395,14 +1395,14 @@ const std::list<std::pair<QString, QString> >& attributes)

OGRDataSource::DestroyDataSource(dataSource);

//qWarning("GDAL Version number is: "+QString::number(GDAL_VERSION_NUM));
//#if GDAL_VERSION_NUM >= 1310
//if(reference)
//{
//reference->Release();
//}
//#endif //GDAL_VERSION_NUM
//return true;
qWarning("GDAL Version number is: "+QString::number(GDAL_VERSION_NUM));
#if GDAL_VERSION_NUM >= 1310
if(reference)
{
reference->Release();
}
#endif //GDAL_VERSION_NUM
return true;
}


Expand Down
3 changes: 0 additions & 3 deletions src/legend/qgslegend.cpp
Expand Up @@ -138,8 +138,6 @@ void QgsLegend::contentsMousePressEvent(QMouseEvent * e)
#endif
if (e->button() == Qt::LeftButton || e->button() == Qt::MidButton)
{
QPoint p(contentsToViewport(e->pos()));
QListViewItem *i = itemAt(p);
mLastPressPos = e->pos();
mMousePressedFlag = true;
}
Expand Down Expand Up @@ -216,7 +214,6 @@ void QgsLegend::contentsMouseReleaseEvent(QMouseEvent * e)

if (mItemBeingMoved)
{
QListViewItem *item = itemAt(mLastPressPos);
QListViewItem *destItem = itemAt(e->pos());

QgsLegendItem* origin = dynamic_cast<QgsLegendItem*>(mItemBeingMoved);
Expand Down
2 changes: 1 addition & 1 deletion src/omggdal.cpp
Expand Up @@ -369,7 +369,7 @@ void OmgGdal::buildSupportedRasterFileFilter(QString & theFileFiltersString)
const QString OmgGdal::contour(const QString theInputFile)
{
GDALDatasetH hSrcDS;
int i, b3D = FALSE, bNoDataSet = FALSE, bIgnoreNoData = FALSE;
int b3D = FALSE, bNoDataSet = FALSE;
int myBandNumber = 1;
double dfInterval = 1.0;
double dfNoData = 0.0;
Expand Down
1 change: 0 additions & 1 deletion src/qgisapp.cpp
Expand Up @@ -377,7 +377,6 @@ QgisApp::QgisApp(QWidget * parent, const char *name, WFlags fl)
}
QGridLayout *canvasLegendLayout = new QGridLayout(frameMain, 1, 1, 4, 6, "canvasLegendLayout");
QSplitter *canvasLegendSplit = new QSplitter(frameMain);
QGridLayout *legendOverviewLayout = new QGridLayout(canvasLegendSplit, 1, 2, 4, 6, "canvasLegendLayout");
QSplitter *legendOverviewSplit = new QSplitter(Qt::Vertical,canvasLegendSplit);

mMapLegend = new QgsLegend(this,legendOverviewSplit, "theMapLegend");
Expand Down
1 change: 0 additions & 1 deletion src/qgsabout.ui.h
Expand Up @@ -34,7 +34,6 @@ void QgsAbout::init()
if ( file.open( IO_ReadOnly ) ) {
QTextStream stream( &file );
QString line;
int i = 1;
while ( !stream.atEnd() )
{
line = stream.readLine(); // line of text excluding '\n'
Expand Down
2 changes: 0 additions & 2 deletions src/qgsbookmarkitem.cpp
Expand Up @@ -41,7 +41,6 @@ QgsBookmarkItem::~QgsBookmarkItem()
// the record using the parameters set in the constructor

sqlite3 *db;
char *zErrMsg = 0;
int rc;
#ifdef QGISDEBUG
std::cout << "Opening user database: " << mUserDbPath.local8Bit() << std::endl;
Expand All @@ -58,7 +57,6 @@ QgsBookmarkItem::~QgsBookmarkItem()
// prepare the sql statement
const char *pzTail;
sqlite3_stmt *ppStmt;
char *pzErrmsg;
QString sql;
QTextOStream sqlStream(&sql);
sqlStream << "insert into tbl_bookmarks values(null,'" <<
Expand Down
2 changes: 0 additions & 2 deletions src/qgsbookmarks.cpp
Expand Up @@ -75,7 +75,6 @@ void QgsBookmarks::initialise()
// prepare the sql statement
const char *pzTail;
sqlite3_stmt *ppStmt;
char *pzErrmsg;
QString sql = "select * from tbl_bookmarks";

rc = sqlite3_prepare(db, (const char *)sql, sql.length(), &ppStmt, &pzTail);
Expand Down Expand Up @@ -244,7 +243,6 @@ void QgsBookmarks::zoomToBookmark()
int QgsBookmarks::connectDb()
{

char *zErrMsg = 0;
int rc;
rc = sqlite3_open(mUserDbPath, &db);
if(rc)
Expand Down
3 changes: 0 additions & 3 deletions src/qgscomposer.cpp
Expand Up @@ -642,9 +642,6 @@ void QgsComposer::svg(void)

QRect br = pic.boundingRect();

int width = (int) ( mComposition->paperWidth() * mComposition->scale() );
int height = (int) ( mComposition->paperHeight() * mComposition->scale() );

pic.save ( myOutputFileNameQString, "svg" );
}

Expand Down
1 change: 0 additions & 1 deletion src/qgscomposerlabel.cpp
Expand Up @@ -249,7 +249,6 @@ QRect QgsComposerLabel::boundingRect ( void ) const
int h = metrics.height() ;

int buf = 0;
int width;

if ( mBox ) {
buf = (int) ( size / 10 * mComposition->scale() + 2 ); // 2 is for line width
Expand Down
3 changes: 0 additions & 3 deletions src/qgscomposerpicture.cpp
Expand Up @@ -420,9 +420,6 @@ void QgsComposerPicture::pictureChanged ( )

mPicturePath = mPictureLineEdit->text();

int w = mWidth;
int h = mHeight;

loadPicture();

if ( !mPictureValid ) {
Expand Down
2 changes: 0 additions & 2 deletions src/qgscomposervectorlegend.cpp
Expand Up @@ -656,8 +656,6 @@ void QgsComposerVectorLegend::recalculate ( void )
std::cout << "mMargin = " << mMargin << " mSymbolHeight = " << mSymbolHeight
<< "mSymbolWidth = " << mSymbolWidth << " mSymbolSpace = " << mSymbolSpace << std::endl;

int nlayers = mMapCanvas->layerCount();

QRect r = render(0);

QCanvasRectangle::setSize ( r.width(), r.height() );
Expand Down
14 changes: 0 additions & 14 deletions src/qgscustomprojectiondialog.cpp
Expand Up @@ -131,7 +131,6 @@ void QgsCustomProjectionDialog::getProjList ()
// Populate the projection combo
//
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -167,7 +166,6 @@ void QgsCustomProjectionDialog::getEllipsoidList()
// Populate the ellipsoid combo
//
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -214,7 +212,6 @@ void QgsCustomProjectionDialog::pbnDelete_clicked()
}

sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -275,7 +272,6 @@ void QgsCustomProjectionDialog::pbnClose_clicked()
long QgsCustomProjectionDialog::getRecordCount()
{
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -309,7 +305,6 @@ long QgsCustomProjectionDialog::getRecordCount()
QString QgsCustomProjectionDialog::getProjectionFamilyName(QString theProjectionFamilyAcronym)
{
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -341,7 +336,6 @@ QString QgsCustomProjectionDialog::getProjectionFamilyName(QString theProjection
QString QgsCustomProjectionDialog::getEllipsoidName(QString theEllipsoidAcronym)
{
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -373,7 +367,6 @@ QString QgsCustomProjectionDialog::getEllipsoidName(QString theEllipsoidAcronym)
QString QgsCustomProjectionDialog::getProjectionFamilyAcronym(QString theProjectionFamilyName)
{
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -405,7 +398,6 @@ QString QgsCustomProjectionDialog::getProjectionFamilyAcronym(QString theProject
QString QgsCustomProjectionDialog::getEllipsoidAcronym(QString theEllipsoidName)
{
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -441,7 +433,6 @@ void QgsCustomProjectionDialog::pbnFirst_clicked()
std::cout << "QgsCustomProjectionDialog::pbnFirst_clicked()" << std::endl;
#endif
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -510,7 +501,6 @@ void QgsCustomProjectionDialog::pbnPrevious_clicked()
return;
}
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -588,7 +578,6 @@ void QgsCustomProjectionDialog::pbnNext_clicked()
return;
}
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -662,7 +651,6 @@ void QgsCustomProjectionDialog::pbnLast_clicked()
std::cout << "QgsCustomProjectionDialog::pbnLast_clicked()" << std::endl;
#endif
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -841,7 +829,6 @@ void QgsCustomProjectionDialog::pbnSave_clicked()
;
}
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -893,7 +880,6 @@ void QgsCustomProjectionDialog::cboProjectionFamily_highlighted( const QString &
//search the sqlite user projections db for the projection entry
//and display its parameters
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down
3 changes: 0 additions & 3 deletions src/qgsdistancearea.cpp
Expand Up @@ -73,7 +73,6 @@ bool QgsDistanceArea::setEllipsoid(const QString& ellipsoid)
//
QString mQGisSettingsDir = QDir::homeDirPath () + "/.qgis/";
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
Expand Down Expand Up @@ -175,7 +174,6 @@ bool QgsDistanceArea::setDefaultEllipsoid()

double QgsDistanceArea::measure(QgsGeometry* geometry)
{
size_t size = geometry->wkbSize();
unsigned char* wkb = geometry->wkbBuffer();
unsigned char* ptr;
unsigned int wkbType;
Expand Down Expand Up @@ -305,7 +303,6 @@ unsigned char* QgsDistanceArea::measurePolygon(unsigned char* feature, double* a

if (points.size() > 2)
{
bool clockWise = true;
areaTmp = computePolygonArea(points);
if (idx == 0)
*area += areaTmp; // exterior ring
Expand Down
6 changes: 0 additions & 6 deletions src/qgsgeometry.cpp
Expand Up @@ -780,7 +780,6 @@ bool QgsGeometry::vertexAt(double &x, double &y,
{
unsigned char *ptr;
int *nPoints;
int idx;

// get number of points in the line
ptr = mGeometry + 5; // now at mGeometry.numPoints
Expand Down Expand Up @@ -988,7 +987,6 @@ QgsPoint QgsGeometry::closestSegmentWithContext(QgsPoint& point,
QgsPoint minDistPoint;

int wkbType;
double x,y;
double *thisx,*thisy;
double *prevx,*prevy;
double testdist;
Expand Down Expand Up @@ -1091,13 +1089,11 @@ QgsRect QgsGeometry::boundingBox() const
int *nPoints;
int *numRings;
int *numPolygons;
int numPoints;
int numLineStrings;
int idx, jdx, kdx;
unsigned char *ptr;
char lsb;
QgsPoint pt;
QPointArray *pa;
int wkbType;

if(mGeometry)
Expand Down Expand Up @@ -1614,13 +1610,11 @@ geos::Geometry* QgsGeometry::geosGeometry() const
int *nPoints;
int *numRings;
int *numPolygons;
int numPoints;
int numLineStrings;
int idx, jdx, kdx;
unsigned char *ptr;
char lsb;
QgsPoint pt;
QPointArray *pa;
int wkbtype;

// // TODO: Make this a static member - save generating for every geometry
Expand Down
2 changes: 1 addition & 1 deletion src/qgslabel.cpp
Expand Up @@ -487,7 +487,7 @@ QgsPoint QgsLabel::labelPoint ( QgsFeature *feature )
{
double sx, sy;
unsigned char *ptr;
int idx, jdx, kdx;
int idx, kdx;
int *numPolygons, *numRings;

// get the number of polygons
Expand Down

0 comments on commit 76694f5

Please sign in to comment.