From: Olivier Courtin Date: Tue, 22 May 2012 08:49:36 +0000 (+0000) Subject: Fix some unintialized vars. Fix becoming wrong prototype call in GML3 cunit tests... X-Git-Tag: 2.1.0beta2~1007 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f7d50658af8e6d9e872d0fdd7de4efdd4f4e914c;p=postgis Fix some unintialized vars. Fix becoming wrong prototype call in GML3 cunit tests. Related to #1823 git-svn-id: http://svn.osgeo.org/postgis/trunk@9775 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/cunit/cu_out_gml.c b/liblwgeom/cunit/cu_out_gml.c index 00c4ae2dd..d00c560a6 100644 --- a/liblwgeom/cunit/cu_out_gml.c +++ b/liblwgeom/cunit/cu_out_gml.c @@ -59,7 +59,7 @@ static void do_gml3_test_opts(char * in, char * out, char * srs, int precision, char *h; g = lwgeom_from_wkt(in, LW_PARSER_CHECK_NONE); - h = lwgeom_to_gml3(g, srs, precision, opts, "gml:"); + h = lwgeom_to_gml3(g, srs, precision, opts, "gml:", ""); if (strcmp(h, out)) fprintf(stderr, "\nIn: %s\nOut: %s\nTheo: %s\n", in, h, out); @@ -78,7 +78,7 @@ static void do_gml3_test(char * in, char * out, char * srs, int precision, int i if ( is_geodetic ) opts |= LW_GML_IS_DEGREE; g = lwgeom_from_wkt(in, LW_PARSER_CHECK_NONE); - h = lwgeom_to_gml3(g, srs, precision, opts, "gml:"); + h = lwgeom_to_gml3(g, srs, precision, opts, "gml:", ""); if (strcmp(h, out)) fprintf(stderr, "\nIn: %s\nOut: %s\nTheo: %s\n", in, h, out); @@ -98,7 +98,7 @@ static void do_gml3_test_prefix(char * in, char * out, char * srs, int precision if ( is_geodetic ) opts |= LW_GML_IS_DEGREE; g = lwgeom_from_wkt(in, LW_PARSER_CHECK_NONE); - h = lwgeom_to_gml3(g, srs, precision, opts, prefix); + h = lwgeom_to_gml3(g, srs, precision, opts, prefix, ""); if (strcmp(h, out)) fprintf(stderr, "\nIn: %s\nOut: %s\nTheo: %s\n", in, h, out); @@ -119,7 +119,7 @@ static void do_gml3_test_nodims(char * in, char * out, char * srs, int precision if ( is_dims ) opts |= LW_GML_IS_DIMS; g = lwgeom_from_wkt(in, LW_PARSER_CHECK_NONE); - h = lwgeom_to_gml3(g, srs, precision, opts, prefix); + h = lwgeom_to_gml3(g, srs, precision, opts, prefix, ""); if (strcmp(h, out)) fprintf(stderr, "\nIn: %s\nOut: %s\nTheo: %s\n", in, h, out); @@ -155,7 +155,7 @@ static void do_gml3_unsupported(char * in, char * out) int opts = LW_GML_IS_DIMS; g = lwgeom_from_wkt(in, LW_PARSER_CHECK_NONE); - h = lwgeom_to_gml3(g, NULL, 0, opts, ""); + h = lwgeom_to_gml3(g, NULL, 0, opts, "", ""); if (strcmp(cu_error_msg, out)) fprintf(stderr, "\nGML 3 - In: %s\nOut: %s\nTheo: %s\n", diff --git a/postgis/geography_inout.c b/postgis/geography_inout.c index af5d4fec7..c0d9ff2a1 100644 --- a/postgis/geography_inout.c +++ b/postgis/geography_inout.c @@ -211,10 +211,11 @@ Datum geography_as_gml(PG_FUNCTION_ARGS) int option=0; int lwopts = LW_GML_IS_DIMS; static const char *default_prefix = "gml:"; - char *prefix_buf, *id_buf; const char *prefix = default_prefix; - text *prefix_text, *id_text; - const char *id; + char *prefix_buf = ""; + text *prefix_text, *id_text = NULL; + const char *id=""; + char *id_buf; /* Get the version */ diff --git a/postgis/lwgeom_export.c b/postgis/lwgeom_export.c index 94089de9e..0624030cb 100644 --- a/postgis/lwgeom_export.c +++ b/postgis/lwgeom_export.c @@ -174,7 +174,7 @@ Datum LWGEOM_asGML(PG_FUNCTION_ARGS) int precision = OUT_MAX_DOUBLE_PRECISION; static const char* default_prefix = "gml:"; /* default prefix */ const char* prefix = default_prefix; - const char* gml_id; + const char* gml_id = ""; char *prefix_buf, *gml_id_buf; text *prefix_text, *gml_id_text;