[GRASS-SVN] r55563 - grass/trunk/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 27 14:14:41 PDT 2013


Author: mmetz
Date: 2013-03-27 14:14:41 -0700 (Wed, 27 Mar 2013)
New Revision: 55563

Modified:
   grass/trunk/lib/gis/plot.c
Log:
libgis: fix for AIX

Modified: grass/trunk/lib/gis/plot.c
===================================================================
--- grass/trunk/lib/gis/plot.c	2013-03-27 21:05:11 UTC (rev 55562)
+++ grass/trunk/lib/gis/plot.c	2013-03-27 21:14:41 UTC (rev 55563)
@@ -31,7 +31,7 @@
 static void fastline(double, double, double, double);
 static void slowline(double, double, double, double);
 static void plot_line(double, double, double, double, void (*)());
-static double nearest(double, double);
+static double wrap_east(double, double);
 static int edge(double, double, double, double);
 static int edge_point(double, int);
 
@@ -344,7 +344,7 @@
     }
 }
 
-static double nearest(double e0, double e1)
+static double wrap_east(double e0, double e1)
 {
     while (e0 - e1 > 180)
 	e1 += 360.0;
@@ -408,7 +408,7 @@
 	    return NO_MEMORY;
 
 	for (i = 0; i < n; i++) {
-	    e1 = nearest(e0, x[i]);
+	    e1 = wrap_east(e0, x[i]);
 	    if (e1 > E)
 		E = e1;
 	    if (e1 < W)
@@ -453,7 +453,7 @@
 	return OUT_OF_SYNC;
 
     /* sort the edge points by col(x) and then by row(y) */
-    qsort(st->P, st->np, sizeof(POINT), &edge_order);
+    qsort(st->P, st->np, sizeof(POINT), edge_order);
 
     /* plot */
     for (i = 1; i < st->np; i += 2) {
@@ -539,7 +539,7 @@
 		return NO_MEMORY;
 
 	    for (i = 0; i < n; i++) {
-		e1 = nearest(e0, x[i]);
+		e1 = wrap_east(e0, x[i]);
 		if (e1 > E)
 		    E = e1;
 		if (e1 < W)
@@ -620,11 +620,12 @@
 static int edge(double x0, double y0, double x1, double y1)
 {
     double m;
-    double dy, x;
+    double dx, dy, x;
     int ystart, ystop;
 
 
     /* tolerance to avoid FPE */
+    dx = x0 - x1;
     dy = y0 - y1;
     if (fabs(dy) < 1e-10)
 	return 1;
@@ -643,6 +644,7 @@
 	if (ystop == y0)
 	    ystop--;		/* if line stops at row center, don't include point */
     }
+
     if (ystart > ystop)
 	return 1;		/* does not cross center line of row */
 



More information about the grass-commit mailing list