*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.8 1997/05/22 00:07:21 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.9 1997/05/23 05:24:53 thomas Exp $
*
*-------------------------------------------------------------------------
*/
int has_delim;
char *cp;
- if (!PointerIsValid((char *)str))
+ if (!PointerIsValid(str))
return(FALSE);
while (isspace( *str)) str++;
char *s;
double x, y;
- if (!PointerIsValid((char *)str))
+ if (!PointerIsValid(str))
elog (WARN," Bad (null) box external representation",NULL);
if ((! path_decode(FALSE, 2, str, &isopen, &s, &(box->high)))
char *cp;
#endif
- if (!PointerIsValid((char *)box))
+ if (!PointerIsValid(box))
return(NULL);
#if OLD_FORMAT_OUT
double x, y;
#endif
- if (!PointerIsValid((char *)str))
+ if (!PointerIsValid(str))
elog(WARN, "Bad (null) path external representation");
if ((npts = pair_count(str, ',')) <= 0)
char *result, *cp;
#endif
- if (!PointerIsValid((char *)path))
+ if (!PointerIsValid(path))
return NULL;
#if OLD_FORMAT_OUT
bool
path_isclosed( PATH *path)
{
- if (!PointerIsValid((char *)path))
+ if (!PointerIsValid(path))
return FALSE;
return(path->closed);
bool
path_isopen( PATH *path)
{
- if (!PointerIsValid((char *)path))
+ if (!PointerIsValid(path))
return FALSE;
return(! path->closed);
int4
path_npoints( PATH *path)
{
- if (!PointerIsValid((char *)path))
+ if (!PointerIsValid(path))
return 0;
return(path->npts);
PATH *result;
result = path_copy(path);
- if (PointerIsValid((char *)result))
+ if (PointerIsValid(result))
result->closed = TRUE;
return(result);
PATH *result;
result = path_copy(path);
- if (PointerIsValid((char *)result))
+ if (PointerIsValid(result))
result->closed = FALSE;
return(result);
PATH *result;
int size;
- if (!PointerIsValid((char *)path))
+ if (!PointerIsValid(path))
return NULL;
size = offsetof(PATH, p[0]) + (sizeof(path->p[0]) * path->npts);
char *
point_out(Point *pt)
{
- if (!PointerIsValid((char *)pt))
+ if (!PointerIsValid(pt))
return(NULL);
return( path_encode( -1, 1, pt));
int isopen;
char *s;
- if (!PointerIsValid((char *)str))
+ if (!PointerIsValid(str))
elog (WARN," Bad (null) lseg external representation",NULL);
lseg = PALLOCTYPE(LSEG);
char *lseg_out(LSEG *ls)
{
- if (!PointerIsValid((char *)ls))
+ if (!PointerIsValid(ls))
return(NULL);
return( path_encode( FALSE, 2, (Point *) &(ls->p[0])));
double x1, x2;
#endif
- if (!PointerIsValid((char *)str))
+ if (!PointerIsValid(str))
elog (WARN," Bad (null) polygon external representation");
if ((npts = pair_count(str, ',')) <= 0)
char *result, *cp;
#endif
- if (!PointerIsValid((char *)poly))
+ if (!PointerIsValid(poly))
return NULL;
#if OLD_FORMAT_OUT
if (! (PointerIsValid(path) && PointerIsValid(point)))
return(NULL);
- if (! PointerIsValid(result = path_copy(path)))
- elog(WARN, "Memory allocation failed, can't add path",NULL);
+ result = path_copy(path);
for (i=0; i<path->npts; i++) {
result->p[i].x += point->x;
if (! (PointerIsValid(path) && PointerIsValid(point)))
return(NULL);
- if (! PointerIsValid(result = path_copy(path)))
- elog(WARN, "Memory allocation failed, can't subtract path",NULL);
+ result = path_copy(path);
for (i=0; i<path->npts; i++) {
result->p[i].x -= point->x;
if (! (PointerIsValid(path) && PointerIsValid(point)))
return(NULL);
- if (! PointerIsValid(result = path_copy(path)))
- elog(WARN, "Memory allocation failed, can't multiply path",NULL);
+ result = path_copy(path);
for (i=0; i<path->npts; i++) {
p = point_mul( &path->p[i], point);
if (! (PointerIsValid(path) && PointerIsValid(point)))
return(NULL);
- if (! PointerIsValid(result = path_copy(path)))
- elog(WARN, "Memory allocation failed, can't divide path",NULL);
+ result = path_copy(path);
for (i=0; i<path->npts; i++) {
p = point_div( &path->p[i], point);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.8 1997/05/22 00:07:21 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.9 1997/05/23 05:24:53 thomas Exp $
*
*-------------------------------------------------------------------------
*/
{
CIRCLE *result;
- if (!PointerIsValid(circle) && !PointerIsValid(point))
+ if (!PointerIsValid(circle) || !PointerIsValid(point))
return(NULL);
- if (! PointerIsValid(result = circle_copy(circle)))
- elog(WARN, "Memory allocation failed, can't add circle",NULL);
+ result = circle_copy(circle);
result->center.x += point->x;
result->center.y += point->y;
{
CIRCLE *result;
- if (!PointerIsValid(circle) && !PointerIsValid(point))
+ if (!PointerIsValid(circle) || !PointerIsValid(point))
return(NULL);
- if (! PointerIsValid(result = circle_copy(circle)))
- elog(WARN, "Memory allocation failed, can't subtract circle",NULL);
+ result = circle_copy(circle);
result->center.x -= point->x;
result->center.y -= point->y;
CIRCLE *result;
Point *p;
- if (!PointerIsValid(circle) && !PointerIsValid(point))
+ if (!PointerIsValid(circle) || !PointerIsValid(point))
return(NULL);
- if (! PointerIsValid(result = circle_copy(circle)))
- elog(WARN, "Memory allocation failed, can't multiply circle",NULL);
+ result = circle_copy(circle);
p = point_mul( &circle->center, point);
result->center.x = p->x;
CIRCLE *result;
Point *p;
- if (!PointerIsValid(circle) && !PointerIsValid(point))
+ if (!PointerIsValid(circle) || !PointerIsValid(point))
return(NULL);
- if (! PointerIsValid(result = circle_copy(circle)))
- elog(WARN, "Memory allocation failed, can't add circle",NULL);
+ result = circle_copy(circle);
p = point_div( &circle->center, point);
result->center.x = p->x;