1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

More timezone patches by Thomas:

Here are patches which should help fix timezone problems in the
datetime and abstime code. Also, I repatched varlena.c to add in
some comments and a little error checking on top of Vadim's earlier
repairs. There are slight mods to the circle data type to have the
distance operator between circles measure the distance between
closest points rather than between centers.
This commit is contained in:
Marc G. Fournier
1997-04-25 18:40:50 +00:00
parent b8e376ceb9
commit 094ec2d3f3
8 changed files with 252 additions and 222 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.3 1997/04/22 17:31:32 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.4 1997/04/25 18:40:25 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -2675,7 +2675,7 @@ poly_path(POLYGON *poly)
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.3 1997/04/22 17:31:32 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.4 1997/04/25 18:40:25 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -3075,18 +3075,35 @@ double *circle_radius(CIRCLE *circle)
}
/* circle_distance - returns the distance between the
* center points of two circlees.
/* circle_distance - returns the distance between
* two circles.
*/
double *circle_distance(CIRCLE *circle1, CIRCLE *circle2)
{
double *result;
result = PALLOCTYPE(double);
*result = point_dt(&circle1->center,&circle2->center);
*result = (point_dt(&circle1->center,&circle2->center)
- (circle1->radius + circle2->radius));
if (*result < 0) *result = 0;
return(result);
}
} /* circle_distance() */
/* dist_pc - returns the distance between
* a point and a circle.
*/
double *dist_pc(Point *point, CIRCLE *circle)
{
double *result;
result = PALLOCTYPE(double);
*result = (point_dt(point,&circle->center) - circle->radius);
if (*result < 0) *result = 0;
return(result);
} /* dist_pc() */
/* circle_center - returns the center point of the circle.