From ddb17de1da622be9bba675347cd4bc8db7cd1967 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Fri, 28 Sep 2012 21:08:29 +0000 Subject: [PATCH] Anal retentive function renaming: ptarray_isclosed -> ptarray_is_closed git-svn-id: http://svn.osgeo.org/postgis/trunk@10339 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/liblwgeom.h.in | 8 ++++---- liblwgeom/lwcircstring.c | 4 ++-- liblwgeom/lwgeom_geos_clean.c | 2 +- liblwgeom/lwin_wkb.c | 6 +++--- liblwgeom/lwin_wkt.c | 4 ++-- liblwgeom/lwline.c | 4 ++-- liblwgeom/lwpoly.c | 8 ++++---- liblwgeom/lwtriangle.c | 4 ++-- liblwgeom/ptarray.c | 12 ++++++------ postgis/lwgeom_in_gml.c | 24 ++++++++++++------------ postgis/lwgeom_in_kml.c | 8 ++++---- 11 files changed, 42 insertions(+), 42 deletions(-) diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index 767aade1a..d80b9d0a8 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -852,10 +852,10 @@ extern int ptarray_remove_point(POINTARRAY *pa, int where); extern POINTARRAY *ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where); extern POINTARRAY *ptarray_removePoint(POINTARRAY *pa, uint32_t where); extern POINTARRAY *ptarray_merge(POINTARRAY *pa1, POINTARRAY *pa2); -extern int ptarray_isclosed(const POINTARRAY *pa); -extern int ptarray_isclosed2d(const POINTARRAY *pa); -extern int ptarray_isclosed3d(const POINTARRAY *pa); -extern int ptarray_isclosedz(const POINTARRAY *pa); +extern int ptarray_is_closed(const POINTARRAY *pa); +extern int ptarray_is_closed_2d(const POINTARRAY *pa); +extern int ptarray_is_closed_3d(const POINTARRAY *pa); +extern int ptarray_is_closed_z(const POINTARRAY *pa); extern void ptarray_longitude_shift(POINTARRAY *pa); extern void ptarray_reverse(POINTARRAY *pa); extern POINTARRAY* ptarray_flip_coordinates(POINTARRAY *pa); diff --git a/liblwgeom/lwcircstring.c b/liblwgeom/lwcircstring.c index 86b76ee80..41c16574f 100644 --- a/liblwgeom/lwcircstring.c +++ b/liblwgeom/lwcircstring.c @@ -255,9 +255,9 @@ int lwcircstring_is_closed(const LWCIRCSTRING *curve) { if (FLAGS_GET_Z(curve->flags)) - return ptarray_isclosed3d(curve->points); + return ptarray_is_closed_3d(curve->points); - return ptarray_isclosed2d(curve->points); + return ptarray_is_closed_2d(curve->points); } int lwcircstring_is_empty(const LWCIRCSTRING *circ) diff --git a/liblwgeom/lwgeom_geos_clean.c b/liblwgeom/lwgeom_geos_clean.c index f0ec20faa..1d89a70b3 100644 --- a/liblwgeom/lwgeom_geos_clean.c +++ b/liblwgeom/lwgeom_geos_clean.c @@ -189,7 +189,7 @@ ptarray_close2d(POINTARRAY* ring) POINTARRAY* newring; /* close the ring if not already closed (2d only) */ - if ( ! ptarray_isclosed2d(ring) ) + if ( ! ptarray_is_closed_2d(ring) ) { /* close it up */ newring = ptarray_addPoint(ring, diff --git a/liblwgeom/lwin_wkb.c b/liblwgeom/lwin_wkb.c index 769cb2adb..1a873526f 100644 --- a/liblwgeom/lwin_wkb.c +++ b/liblwgeom/lwin_wkb.c @@ -485,7 +485,7 @@ static LWPOLY* lwpoly_from_wkb_state(wkb_parse_state *s) } /* Check that first and last points are the same. */ - if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_isclosed2d(pa) ) + if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_is_closed_2d(pa) ) { LWDEBUGF(2, "%s must have closed rings", lwtype_name(s->lwtype)); lwerror("%s must have closed rings", lwtype_name(s->lwtype)); @@ -540,13 +540,13 @@ static LWTRIANGLE* lwtriangle_from_wkb_state(wkb_parse_state *s) return NULL; } - if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_isclosed(pa) ) + if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_is_closed(pa) ) { lwerror("%s must have closed rings", lwtype_name(s->lwtype)); return NULL; } - if( s->check & LW_PARSER_CHECK_ZCLOSURE && ! ptarray_isclosedz(pa) ) + if( s->check & LW_PARSER_CHECK_ZCLOSURE && ! ptarray_is_closed_z(pa) ) { lwerror("%s must have closed rings", lwtype_name(s->lwtype)); return NULL; diff --git a/liblwgeom/lwin_wkt.c b/liblwgeom/lwin_wkt.c index c74c16709..1bd74f1c8 100644 --- a/liblwgeom/lwin_wkt.c +++ b/liblwgeom/lwin_wkt.c @@ -420,7 +420,7 @@ LWGEOM* wkt_parser_triangle_new(POINTARRAY *pa, char *dimensionality) } /* Triangles need closure. */ - if( ! ptarray_isclosed(pa) ) + if( ! ptarray_is_closed(pa) ) { ptarray_free(pa); SET_PARSER_ERROR(PARSER_ERROR_UNCLOSED); @@ -486,7 +486,7 @@ LWGEOM* wkt_parser_polygon_add_ring(LWGEOM *poly, POINTARRAY *pa, char dimcheck) /* Apply check for not closed rings, if requested. */ if( (global_parser_result.parser_check_flags & LW_PARSER_CHECK_CLOSURE) && - ! (dimcheck == 'Z' ? ptarray_isclosedz(pa) : ptarray_isclosed2d(pa)) ) + ! (dimcheck == 'Z' ? ptarray_is_closed_z(pa) : ptarray_is_closed_2d(pa)) ) { ptarray_free(pa); lwgeom_free(poly); diff --git a/liblwgeom/lwline.c b/liblwgeom/lwline.c index a902ea64a..c46585db9 100644 --- a/liblwgeom/lwline.c +++ b/liblwgeom/lwline.c @@ -428,9 +428,9 @@ int lwline_is_closed(const LWLINE *line) { if (FLAGS_GET_Z(line->flags)) - return ptarray_isclosed3d(line->points); + return ptarray_is_closed_3d(line->points); - return ptarray_isclosed2d(line->points); + return ptarray_is_closed_2d(line->points); } diff --git a/liblwgeom/lwpoly.c b/liblwgeom/lwpoly.c index 058974484..105fcc3d5 100644 --- a/liblwgeom/lwpoly.c +++ b/liblwgeom/lwpoly.c @@ -256,7 +256,7 @@ lwpoly_from_lwlines(const LWLINE *shell, if ( shell->points->npoints < 4 ) lwerror("lwpoly_from_lwlines: shell must have at least 4 points"); - if ( ! ptarray_isclosed2d(shell->points) ) + if ( ! ptarray_is_closed_2d(shell->points) ) lwerror("lwpoly_from_lwlines: shell must be closed"); rings[0] = ptarray_clone_deep(shell->points); @@ -269,7 +269,7 @@ lwpoly_from_lwlines(const LWLINE *shell, if ( hole->points->npoints < 4 ) lwerror("lwpoly_from_lwlines: holes must have at least 4 points"); - if ( ! ptarray_isclosed2d(hole->points) ) + if ( ! ptarray_is_closed_2d(hole->points) ) lwerror("lwpoly_from_lwlines: holes must be closed"); rings[nrings] = ptarray_clone_deep(hole->points); @@ -486,12 +486,12 @@ lwpoly_is_closed(const LWPOLY *poly) { if (FLAGS_GET_Z(poly->flags)) { - if ( ! ptarray_isclosed3d(poly->rings[i]) ) + if ( ! ptarray_is_closed_3d(poly->rings[i]) ) return LW_FALSE; } else { - if ( ! ptarray_isclosed2d(poly->rings[i]) ) + if ( ! ptarray_is_closed_2d(poly->rings[i]) ) return LW_FALSE; } } diff --git a/liblwgeom/lwtriangle.c b/liblwgeom/lwtriangle.c index 22dc408b6..d36f5a98b 100644 --- a/liblwgeom/lwtriangle.c +++ b/liblwgeom/lwtriangle.c @@ -133,8 +133,8 @@ lwtriangle_from_lwline(const LWLINE *shell) if ( shell->points->npoints != 4 ) lwerror("lwtriangle_from_lwline: shell must have exactly 4 points"); - if ( (!FLAGS_GET_Z(shell->flags) && !ptarray_isclosed2d(shell->points)) || - (FLAGS_GET_Z(shell->flags) && !ptarray_isclosed3d(shell->points)) ) + if ( (!FLAGS_GET_Z(shell->flags) && !ptarray_is_closed_2d(shell->points)) || + (FLAGS_GET_Z(shell->flags) && !ptarray_is_closed_3d(shell->points)) ) lwerror("lwtriangle_from_lwline: shell must be closed"); pa = ptarray_clone_deep(shell->points); diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index 571f3f7db..b7a4504ac 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -662,31 +662,31 @@ ptarray_clone(const POINTARRAY *in) * pointarray. */ int -ptarray_isclosed(const POINTARRAY *in) +ptarray_is_closed(const POINTARRAY *in) { return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), ptarray_point_size(in)); } int -ptarray_isclosed2d(const POINTARRAY *in) +ptarray_is_closed_2d(const POINTARRAY *in) { return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), sizeof(POINT2D)); } int -ptarray_isclosed3d(const POINTARRAY *in) +ptarray_is_closed_3d(const POINTARRAY *in) { return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), sizeof(POINT3D)); } int -ptarray_isclosedz(const POINTARRAY *in) +ptarray_is_closed_z(const POINTARRAY *in) { if ( FLAGS_GET_Z(in->flags) ) - return ptarray_isclosed3d(in); + return ptarray_is_closed_3d(in); else - return ptarray_isclosed2d(in); + return ptarray_is_closed_2d(in); } diff --git a/postgis/lwgeom_in_gml.c b/postgis/lwgeom_in_gml.c index ab0046bc3..f40e814ea 100644 --- a/postgis/lwgeom_in_gml.c +++ b/postgis/lwgeom_in_gml.c @@ -1107,8 +1107,8 @@ static LWGEOM* parse_gml_linearring(xmlNodePtr xnode, bool *hasz, int *root_srid ppa[0] = parse_gml_data(xnode->children, hasz, root_srid); if (ppa[0]->npoints < 4 - || (!*hasz && !ptarray_isclosed2d(ppa[0])) - || (*hasz && !ptarray_isclosed3d(ppa[0]))) + || (!*hasz && !ptarray_is_closed_2d(ppa[0])) + || (*hasz && !ptarray_is_closed_3d(ppa[0]))) gml_lwerror("invalid GML representation", 42); if (srs.reverse_axis) @@ -1160,8 +1160,8 @@ static LWGEOM* parse_gml_polygon(xmlNodePtr xnode, bool *hasz, int *root_srid) ppa[0] = parse_gml_data(xb->children, hasz, root_srid); if (ppa[0]->npoints < 4 - || (!*hasz && !ptarray_isclosed2d(ppa[0])) - || (*hasz && !ptarray_isclosed3d(ppa[0]))) + || (!*hasz && !ptarray_is_closed_2d(ppa[0])) + || (*hasz && !ptarray_is_closed_3d(ppa[0]))) gml_lwerror("invalid GML representation", 43); if (srs.reverse_axis) ppa[0] = ptarray_flip_coordinates(ppa[0]); @@ -1192,8 +1192,8 @@ static LWGEOM* parse_gml_polygon(xmlNodePtr xnode, bool *hasz, int *root_srid) ppa[ring] = parse_gml_data(xb->children, hasz, root_srid); if (ppa[ring]->npoints < 4 - || (!*hasz && !ptarray_isclosed2d(ppa[ring])) - || (*hasz && !ptarray_isclosed3d(ppa[ring]))) + || (!*hasz && !ptarray_is_closed_2d(ppa[ring])) + || (*hasz && !ptarray_is_closed_3d(ppa[ring]))) gml_lwerror("invalid GML representation", 43); if (srs.reverse_axis) ppa[ring] = ptarray_flip_coordinates(ppa[ring]); @@ -1262,8 +1262,8 @@ static LWGEOM* parse_gml_triangle(xmlNodePtr xnode, bool *hasz, int *root_srid) pa = parse_gml_data(xb->children, hasz, root_srid); if (pa->npoints != 4 - || (!*hasz && !ptarray_isclosed2d(pa)) - || (*hasz && !ptarray_isclosed3d(pa))) + || (!*hasz && !ptarray_is_closed_2d(pa)) + || (*hasz && !ptarray_is_closed_3d(pa))) gml_lwerror("invalid GML representation", 46); if (srs.reverse_axis) pa = ptarray_flip_coordinates(pa); @@ -1326,8 +1326,8 @@ static LWGEOM* parse_gml_patch(xmlNodePtr xnode, bool *hasz, int *root_srid) ppa[0] = parse_gml_data(xb->children, hasz, root_srid); if (ppa[0]->npoints < 4 - || (!*hasz && !ptarray_isclosed2d(ppa[0])) - || (*hasz && !ptarray_isclosed3d(ppa[0]))) + || (!*hasz && !ptarray_is_closed_2d(ppa[0])) + || (*hasz && !ptarray_is_closed_3d(ppa[0]))) gml_lwerror("invalid GML representation", 48); if (srs.reverse_axis) @@ -1353,8 +1353,8 @@ static LWGEOM* parse_gml_patch(xmlNodePtr xnode, bool *hasz, int *root_srid) ppa[ring] = parse_gml_data(xb->children, hasz, root_srid); if (ppa[ring]->npoints < 4 - || (!*hasz && !ptarray_isclosed2d(ppa[ring])) - || ( *hasz && !ptarray_isclosed3d(ppa[ring]))) + || (!*hasz && !ptarray_is_closed_2d(ppa[ring])) + || ( *hasz && !ptarray_is_closed_3d(ppa[ring]))) gml_lwerror("invalid GML representation", 49); if (srs.reverse_axis) diff --git a/postgis/lwgeom_in_kml.c b/postgis/lwgeom_in_kml.c index 6b01f2153..bfedeb737 100644 --- a/postgis/lwgeom_in_kml.c +++ b/postgis/lwgeom_in_kml.c @@ -397,8 +397,8 @@ static LWGEOM* parse_kml_polygon(xmlNodePtr xnode, bool *hasz) ppa[0] = parse_kml_coordinates(xb->children, hasz); if (ppa[0]->npoints < 4 - || (!*hasz && !ptarray_isclosed2d(ppa[0])) - || (*hasz && !ptarray_isclosed3d(ppa[0]))) + || (!*hasz && !ptarray_is_closed_2d(ppa[0])) + || (*hasz && !ptarray_is_closed_3d(ppa[0]))) lwerror("invalid KML representation"); } } @@ -423,8 +423,8 @@ static LWGEOM* parse_kml_polygon(xmlNodePtr xnode, bool *hasz) ppa[ring] = parse_kml_coordinates(xb->children, hasz); if (ppa[ring]->npoints < 4 - || (!*hasz && !ptarray_isclosed2d(ppa[ring])) - || (*hasz && !ptarray_isclosed3d(ppa[ring]))) + || (!*hasz && !ptarray_is_closed_2d(ppa[ring])) + || (*hasz && !ptarray_is_closed_3d(ppa[ring]))) lwerror("invalid KML representation"); ring++; -- 2.40.0