Fix:Core:Rearranged some code to make it work on older gccs
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 16 Apr 2008 19:55:23 +0000 (19:55 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 16 Apr 2008 19:55:23 +0000 (19:55 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1016 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/src/coord.c
navit/src/cursor.c
navit/src/data/binfile/binfile.c
navit/src/data/mg/street.c
navit/src/gui/internal/gui_internal.c
navit/src/navigation.c
navit/src/osm2navit.c
navit/src/route.c

index 0d800fc..74b6a10 100644 (file)
@@ -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;
index 485754e..cf706c2 100644 (file)
@@ -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;i<NUM_GC;i++) {
index 4ea7c30..51508cc 100644 (file)
@@ -452,6 +452,7 @@ binmap_search_new(struct map_priv *map, struct item *item, struct attr *search,
        struct map_rect_priv *map_rec;
        struct map_search_priv *msp;
        struct map_selection *ms;
+       struct item *town;
        int i;
        
        switch (search->type) {
@@ -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);
index 457f7da..019adb7 100644 (file)
@@ -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");
index 8c4e147..e953754 100644 (file)
@@ -1,12 +1,8 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <gdk/gdkkeysyms.h>
-#if !defined(GDK_Book) || !defined(GDK_Calendar)
-#include <X11/XF86keysym.h>
-#endif
 #include <libintl.h>
-#include <gtk/gtk.h>
+#include <glib.h>
 #include "config.h"
 #include "item.h"
 #include "navit.h"
index 9f04c0b..86fcb34 100644 (file)
@@ -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);
index 22d6be8..cc5622a 100644 (file)
@@ -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;
index 85e8a5a..3c10789 100644 (file)
@@ -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);