summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-01-24 16:28:55 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-01-24 16:28:55 +0000
commitbcffd5129ce38d0a42cedd13e46104b6c0dc19ee (patch)
tree01ec2839477095cfa8801b1c60ef7153cd33396a
parentb26596a155fecc10a2cbcc31de9532948a10a011 (diff)
downloadnavit-bcffd5129ce38d0a42cedd13e46104b6c0dc19ee.tar.gz
Fix:maptool:MSVC fixes|Thanks chollya
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3994 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r--navit/maptool/boundaries.c2
-rw-r--r--navit/maptool/ch.c17
-rw-r--r--navit/maptool/coastline.c15
-rw-r--r--navit/maptool/geom.c6
4 files changed, 22 insertions, 18 deletions
diff --git a/navit/maptool/boundaries.c b/navit/maptool/boundaries.c
index af6f3109d..439e02b4d 100644
--- a/navit/maptool/boundaries.c
+++ b/navit/maptool/boundaries.c
@@ -115,7 +115,7 @@ test(GList *boundaries_list)
static void
dump_hierarchy(GList *l, char *prefix)
{
- char newprefix[strlen(prefix)+2];
+ char *newprefix=g_alloca(sizeof(char)*(strlen(prefix)+2));
strcpy(newprefix, prefix);
strcat(newprefix," ");
while (l) {
diff --git a/navit/maptool/ch.c b/navit/maptool/ch.c
index abd11a415..42a001032 100644
--- a/navit/maptool/ch.c
+++ b/navit/maptool/ch.c
@@ -229,10 +229,11 @@ ch_process_node(FILE *out, int node, int resolve)
int edge_id;
struct ch_edge ch_edge;
struct item_bin *item_bin;
- memset(&ch_edge, 0, sizeof(ch_edge));
struct edge_hash_item fwd,rev;
+ int oldnode;
+ memset(&ch_edge, 0, sizeof(ch_edge));
item_bin=init_item(type_ch_node);
- int oldnode=GPOINTER_TO_INT(g_hash_table_lookup(newnode_hash, GINT_TO_POINTER(node)));
+ oldnode=GPOINTER_TO_INT(g_hash_table_lookup(newnode_hash, GINT_TO_POINTER(node)));
#if 0
dbg(0,"0x%x,0x%x\n",node_index[oldnode].x,node_index[oldnode].y);
#endif
@@ -426,12 +427,13 @@ ch_generate_tiles(char *map_suffix, char *suffix, FILE *tilesdir_out, struct zip
{
struct tile_info info;
FILE *in,*ref,*ddsg_coords,*ddsg;
+ FILE **graphfiles;
info.write=0;
info.maxlen=0;
info.suffix=suffix;
info.tiles_list=NULL;
info.tilesdir_out=tilesdir_out;
- FILE *graphfiles[ch_levels+1];
+ graphfiles=g_alloca(sizeof(FILE*)*(ch_levels+1));
ch_create_tempfiles(suffix, graphfiles, ch_levels, 1);
in=tempfile(map_suffix,"ways_split",0);
@@ -460,16 +462,17 @@ ch_assemble_map(char *map_suffix, char *suffix, struct zip_info *zip_info)
{
struct tile_info info;
struct tile_head *th;
- FILE *graphfiles[ch_levels+1];
+ FILE **graphfiles=g_alloca(sizeof(FILE*)*(ch_levels+1));
+ FILE *ref;
+ struct item_id id;
+ int nodeid=0;
info.write=1;
info.maxlen=zip_info->maxnamelen;
info.suffix=suffix;
info.tiles_list=NULL;
info.tilesdir_out=NULL;
- FILE *ref=tempfile(suffix,"sgr_ref",1);
- struct item_id id;
- int nodeid=0;
+ ref=tempfile(suffix,"sgr_ref",1);
create_tile_hash();
diff --git a/navit/maptool/coastline.c b/navit/maptool/coastline.c
index a44158522..c6a1de715 100644
--- a/navit/maptool/coastline.c
+++ b/navit/maptool/coastline.c
@@ -320,7 +320,7 @@ static void
ocean_tile(GHashTable *hash, char *tile, char c, struct item_bin_sink *out)
{
int len=strlen(tile);
- char tile2[len+1];
+ char *tile2=g_alloca(sizeof(char)*(len+1));
struct rect bbox;
struct item_bin *ib;
struct coord co;
@@ -391,7 +391,7 @@ tile_sibling_edges(GHashTable *hash, char *tile, char c)
{
int len=strlen(tile);
int ret;
- char tile2[len+1];
+ char *tile2=g_alloca(sizeof(char)*(len+1));
void *data;
strcpy(tile2, tile);
tile2[len-1]=c;
@@ -436,14 +436,14 @@ ocean_tile2(struct rect *r, int dx, int dy, int wf, int hf, struct item_bin_sink
static void
tile_collector_add_siblings2(char *tile, void *edgesp, struct coastline_tile_data *data)
{
+ int edges=(int)edgesp;
+ int pedges=0;
+ int debug=0;
int len=strlen(tile);
- char tile2[len+1];
+ char *tile2=g_alloca(sizeof(char)*(len+1));
char t=tile[len-1];
strcpy(tile2, tile);
tile2[len-1]='\0';
- int edges=(int)edgesp;
- int pedges=0;
- int debug=0;
#if 0
if (!strncmp(tile,"bcacccaadbdcd",10))
debug=1;
@@ -482,9 +482,10 @@ tile_collector_finish(struct item_bin_sink_func *tile_collector)
{
struct coastline_tile_data data;
int i;
+ GHashTable *hash;
data.sink=tile_collector;
data.tile_edges=g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
- GHashTable *hash=tile_collector->priv_data[0];
+ hash=tile_collector->priv_data[0];
fprintf(stderr,"tile_collector_finish\n");
g_hash_table_foreach(hash, (GHFunc) tile_collector_process_tile, &data);
fprintf(stderr,"tile_collector_finish foreach done\n");
diff --git a/navit/maptool/geom.c b/navit/maptool/geom.c
index 5d4bbcc08..ad32b74e7 100644
--- a/navit/maptool/geom.c
+++ b/navit/maptool/geom.c
@@ -290,7 +290,7 @@ clip_line_code(struct coord *p1, struct coord *p2, struct rect *r)
void
clip_line(struct item_bin *ib, struct rect *r, struct tile_parameter *param, struct item_bin_sink *out)
{
- char buffer[ib->len*4+32];
+ char *buffer=g_alloca(sizeof(char)*(ib->len*4+32));
struct item_bin *ib_new=(struct item_bin *)buffer;
struct coord *pa=(struct coord *)(ib+1);
int count=ib->clen/2;
@@ -376,9 +376,9 @@ clip_polygon(struct item_bin *ib, struct rect *r, struct tile_parameter *param,
{
int count_in=ib->clen/2;
struct coord *pin,*p,*s,pi;
- char buffer1[ib->len*4+ib->clen*7+32];
+ char *buffer1=g_alloca(sizeof(char)*(ib->len*4+ib->clen*7+32));
struct item_bin *ib1=(struct item_bin *)buffer1;
- char buffer2[ib->len*4+ib->clen*7+32];
+ char *buffer2=g_alloca(sizeof(char)*(ib->len*4+ib->clen*7+32));
struct item_bin *ib2=(struct item_bin *)buffer2;
struct item_bin *ib_in,*ib_out;
int edge,i;