Subject: pkg/34273: geography/geos does not build on -current
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Brook Milligan <brook@biology.nmsu.edu>
List: pkgsrc-bugs
Date: 08/24/2006 15:10:00
>Number:         34273
>Category:       pkg
>Synopsis:       geography/geos does not build on -current
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 24 15:10:00 +0000 2006
>Originator:     Brook Milligan
>Release:        NetBSD 3.0
>Organization:
Brook G. Milligan                      Internet:  brook@nmsu.edu
Department of Biology
New Mexico State University            Telephone:  (505) 646-7980
Las Cruces, New Mexico  88003  U.S.A.  FAX:        (505) 646-5665
>Environment:
	
	
System: NetBSD viola.nmsu.edu 3.0 NetBSD 3.0 (VIOLA) #0: Mon May 15 21:08:52 MDT 2006 root@trillium.aquilegia.com:/usr/src/sys/arch/i386/compile/VIOLA i386
Architecture: i386
Machine: i386
>Description:
	NetBSD-current includes a version of gcc that is stricter
about standards compliance.  As a result, it complains about some of
the expressions used within the geography/geos package.  Specifically,
within the source/geom/Coordinate.cpp file, many like the following
error occur:

	extra qualification 'geos::Coordinate::' on member 'setNull'

This is because the member is already within the scope of the
Coordinate class, so the preceding 'Coordinate::' is extraneous.  The
compiler with earlier versions of NetBSD seems not to be this
pedantic, and the distributed file compiles fine.  However, the older
compiler will also compile the patched version that lacks the extra
qualification.
>How-To-Repeat:
	Check out a -current version of NetBSD and try to build the
geography/geos package.
>Fix:
	Add the following patch to the package to remove the
extraneous qualifiers.

$NetBSD$

--- source/headers/geos/geom.h.orig	2004-07-27 10:35:46.000000000 -0600
+++ source/headers/geos/geom.h	2006-08-24 07:24:20.000000000 -0600
@@ -546,47 +546,47 @@
 	//double distance(Coordinate& p);
 	static Coordinate nullCoord;
 
-	void Coordinate::setNull() {
+	void setNull() {
 		x=DoubleNotANumber;
 		y=DoubleNotANumber;
 		z=DoubleNotANumber;
 	}
 
-	static Coordinate& Coordinate::getNull() {
+	static Coordinate& getNull() {
 		return nullCoord;
 	}
 
-	Coordinate::Coordinate() {
+	Coordinate() {
 		x=0.0;
 		y=0.0;
 		z=DoubleNotANumber;
 	}
 
-	Coordinate::Coordinate(double xNew, double yNew, double zNew) {
+	Coordinate(double xNew, double yNew, double zNew) {
 		x=xNew;
 		y=yNew;
 		z=zNew;
 	}
 
-	Coordinate::Coordinate(const Coordinate& c){
+	Coordinate(const Coordinate& c){
 		x=c.x;
 		y=c.y;
 		z=c.z;
 	}
 
-	Coordinate::Coordinate(double xNew, double yNew){
+	Coordinate(double xNew, double yNew){
 		x=xNew;
 		y=yNew;
 		z=DoubleNotANumber;
 	}
 
-	void Coordinate::setCoordinate(const Coordinate& other) {
+	void setCoordinate(const Coordinate& other) {
 		x = other.x;
 		y = other.y;
 		z = other.z;
 	}
 
-	bool Coordinate::equals2D(const Coordinate& other) const {
+	bool equals2D(const Coordinate& other) const {
 		if (x != other.x) {
 		return false;
 		}
@@ -596,7 +596,7 @@
 		return true;
 	}
 
-	int Coordinate::compareTo(const Coordinate& other) const {
+	int compareTo(const Coordinate& other) const {
 		if (x < other.x) {
 		return -1;
 		}
@@ -612,22 +612,22 @@
 		return 0;
 	}
 
-	bool Coordinate::equals3D(const Coordinate& other) const {
+	bool equals3D(const Coordinate& other) const {
 		return (x == other.x) && ( y == other.y) && (( z == other.z)||(z==DoubleNotANumber && other.z==DoubleNotANumber));
 	}
 
-	void Coordinate::makePrecise(const PrecisionModel *precisionModel) {
+	void makePrecise(const PrecisionModel *precisionModel) {
 		x = precisionModel->makePrecise(x);
 		y = precisionModel->makePrecise(y);
 	}
 
-	double Coordinate::distance(const Coordinate& p) const {
+	double distance(const Coordinate& p) const {
 		double dx = x - p.x;
 		double dy = y - p.y;
 		return sqrt(dx * dx + dy * dy);
 	}
 
-	int Coordinate::hashCode() {
+	int hashCode() {
         //Algorithm from Effective Java by Joshua Bloch [Jon Aquino]
         int result = 17;
         result = 37 * result + hashCode(x);
@@ -639,7 +639,7 @@
      * Returns a hash code for a double value, using the algorithm from
      * Joshua Bloch's book <i>Effective Java"</i>
      */
-    static int Coordinate::hashCode(double x) {
+    static int hashCode(double x) {
         int64 f = (int64)(x);
         return (int)(f^(f>>32));
     }

>Unformatted: