diff --git a/middle-pgsql.c b/middle-pgsql.c index 26279c6ff..5c8744077 100644 --- a/middle-pgsql.c +++ b/middle-pgsql.c @@ -469,6 +469,7 @@ static int middle_nodes_set(osmid_t id, double lat, double lon, struct keyval *t } +#if 0 static int pgsql_nodes_get(struct osmNode *out, osmid_t id) { PGresult *res; @@ -499,6 +500,7 @@ static int pgsql_nodes_get(struct osmNode *out, osmid_t id) PQclear(res); return 0; } +#endif /* Currently not used static int middle_nodes_get(struct osmNode *out, osmid_t id) diff --git a/middle-ram.c b/middle-ram.c index 0299fe372..27d50c232 100644 --- a/middle-ram.c +++ b/middle-ram.c @@ -58,7 +58,6 @@ struct ramRel { static struct ramWay *ways[NUM_BLOCKS]; static struct ramRel *rels[NUM_BLOCKS]; -static int node_blocks; static int way_blocks; static int way_out_count; diff --git a/node-persistent-cache.c b/node-persistent-cache.c index 7195f6de9..bd1047a6a 100644 --- a/node-persistent-cache.c +++ b/node-persistent-cache.c @@ -615,7 +615,7 @@ void init_node_persistent_cache(const struct output_options *options, int append { if (err == ENOSPC) { fprintf(stderr, "Failed to allocate space for node cache file: No space on disk\n"); - } else if (err = EFBIG) { + } else if (err == EFBIG) { fprintf(stderr, "Failed to allocate space for node cache file: File is too big\n"); } else { fprintf(stderr, "Failed to allocate space for node cache file: Internal error %i\n", err); diff --git a/osm2pgsql.c b/osm2pgsql.c index b6ccaf369..92a05718f 100644 --- a/osm2pgsql.c +++ b/osm2pgsql.c @@ -116,7 +116,6 @@ static void short_usage(char *arg0) static void long_usage(char *arg0) { - int i; const char *name = basename(arg0); printf("Usage:\n"); diff --git a/output-gazetteer.c b/output-gazetteer.c index 8c4a914ca..424c8bee6 100644 --- a/output-gazetteer.c +++ b/output-gazetteer.c @@ -64,9 +64,6 @@ static unsigned int BufferLen = 0; static PGconn *ConnectionDelete = NULL; static PGconn *ConnectionError = NULL; -static int CopyErrorActive = 0; -static char BufferError[BUFFER_SIZE]; -static unsigned int BufferErrorLen = 0; static FILE * hLog = NULL; @@ -157,6 +154,7 @@ static void stop_copy(void) return; } +#if 0 static void copy_error_data(const char *sql) { unsigned int sqlLen = strlen(sql); @@ -234,6 +232,7 @@ static void stop_error_copy(void) return; } +#endif static int split_tags(struct keyval *tags, unsigned int flags, struct keyval *names, struct keyval *places, struct keyval *extratags, int* admin_level, struct keyval ** housenumber, struct keyval ** street, struct keyval ** addr_place, char ** isin, struct keyval ** postcode, struct keyval ** countrycode) @@ -893,6 +892,7 @@ static void add_place(char osm_type, osmid_t osm_id, const char *class, const ch return; } +#if 0 static void add_polygon_error(char osm_type, osmid_t osm_id, const char *class, const char *type, struct keyval *names, const char *countrycode, const char *wkt) { @@ -962,6 +962,7 @@ static void add_polygon_error(char osm_type, osmid_t osm_id, const char *class, return; } +#endif static void delete_place(char osm_type, osmid_t osm_id) diff --git a/output-pgsql.c b/output-pgsql.c index 8f33770e2..ac8abf87a 100644 --- a/output-pgsql.c +++ b/output-pgsql.c @@ -701,11 +701,10 @@ static int pgsql_out_way(osmid_t id, struct keyval *tags, struct osmNode *nodes, static int pgsql_out_relation(osmid_t id, struct keyval *rel_tags, int member_count, struct osmNode **xnodes, struct keyval *xtags, int *xcount, osmid_t *xid, const char **xrole) { int i, wkt_size; - int polygon = 0, roads = 0; + int roads = 0; int make_polygon = 0; int make_boundary = 0; int * members_superseeded; - char *type; double split_at; members_superseeded = calloc(sizeof(int), member_count); @@ -1117,12 +1116,13 @@ static void *pgsql_out_stop_one(void *arg) if (Options->enable_hstore_index) { fprintf(stderr, "Creating hstore indexes on %s\n", table->name); if (Options->tblsmain_index) { - if (HSTORE_NONE != (Options->enable_hstore)) + if (HSTORE_NONE != (Options->enable_hstore)) { if (Options->slim && !Options->droptemp) { pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_tags_index ON %s USING GIN (tags) TABLESPACE %s;\n", table->name, table->name, Options->tblsmain_index); } else { pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_tags_index ON %s USING GIN (tags) WITH (FILLFACTOR=100) TABLESPACE %s;\n", table->name, table->name, Options->tblsmain_index); } + } for(i_column = 0; i_column < Options->n_hstore_columns; i_column++) { if (Options->slim && !Options->droptemp) { pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_hstore_%i_index ON %s USING GIN (\"%s\") TABLESPACE %s;\n", @@ -1133,12 +1133,13 @@ static void *pgsql_out_stop_one(void *arg) } } } else { - if (HSTORE_NONE != (Options->enable_hstore)) + if (HSTORE_NONE != (Options->enable_hstore)) { if (Options->slim && !Options->droptemp) { pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_tags_index ON %s USING GIN (tags);\n", table->name, table->name); } else { pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_tags_index ON %s USING GIN (tags) WITH (FILLFACTOR=100);\n", table->name, table->name); } + } for(i_column = 0; i_column < Options->n_hstore_columns; i_column++) { if (Options->slim && !Options->droptemp) { pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_hstore_%i_index ON %s USING GIN (\"%s\");\n", table->name, i_column,table->name, Options->hstore_columns[i_column]); @@ -1280,7 +1281,6 @@ static int pgsql_process_relation(osmid_t id, struct member *members, int member int *xcount = malloc( (member_count+1) * sizeof(int) ); struct keyval *xtags = malloc( (member_count+1) * sizeof(struct keyval) ); struct osmNode **xnodes = malloc( (member_count+1) * sizeof(struct osmNode*) ); - int filter; /* If the flag says this object may exist already, delete it first */ if(exists) diff --git a/parse-pbf.c b/parse-pbf.c index 5277156dd..0d09df012 100644 --- a/parse-pbf.c +++ b/parse-pbf.c @@ -55,6 +55,7 @@ static uint32_t get_length(FILE *input) return ntohl(*((size_t *)buf)); } +#if 0 static void *realloc_or_free(void *p, size_t len) { void *new = realloc(p, len); @@ -65,6 +66,7 @@ static void *realloc_or_free(void *p, size_t len) return new; } +#endif static BlockHeader *read_header(FILE *input, void *buf) { diff --git a/tagtransform.c b/tagtransform.c index d6f9f12c9..2814815e7 100644 --- a/tagtransform.c +++ b/tagtransform.c @@ -1,11 +1,13 @@ #include +#include #include #include "osmtypes.h" #include "keyvals.h" #include "tagtransform.h" #include "output-pgsql.h" #include "config.h" +#include "wildcmp.h" #ifdef HAVE_LUA static lua_State *L; diff --git a/tagtransform.h b/tagtransform.h index 185e20277..3fe12526f 100644 --- a/tagtransform.h +++ b/tagtransform.h @@ -20,6 +20,7 @@ unsigned int tagtransform_filter_rel_tags(struct keyval *tags); unsigned int tagtransform_filter_rel_member_tags(struct keyval *rel_tags, int member_count, struct keyval *member_tags,const char **member_role, int * member_superseeded, int * make_boundary, int * make_polygon, int * roads); int tagtransform_init(const struct output_options *options); +void tagtransform_shutdown(); #ifdef __cplusplus }