Skip to content
Snippets Groups Projects
Commit 21d1e474 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart
Browse files

Some old cleanup fixes for close_ps() from G. Thaker.

parent 6912beea
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.33 1998/06/15 19:29:34 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.34 1998/08/15 06:45:10 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -768,6 +768,7 @@ box_diagonal(BOX *box) ...@@ -768,6 +768,7 @@ box_diagonal(BOX *box)
** **
***********************************************************************/ ***********************************************************************/
#define LINEDEBUG
LINE * LINE *
line_in(char *str) line_in(char *str)
{ {
...@@ -801,6 +802,7 @@ char * ...@@ -801,6 +802,7 @@ char *
line_out(LINE *line) line_out(LINE *line)
{ {
char *result; char *result;
LSEG lseg;
if (!PointerIsValid(line)) if (!PointerIsValid(line))
return (NULL); return (NULL);
...@@ -2340,7 +2342,7 @@ close_pl(Point *pt, LINE *line) ...@@ -2340,7 +2342,7 @@ close_pl(Point *pt, LINE *line)
* *
* Some tricky code here, relying on boolean expressions * Some tricky code here, relying on boolean expressions
* evaluating to only zero or one to use as an array index. * evaluating to only zero or one to use as an array index.
* bug fixes by gthaker@atl.lmco.com; May 1, 98 * bug fixes by gthaker@atl.lmco.com; May 1, 1998
*/ */
Point * Point *
close_ps(Point *pt, LSEG *lseg) close_ps(Point *pt, LSEG *lseg)
...@@ -2351,9 +2353,10 @@ close_ps(Point *pt, LSEG *lseg) ...@@ -2351,9 +2353,10 @@ close_ps(Point *pt, LSEG *lseg)
int xh, int xh,
yh; yh;
#ifdef GEODEBUG
/* fprintf(stderr,"close_sp:pt->x %f pt->y %f\nlseg(0).x %f lseg(0).y %f lseg(1).x %f lseg(1).y %f\n", */ printf("close_sp:pt->x %f pt->y %f\nlseg(0).x %f lseg(0).y %f lseg(1).x %f lseg(1).y %f\n",
/* pt->x, pt->y, lseg->p[0].x, lseg->p[0].y, lseg->p[1].x, lseg->p[1].y); */ pt->x, pt->y, lseg->p[0].x, lseg->p[0].y, lseg->p[1].x, lseg->p[1].y);
#endif
result = NULL; result = NULL;
xh = lseg->p[0].x < lseg->p[1].x; xh = lseg->p[0].x < lseg->p[1].x;
...@@ -2411,7 +2414,6 @@ close_ps(Point *pt, LSEG *lseg) ...@@ -2411,7 +2414,6 @@ close_ps(Point *pt, LSEG *lseg)
if (pt->y < (tmp->A*pt->x + tmp->C)) { /* we are below the lower edge */ if (pt->y < (tmp->A*pt->x + tmp->C)) { /* we are below the lower edge */
result = point_copy(&lseg->p[!yh]); /* below the lseg, take lower end pt */ result = point_copy(&lseg->p[!yh]); /* below the lseg, take lower end pt */
/* fprintf(stderr,"below: tmp A %f B %f C %f m %f\n",tmp->A,tmp->B,tmp->C, tmp->m); */ /* fprintf(stderr,"below: tmp A %f B %f C %f m %f\n",tmp->A,tmp->B,tmp->C, tmp->m); */
return result; return result;
} }
tmp = line_construct_pm(&lseg->p[yh], invm); /* upper edge of the "band" */ tmp = line_construct_pm(&lseg->p[yh], invm); /* upper edge of the "band" */
...@@ -2430,6 +2432,7 @@ close_ps(Point *pt, LSEG *lseg) ...@@ -2430,6 +2432,7 @@ close_ps(Point *pt, LSEG *lseg)
return (result); return (result);
} /* close_ps() */ } /* close_ps() */
/* close_lseg() /* close_lseg()
* Closest point to l1 on l2. * Closest point to l1 on l2.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment