From a8ab4e4a3eb7a7a9fbfc87912d5ae7b7878f7f71 Mon Sep 17 00:00:00 2001 From: jef Date: Mon, 6 Apr 2009 12:52:56 +0000 Subject: [PATCH] fix msvc build errors git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10485 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/core/pal/geomfunction.cpp | 2 +- src/core/pal/layer.h | 2 +- src/core/pal/pal.h | 3 +++ src/core/pal/problem.cpp | 6 +++++- src/core/pal/util.cpp | 2 -- src/core/pal/util.h | 5 +++-- src/core/qgscentralpointpositionmanager.cpp | 10 +++++++--- src/core/qgsoverlayobject.cpp | 1 + src/plugins/diagram_overlay/qgsbardiagramfactory.cpp | 1 + src/plugins/diagram_overlay/qgsdiagramrenderer.h | 4 ++-- 10 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/core/pal/geomfunction.cpp b/src/core/pal/geomfunction.cpp index f9b419fa49dd..81fbb6fec967 100644 --- a/src/core/pal/geomfunction.cpp +++ b/src/core/pal/geomfunction.cpp @@ -274,7 +274,7 @@ namespace pal { bool computeLineSegIntersection (double x1, double y1, double x2, double y2, // 1st line double x3, double y3, double x4, double y4, // 2nd segment double *x, double *y) { - double cp1, cp2, cp3, cp4; + double cp1, cp2; cp1 = cross_product (x1, y1, x2, y2, x3, y3); cp2 = cross_product (x1, y1, x2, y2, x4, y4); diff --git a/src/core/pal/layer.h b/src/core/pal/layer.h index 8b27f0214606..fba7baa6fc3c 100644 --- a/src/core/pal/layer.h +++ b/src/core/pal/layer.h @@ -53,7 +53,7 @@ namespace pal { class Pal; class SimpleMutex; - struct Feat; + class Feat; /** * \brief A layer of spacial entites diff --git a/src/core/pal/pal.h b/src/core/pal/pal.h index 42ab13ffc404..dc9da161945f 100644 --- a/src/core/pal/pal.h +++ b/src/core/pal/pal.h @@ -40,6 +40,9 @@ #include #include +#ifdef _MSC_VER +#include +#endif // TODO ${MAJOR} ${MINOR} etc instead of 0.2 diff --git a/src/core/pal/problem.cpp b/src/core/pal/problem.cpp index e639f9a8ebb0..69f07911ff39 100644 --- a/src/core/pal/problem.cpp +++ b/src/core/pal/problem.cpp @@ -1317,7 +1317,7 @@ namespace pal { std::cout << " Conflictual..." << std::endl; #endif int feat, rfeat; - bool sub = ctx->featWrap; + bool sub = ctx->featWrap!=NULL; feat = lp->probFeat; if (sub) { @@ -1578,6 +1578,8 @@ namespace pal { } catch (int i) { #ifdef _DEBUG_FULL_ std::cout << "catch int " << i << std::endl; +#else + i; #endif while (conflicts->size() > 0) conflicts->pop_front(); @@ -1838,6 +1840,8 @@ namespace pal { } catch (int i) { #ifdef _DEBUG_FULL_ std::cout << "catch Cycle in chain" << std::endl; +#else + i; #endif while (conflicts->size() > 0) conflicts->pop_front(); diff --git a/src/core/pal/util.cpp b/src/core/pal/util.cpp index 35345595c044..7b8e6e109e78 100644 --- a/src/core/pal/util.cpp +++ b/src/core/pal/util.cpp @@ -247,8 +247,6 @@ namespace pal { void extractXYCoord (Feat *f) { int i, j; - double phi, lambda; - //Projection *proj = pal->proj; const GEOSCoordSequence *coordSeq; diff --git a/src/core/pal/util.h b/src/core/pal/util.h index b43887c5f9c6..7354ad54fc5c 100644 --- a/src/core/pal/util.h +++ b/src/core/pal/util.h @@ -58,7 +58,8 @@ namespace pal { /** * \brief For translating feature from GEOS to Pal */ - typedef struct Feat { + class Feat { + public: const GEOSGeometry *geom; const char *id; int type; @@ -72,7 +73,7 @@ namespace pal { int nbHoles; PointSet **holes; - } Feat; + }; /** diff --git a/src/core/qgscentralpointpositionmanager.cpp b/src/core/qgscentralpointpositionmanager.cpp index 19a8eae75fc2..0a2675a679fb 100644 --- a/src/core/qgscentralpointpositionmanager.cpp +++ b/src/core/qgscentralpointpositionmanager.cpp @@ -182,8 +182,8 @@ int QgsCentralPointPositionManager::findObjectPosition(const unsigned char* wkb, } currentPosition+= sizeof(int); - double x[numberOfPoints]; - double y[numberOfPoints]; + double *x = new double[numberOfPoints]; + double *y = new double[numberOfPoints]; for(int i = 0; i < numberOfPoints; ++i) { @@ -197,7 +197,11 @@ int QgsCentralPointPositionManager::findObjectPosition(const unsigned char* wkb, } } double centroidX, centroidY; - if(calculatePolygonCentroid(x, y, numberOfPoints, centroidX, centroidY) != 0) + int res = calculatePolygonCentroid(x, y, numberOfPoints, centroidX, centroidY); + delete [] x; + delete [] y; + + if( res != 0) { return 1; } diff --git a/src/core/qgsoverlayobject.cpp b/src/core/qgsoverlayobject.cpp index 80eb203b0237..a33cffd170ee 100644 --- a/src/core/qgsoverlayobject.cpp +++ b/src/core/qgsoverlayobject.cpp @@ -40,6 +40,7 @@ QgsOverlayObject& QgsOverlayObject::operator=(const QgsOverlayObject& other) mPositions = other.positions(); mRotation = other.rotation(); mGeometry = new QgsGeometry(*(other.geometry())); + return *this; } GEOSGeometry* QgsOverlayObject::getGeosGeometry() diff --git a/src/plugins/diagram_overlay/qgsbardiagramfactory.cpp b/src/plugins/diagram_overlay/qgsbardiagramfactory.cpp index e4dc39d42d09..9b474e90c75b 100644 --- a/src/plugins/diagram_overlay/qgsbardiagramfactory.cpp +++ b/src/plugins/diagram_overlay/qgsbardiagramfactory.cpp @@ -158,4 +158,5 @@ bool QgsBarDiagramFactory::_writeXML(QDomNode& factory_node, QDomDocument& doc) QDomText barWidthText = doc.createTextNode(QString::number(mBarWidth)); barWidthElem.appendChild(barWidthText); factory_node.appendChild(barWidthElem); + return true; } diff --git a/src/plugins/diagram_overlay/qgsdiagramrenderer.h b/src/plugins/diagram_overlay/qgsdiagramrenderer.h index f51b14e953b4..14c611b4f921 100644 --- a/src/plugins/diagram_overlay/qgsdiagramrenderer.h +++ b/src/plugins/diagram_overlay/qgsdiagramrenderer.h @@ -30,9 +30,9 @@ class QDomNode; class QImage; //structure that describes a renderer entry -struct QgsDiagramItem +class QgsDiagramItem { - +public: QVariant value; int size; };