]> granicus.if.org Git - postgis/commitdiff
Rename parser_check_flags to current_parser_check_flags and unparser_check_flags...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Mon, 13 Oct 2008 13:16:14 +0000 (13:16 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Mon, 13 Oct 2008 13:16:14 +0000 (13:16 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@3095 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgparse.c
liblwgeom/lwgunparse.c

index 14612d8fa3d3f23214a2d4ddb5ae271a837c5f4a..de5873fb455b6c7e5a38b6051baf9cc458424e6d 100644 (file)
@@ -94,10 +94,10 @@ tuple* free_list=0;
 
 
 /*
- * Parser global check flags - a bitmap of flags that determine which checks the parser will perform 
+ * Parser current instance check flags - a bitmap of flags that determine which checks are enabled during the current parse 
  * (see liblwgeom.h for the related PARSER_CHECK constants)
  */
-int parser_check_flags;
+int current_parser_check_flags;
 
 
 /* Parser state flags - these are set automatically by the parser */
@@ -281,21 +281,21 @@ void
 popc(void)
 {
        /* If the minimum point check has been enabled, perform it */
-       if (parser_check_flags & PARSER_CHECK_MINPOINTS) {
+       if (current_parser_check_flags & PARSER_CHECK_MINPOINTS) {
                if ( the_geom.stack->uu.nn.num < minpoints){
                        error("geometry requires more points");
                }
        }
 
        /* If the odd number point check has been enabled, perform it */
-       if (parser_check_flags & PARSER_CHECK_ODD) {
+       if (current_parser_check_flags & PARSER_CHECK_ODD) {
                if(isodd != -1 && the_geom.stack->uu.nn.num % 2 != isodd) {
                        error("geometry must have an odd number of points");
                }
        }
 
        /* If the polygon closure check has been enabled, perform it */
-       if (parser_check_flags & PARSER_CHECK_CLOSURE) {
+       if (current_parser_check_flags & PARSER_CHECK_CLOSURE) {
                if ( checkclosed && first_point && last_point) {
                        if ( memcmp(first_point, last_point,
                                sizeof(double)*the_geom.ndims) )
@@ -1133,7 +1133,7 @@ parse_it(LWGEOM_PARSER_RESULT *lwg_parser_result, const char *geometry, int flag
        ferror_occured = 0;
 
        /* Setup the inital parser flags and empty the return struct */
-       parser_check_flags = flags;
+       current_parser_check_flags = flags;
        lwg_parser_result->serialized_lwgeom = NULL;
        lwg_parser_result->size = 0;
 
index 9a03d281c1d67ba25b180936b3a6daf0716e4356..e6893a2bd739dc60c1d626dff5c4a4a2705a3754 100644 (file)
@@ -75,10 +75,10 @@ static uchar endianbyte;
 void (*write_wkb_bytes)(uchar* ptr,unsigned int cnt,size_t size);
 
 /*
- * Parser global check flags - a bitmap of flags that determine which checks the parser will perform
+ * Unparser current instance check flags - a bitmap of flags that determine which checks are enabled during the current unparse
  * (see liblwgeom.h for the related PARSER_CHECK constants)
  */
-int unparser_check_flags;
+int current_unparser_check_flags;
 
 /*
  * Unparser result structure
@@ -243,7 +243,7 @@ output_line_collection(uchar* geom,outfunc func,int supress)
        int cnt = read_int(&geom);
 
        /* Ensure that LINESTRING has a minimum of 2 points */
-       if ((unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 2)
+       if ((current_unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 2)
                lwerror("geometry requires more points");
 
        if ( cnt == 0 ){
@@ -308,7 +308,7 @@ output_polygon_ring_collection(uchar* geom,outfunc func,int supress)
 
                /* Check if they are the same... */
                if (memcmp(&first_point, &last_point, sizeof(double) * dims) &&
-                       (unparser_check_flags & PARSER_CHECK_CLOSURE))
+                       (current_unparser_check_flags & PARSER_CHECK_CLOSURE))
                        lwerror("geometry contains non-closed rings");
 
        }
@@ -322,11 +322,11 @@ output_curve_collection(uchar* geom,outfunc func,int supress)
        int cnt = read_int(&geom);
 
        /* Ensure that a CIRCULARSTRING has a minimum of 3 points */
-        if ((unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 3)
+        if ((current_unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 3)
                 lwerror("geometry requires more points");
 
        /* Ensure that a CIRCULARSTRING has an odd number of points */
-        if ((unparser_check_flags & PARSER_CHECK_ODD) && cnt % 2 != 1)
+        if ((current_unparser_check_flags & PARSER_CHECK_ODD) && cnt % 2 != 1)
                 lwerror("geometry must have an odd number of points");
 
        if ( cnt == 0 ){
@@ -579,7 +579,7 @@ unparse_WKT(LWGEOM_UNPARSER_RESULT *lwg_unparser_result, uchar* serialized, allo
                return 0;
 
        /* Setup the inital parser flags and empty the return struct */
-        unparser_check_flags = flags;
+        current_unparser_check_flags = flags;
        lwg_unparser_result->wkoutput = NULL;
         lwg_unparser_result->size = 0;
 
@@ -711,7 +711,7 @@ output_wkb_line_collection(uchar* geom,outwkbfunc func)
        LWDEBUGF(2, "output_wkb_line_collection: %d iterations loop", cnt);
 
        /* Ensure that LINESTRING has a minimum of 2 points */
-        if ((unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 2)
+        if ((current_unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 2)
                 lwerror("geometry requires more points");
 
        write_wkb_int(cnt);
@@ -758,7 +758,7 @@ output_wkb_polygon_ring_collection(uchar* geom,outwkbfunc func)
 
        /* Check if they are the same... */
        if (memcmp(&first_point, &last_point, sizeof(double) * dims) &&
-               (unparser_check_flags & PARSER_CHECK_CLOSURE))
+               (current_unparser_check_flags & PARSER_CHECK_CLOSURE))
                lwerror("geometry contains non-closed rings");
 
        return geom;
@@ -782,11 +782,11 @@ output_wkb_curve_collection(uchar* geom,outwkbfunc func)
        LWDEBUGF(2, "output_wkb_curve_collection: %d iterations loop", cnt);
 
        /* Ensure that a CIRCULARSTRING has a minimum of 3 points */
-        if ((unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 3)
+        if ((current_unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 3)
                 lwerror("geometry requires more points");
 
        /* Ensure that a CIRCULARSTRING has an odd number of points */
-        if ((unparser_check_flags & PARSER_CHECK_ODD) && cnt % 2 != 1)
+        if ((current_unparser_check_flags & PARSER_CHECK_ODD) && cnt % 2 != 1)
                 lwerror("geometry must have an odd number of points");
 
        write_wkb_int(cnt);
@@ -893,7 +893,7 @@ unparse_WKB(LWGEOM_UNPARSER_RESULT *lwg_unparser_result, uchar* serialized, allo
                return 0;
 
        /* Setup the inital parser flags and empty the return struct */
-        unparser_check_flags = flags;
+        current_unparser_check_flags = flags;
        lwg_unparser_result->wkoutput = NULL;
        lwg_unparser_result->size = 0;