Skip to content

Commit a8ab4e4

Browse files
author
jef
committed
fix msvc build errors
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10485 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent fa2f889 commit a8ab4e4

File tree

10 files changed

+24
-12
lines changed

10 files changed

+24
-12
lines changed

src/core/pal/geomfunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ namespace pal {
274274
bool computeLineSegIntersection (double x1, double y1, double x2, double y2, // 1st line
275275
double x3, double y3, double x4, double y4, // 2nd segment
276276
double *x, double *y) {
277-
double cp1, cp2, cp3, cp4;
277+
double cp1, cp2;
278278
cp1 = cross_product (x1, y1, x2, y2, x3, y3);
279279
cp2 = cross_product (x1, y1, x2, y2, x4, y4);
280280

src/core/pal/layer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace pal {
5353
class Pal;
5454
class SimpleMutex;
5555

56-
struct Feat;
56+
class Feat;
5757

5858
/**
5959
* \brief A layer of spacial entites

src/core/pal/pal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
#include <list>
4141
#include <iostream>
4242

43+
#ifdef _MSC_VER
44+
#include <time.h>
45+
#endif
4346

4447
// TODO ${MAJOR} ${MINOR} etc instead of 0.2
4548

src/core/pal/problem.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ namespace pal {
13171317
std::cout << " Conflictual..." << std::endl;
13181318
#endif
13191319
int feat, rfeat;
1320-
bool sub = ctx->featWrap;
1320+
bool sub = ctx->featWrap!=NULL;
13211321

13221322
feat = lp->probFeat;
13231323
if (sub) {
@@ -1578,6 +1578,8 @@ namespace pal {
15781578
} catch (int i) {
15791579
#ifdef _DEBUG_FULL_
15801580
std::cout << "catch int " << i << std::endl;
1581+
#else
1582+
i;
15811583
#endif
15821584
while (conflicts->size() > 0)
15831585
conflicts->pop_front();
@@ -1838,6 +1840,8 @@ namespace pal {
18381840
} catch (int i) {
18391841
#ifdef _DEBUG_FULL_
18401842
std::cout << "catch Cycle in chain" << std::endl;
1843+
#else
1844+
i;
18411845
#endif
18421846
while (conflicts->size() > 0)
18431847
conflicts->pop_front();

src/core/pal/util.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,6 @@ namespace pal {
247247
void extractXYCoord (Feat *f) {
248248
int i, j;
249249

250-
double phi, lambda;
251-
252250
//Projection *proj = pal->proj;
253251

254252
const GEOSCoordSequence *coordSeq;

src/core/pal/util.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ namespace pal {
5858
/**
5959
* \brief For translating feature from GEOS to Pal
6060
*/
61-
typedef struct Feat {
61+
class Feat {
62+
public:
6263
const GEOSGeometry *geom;
6364
const char *id;
6465
int type;
@@ -72,7 +73,7 @@ namespace pal {
7273
int nbHoles;
7374
PointSet **holes;
7475

75-
} Feat;
76+
};
7677

7778

7879
/**

src/core/qgscentralpointpositionmanager.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ int QgsCentralPointPositionManager::findObjectPosition(const unsigned char* wkb,
182182
}
183183
currentPosition+= sizeof(int);
184184

185-
double x[numberOfPoints];
186-
double y[numberOfPoints];
185+
double *x = new double[numberOfPoints];
186+
double *y = new double[numberOfPoints];
187187

188188
for(int i = 0; i < numberOfPoints; ++i)
189189
{
@@ -197,7 +197,11 @@ int QgsCentralPointPositionManager::findObjectPosition(const unsigned char* wkb,
197197
}
198198
}
199199
double centroidX, centroidY;
200-
if(calculatePolygonCentroid(x, y, numberOfPoints, centroidX, centroidY) != 0)
200+
int res = calculatePolygonCentroid(x, y, numberOfPoints, centroidX, centroidY);
201+
delete [] x;
202+
delete [] y;
203+
204+
if( res != 0)
201205
{
202206
return 1;
203207
}

src/core/qgsoverlayobject.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ QgsOverlayObject& QgsOverlayObject::operator=(const QgsOverlayObject& other)
4040
mPositions = other.positions();
4141
mRotation = other.rotation();
4242
mGeometry = new QgsGeometry(*(other.geometry()));
43+
return *this;
4344
}
4445

4546
GEOSGeometry* QgsOverlayObject::getGeosGeometry()

src/plugins/diagram_overlay/qgsbardiagramfactory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,5 @@ bool QgsBarDiagramFactory::_writeXML(QDomNode& factory_node, QDomDocument& doc)
158158
QDomText barWidthText = doc.createTextNode(QString::number(mBarWidth));
159159
barWidthElem.appendChild(barWidthText);
160160
factory_node.appendChild(barWidthElem);
161+
return true;
161162
}

src/plugins/diagram_overlay/qgsdiagramrenderer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class QDomNode;
3030
class QImage;
3131

3232
//structure that describes a renderer entry
33-
struct QgsDiagramItem
33+
class QgsDiagramItem
3434
{
35-
35+
public:
3636
QVariant value;
3737
int size;
3838
};

0 commit comments

Comments
 (0)