]> git.pld-linux.org Git - packages/geos.git/blob - geos-gcc4.patch
- fix build with gcc 4(.1)
[packages/geos.git] / geos-gcc4.patch
1 --- geos-2.2.0/source/headers/geos/geom.h.orig  2005-11-29 18:52:21.000000000 +0100
2 +++ geos-2.2.0/source/headers/geos/geom.h       2005-12-11 00:29:14.530893368 +0100
3 @@ -358,52 +358,52 @@
4         //double distance(Coordinate& p);
5         static Coordinate nullCoord;
6  
7 -       void Coordinate::setNull() {
8 +       void setNull() {
9                 x=DoubleNotANumber;
10                 y=DoubleNotANumber;
11                 z=DoubleNotANumber;
12         }
13  
14 -       static Coordinate& Coordinate::getNull() {
15 +       static Coordinate& getNull() {
16                 return nullCoord;
17         }
18  
19 -       Coordinate::Coordinate() {
20 +       Coordinate() {
21                 x=0.0;
22                 y=0.0;
23                 z=DoubleNotANumber;
24         }
25  
26 -       Coordinate::Coordinate(double xNew, double yNew, double zNew) {
27 +       Coordinate(double xNew, double yNew, double zNew) {
28                 x=xNew;
29                 y=yNew;
30                 z=zNew;
31         }
32  
33  #ifndef PROFILE_COORDINATE_COPIES
34 -       Coordinate::Coordinate(const Coordinate& c){
35 +       Coordinate(const Coordinate& c){
36                 x=c.x;
37                 y=c.y;
38                 z=c.z;
39         }
40  #else
41 -       Coordinate::Coordinate(const Coordinate& c);
42 +       Coordinate(const Coordinate& c);
43         Coordinate &operator=(const Coordinate &c);
44  #endif
45  
46 -       Coordinate::Coordinate(double xNew, double yNew){
47 +       Coordinate(double xNew, double yNew){
48                 x=xNew;
49                 y=yNew;
50                 z=DoubleNotANumber;
51         }
52  
53 -       void Coordinate::setCoordinate(const Coordinate& other) {
54 +       void setCoordinate(const Coordinate& other) {
55                 x = other.x;
56                 y = other.y;
57                 z = other.z;
58         }
59  
60 -       bool Coordinate::equals2D(const Coordinate& other) const {
61 +       bool equals2D(const Coordinate& other) const {
62                 if (x != other.x) {
63                 return false;
64                 }
65 @@ -413,7 +413,7 @@
66                 return true;
67         }
68  
69 -       int Coordinate::compareTo(const Coordinate& other) const {
70 +       int compareTo(const Coordinate& other) const {
71                 if (x < other.x) {
72                 return -1;
73                 }
74 @@ -429,22 +429,22 @@
75                 return 0;
76         }
77  
78 -       bool Coordinate::equals3D(const Coordinate& other) const {
79 +       bool equals3D(const Coordinate& other) const {
80                 return (x == other.x) && ( y == other.y) && ((z == other.z)||(ISNAN(z) && ISNAN(other.z)));
81         }
82  
83 -       void Coordinate::makePrecise(const PrecisionModel *precisionModel) {
84 +       void makePrecise(const PrecisionModel *precisionModel) {
85                 x = precisionModel->makePrecise(x);
86                 y = precisionModel->makePrecise(y);
87         }
88  
89 -       double Coordinate::distance(const Coordinate& p) const {
90 +       double distance(const Coordinate& p) const {
91                 double dx = x - p.x;
92                 double dy = y - p.y;
93                 return sqrt(dx * dx + dy * dy);
94         }
95  
96 -       int Coordinate::hashCode() {
97 +       int hashCode() {
98                 //Algorithm from Effective Java by Joshua Bloch [Jon Aquino]
99                 int result = 17;
100                 result = 37 * result + hashCode(x);
101 @@ -456,7 +456,7 @@
102         * Returns a hash code for a double value, using the algorithm from
103         * Joshua Bloch's book <i>Effective Java</i>
104         */
105 -       static int Coordinate::hashCode(double x) {
106 +       static int hashCode(double x) {
107                 int64 f = (int64)(x);
108                 return (int)(f^(f>>32));
109         }
This page took 0.090067 seconds and 3 git commands to generate.