From 280c1eb76acf523e96c15bc7bd9ad8a3c6ed3d62 Mon Sep 17 00:00:00 2001 From: martin-s Date: Wed, 16 Apr 2008 19:55:23 +0000 Subject: [PATCH] Fix:Core:Rearranged some code to make it work on older gccs git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1016 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/src/coord.c | 2 +- navit/src/cursor.c | 4 ++-- navit/src/data/binfile/binfile.c | 3 ++- navit/src/data/mg/street.c | 2 +- navit/src/gui/internal/gui_internal.c | 6 +----- navit/src/navigation.c | 10 +++++++--- navit/src/osm2navit.c | 2 +- navit/src/route.c | 8 ++++++-- 8 files changed, 21 insertions(+), 16 deletions(-) diff --git a/navit/src/coord.c b/navit/src/coord.c index 0d800fc..74b6a10 100644 --- a/navit/src/coord.c +++ b/navit/src/coord.c @@ -177,9 +177,9 @@ coord_parse(const char *c_str, enum projection pro, struct coord *c_ret) } *c_ret=c; } else if (*s == 'N' || *s == 'n' || *s == 'S' || *s == 's') { - dbg(1,"str='%s'\n", str); double lng, lat; char ns, ew; + dbg(1,"str='%s'\n", str); args=sscanf(str, "%lf %c %lf %c%n", &lat, &ns, &lng, &ew, &ret); if (args < 4) goto out; diff --git a/navit/src/cursor.c b/navit/src/cursor.c index 485754e..cf706c2 100644 --- a/navit/src/cursor.c +++ b/navit/src/cursor.c @@ -103,10 +103,10 @@ cursor_draw(struct cursor *this_, struct point *pnt, int dir, int draw_dir, int static gboolean cursor_animate(struct cursor * this) { + struct point p; this->current_gc++; if (this->current_gc >= NUM_GC) this->current_gc=0; - struct point p; p.x = this->cursor_pnt.x; p.y = this->cursor_pnt.y; cursor_draw(this, &p, this->last_dir, this->last_draw_dir, 1); @@ -118,8 +118,8 @@ cursor_new(struct graphics *gra, struct color *c, struct color *c2, int animate) { unsigned char dash_list[] = { 4, 6 }; int i; - dbg(2,"enter gra=%p c=%p\n", gra, c); struct cursor *this=g_new(struct cursor,1); + dbg(2,"enter gra=%p c=%p\n", gra, c); this->gra=gra; this->animate_timer=0; for (i=0;itype) { @@ -477,7 +478,7 @@ binmap_search_new(struct map_priv *map, struct item *item, struct attr *search, ms->order[i] = 18; } map_rec = map_rect_new_binfile(map, ms); - struct item *town = map_rect_get_item_byid_binfile(map_rec, item->id_hi, item->id_lo); + town = map_rect_get_item_byid_binfile(map_rec, item->id_hi, item->id_lo); if (town) { struct map_search_priv *msp = g_new(struct map_search_priv, 1); struct coord *c = g_new(struct coord, 1); diff --git a/navit/src/data/mg/street.c b/navit/src/data/mg/street.c index 457f7da..019adb7 100644 --- a/navit/src/data/mg/street.c +++ b/navit/src/data/mg/street.c @@ -622,7 +622,7 @@ street_name_attr_get(void *priv_data, enum attr_type attr_type, struct attr *att printf("\n"); { while (p < end) { - unsigned char *pn,*pn_end;; + unsigned char *pn,*pn_end; struct street_name_number nn; street_name_numbers_get(&nns, &p); printf("name_numbers:\n"); diff --git a/navit/src/gui/internal/gui_internal.c b/navit/src/gui/internal/gui_internal.c index 8c4e147..e953754 100644 --- a/navit/src/gui/internal/gui_internal.c +++ b/navit/src/gui/internal/gui_internal.c @@ -1,12 +1,8 @@ #include #include #include -#include -#if !defined(GDK_Book) || !defined(GDK_Calendar) -#include -#endif #include -#include +#include #include "config.h" #include "item.h" #include "navit.h" diff --git a/navit/src/navigation.c b/navit/src/navigation.c index 9f04c0b..86fcb34 100644 --- a/navit/src/navigation.c +++ b/navit/src/navigation.c @@ -384,8 +384,8 @@ static void make_maneuvers(struct navigation *this_) { struct navigation_itm *itm, *last=NULL, *last_itm=NULL; - itm=this_->first; int delta; + itm=this_->first; this_->cmd_last=NULL; this_->cmd_first=NULL; while (itm) { @@ -730,9 +730,13 @@ navigation_unregister_callback(struct navigation *this_, enum attr_type type, st struct map * navigation_get_map(struct navigation *this_) { - struct attr navigation_attr={.type=attr_navigation,.u.navigation=this_}; - struct attr data_attr={.type=attr_data,.u.str=""}; + struct attr navigation_attr; + struct attr data_attr; struct attr *attrs_navigation[]={&navigation_attr, &data_attr, NULL}; + navigation_attr.type=attr_navigation; + navigation_attr.u.navigation=this_; + data_attr.type=attr_data; + data_attr.u.str=""; if (! this_->map) this_->map=map_new("navigation",attrs_navigation); diff --git a/navit/src/osm2navit.c b/navit/src/osm2navit.c index 22d6be8..cc5622a 100644 --- a/navit/src/osm2navit.c +++ b/navit/src/osm2navit.c @@ -1315,8 +1315,8 @@ tile(struct rect *r, char *ret, int max) static void tile_bbox(char *tile, struct rect *r) { - *r=world_bbox; struct coord c; + *r=world_bbox; while (*tile) { c.x=(r->l.x+r->h.x)/2; c.y=(r->l.y+r->h.y)/2; diff --git a/navit/src/route.c b/navit/src/route.c index 85e8a5a..3c10789 100644 --- a/navit/src/route.c +++ b/navit/src/route.c @@ -1742,9 +1742,13 @@ route_graph_map_new(struct map_methods *meth, struct attr **attrs) static struct map * route_get_map_helper(struct route *this_, struct map **map, char *type) { - struct attr route_attr={.type=attr_route,.u.route=this_}; - struct attr data_attr={.type=attr_data,.u.str=""}; + struct attr route_attr; + struct attr data_attr; struct attr *attrs_route[]={&route_attr, &data_attr, NULL}; + route_attr.type=attr_route; + route_attr.u.route=this_; + data_attr.type=attr_data; + data_attr.u.str=""; if (! *map) *map=map_new(type,attrs_route); -- 2.7.4