Skip to content

Commit 2be7dcf

Browse files
author
g_j_m
committedFeb 3, 2007
Fix compiler warnings in core directory
git-svn-id: http://svn.osgeo.org/qgis/trunk@6497 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 27da5e5 commit 2be7dcf

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed
 

‎src/core/qgsscalecalculator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ double QgsScaleCalculator::calculateGeographicDistance(QgsRect &mapExtent)
114114
double a = pow(cos(lat * rads), 2);
115115
double c = 2.0 * atan2(sqrt(a), sqrt(1.0-a));
116116
const static double ra = 6378000; // [m]
117-
const static double rb = 6357000; // [m]
118-
// The eccentricity. This comes from sqrt(1.0 - rb*rb/(ra*ra));
117+
// The eccentricity. This comes from sqrt(1.0 - rb*rb/(ra*ra)) with rb set
118+
// to 6357000 m.
119119
const static double e = 0.0810820288;
120120
double radius = ra * (1.0 - e*e) /
121121
pow(1.0 - e*e*sin(lat*rads)*sin(lat*rads), 1.5);

‎src/core/qgsspatialrefsys.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ bool QgsSpatialRefSys::createFromWkt(QString theWkt)
290290
// that we can try to fill in the remaining class members...
291291
//create from Proj wil set the isValidFalg
292292
createFromProj4(QString(proj4src));
293+
CPLFree(proj4src);
294+
293295
return mIsValidFlag;
294296
//setMapunits will be called by createfromproj above
295-
296-
CPLFree(proj4src);
297297
}
298298

299299
bool QgsSpatialRefSys::createFromEpsg(long theEpsg)
@@ -518,7 +518,7 @@ bool QgsSpatialRefSys::createFromProj4 (const QString theProj4String)
518518
}
519519
// if (!myRecord.empty())
520520
// What if descriptions aren't unique?
521-
if (NULL)
521+
if (false)
522522
{
523523
mySrsId=myRecord["srs_id"].toLong();
524524
QgsDebugMsg("QgsSpatialRefSys::createFromProj4 Projection Description match search for srsid returned srsid: "\
@@ -1016,6 +1016,12 @@ bool QgsSpatialRefSys::equals(QString theProj4CharArray)
10161016
OGRErr myInputResult1 = myOgrSpatialRef1.importFromProj4( myCharArrayPointer1 );
10171017
OGRErr myInputResult2 = myOgrSpatialRef2.importFromProj4( theProj4CharArray.latin1() );
10181018

1019+
// Could do some error reporting here...
1020+
if (myInputResult1 != OGRERR_NONE)
1021+
{}
1022+
if (myInputResult2 != OGRERR_NONE)
1023+
{}
1024+
10191025
if (myOgrSpatialRef1.IsGeographic() && myOgrSpatialRef2.IsGeographic())
10201026
{
10211027
// qWarning("QgsSpatialRefSys::operator== srs1 and srs2 are geographic ");

0 commit comments

Comments
 (0)