]> granicus.if.org Git - postgis/commitdiff
clean up some compiler warnings
authorRegina Obe <lr@pcorp.us>
Thu, 19 May 2011 04:04:14 +0000 (04:04 +0000)
committerRegina Obe <lr@pcorp.us>
Thu, 19 May 2011 04:04:14 +0000 (04:04 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7198 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwout_x3d.c

index f5598e1348534dabf7f82eabe2f30f392fa15417..49c1532749332b5281cff4d95b2e38ee89bf276c 100644 (file)
@@ -164,7 +164,7 @@ asx3d3_line_buf(const LWLINE *line, char *srs, char *output, int precision, int
 \r
 \r
        ptr += sprintf(ptr, "<Coordinate point='");\r
-       ptr += pointArray_toX3D3(line->points, ptr, precision, opts, lwline_is_closed(line));\r
+       ptr += pointArray_toX3D3(line->points, ptr, precision, opts, lwline_is_closed((LWLINE *) line));\r
 \r
        ptr += sprintf(ptr, "' />");\r
 \r
@@ -234,7 +234,7 @@ asx3d3_mpoly_coordindex(const LWMPOLY *psur, char *output)
 {\r
        char *ptr=output;\r
        LWPOLY *patch;\r
-       int i, j, k, l, si;\r
+       int i, j, k, l;\r
        int np;\r
        j = 0;\r
        for (i=0; i<psur->ngeoms; i++)\r
@@ -403,35 +403,35 @@ asx3d3_multi_size(const LWCOLLECTION *col, char *srs, int precision, int opts, c
 static size_t\r
 asx3d3_multi_buf(const LWCOLLECTION *col, char *srs, char *output, int precision, int opts, const char *defid)\r
 {\r
-       int type = col->type;\r
        char *ptr, *x3dtype;\r
        int i;\r
        LWGEOM *subgeom;\r
-       POINTARRAY *pa;\r
-\r
        ptr = output;\r
        x3dtype="";\r
 \r
 \r
-       if      (type == MULTIPOINTTYPE)\r
-       {\r
-               x3dtype = "PointSet";\r
-               ptr += sprintf(ptr, "<%s %s>", x3dtype, defid);\r
-       }\r
-       else if (type == MULTILINETYPE)\r
+       switch (col->type)\r
        {\r
-               x3dtype = "IndexedLineSet";\r
-               ptr += sprintf(ptr, "<%s %s coordIndex='", x3dtype, defid);\r
-               ptr += asx3d3_mline_coordindex(col, ptr);\r
-               ptr += sprintf(ptr, "'>");\r
-       }\r
-       else if (type == MULTIPOLYGONTYPE)\r
-       {\r
-               x3dtype = "IndexedFaceSet";\r
-               ptr += sprintf(ptr, "<%s %s coordIndex='", x3dtype, defid);\r
-               ptr += asx3d3_mpoly_coordindex(col,ptr);\r
-               ptr += sprintf(ptr, "'>");\r
-       }\r
+        case MULTIPOINTTYPE:\r
+            x3dtype = "PointSet";\r
+            ptr += sprintf(ptr, "<%s %s>", x3dtype, defid);\r
+            break;\r
+        case MULTILINETYPE:\r
+            x3dtype = "IndexedLineSet";\r
+            ptr += sprintf(ptr, "<%s %s coordIndex='", x3dtype, defid);\r
+            ptr += asx3d3_mline_coordindex(col, ptr);\r
+            ptr += sprintf(ptr, "'>");\r
+            break;\r
+        case MULTIPOLYGONTYPE:\r
+            x3dtype = "IndexedFaceSet";\r
+            ptr += sprintf(ptr, "<%s %s coordIndex='", x3dtype, defid);\r
+            ptr += asx3d3_mpoly_coordindex(col,ptr);\r
+            ptr += sprintf(ptr, "'>");\r
+            break;\r
+        default:\r
+            lwerror("asx3d3_multi_buf: '%s' geometry type not supported", lwtype_name(col->type));\r
+            return NULL;\r
+    }\r
 \r
        ptr += sprintf(ptr, "<Coordinate point='");\r
 \r
@@ -849,4 +849,4 @@ pointArray_X3Dsize(POINTARRAY *pa, int precision)
                       * 2 * pa->npoints;\r
 \r
        return (OUT_MAX_DIGS_DOUBLE + precision + sizeof(" ")) * 3 * pa->npoints;\r
-}
\ No newline at end of file
+}\r