Fix:Core:Various minor fixes and improvements
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 22 Feb 2010 07:52:54 +0000 (07:52 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 22 Feb 2010 07:52:54 +0000 (07:52 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@2957 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/attr.h
navit/navit/debug.c
navit/navit/vehicle.c
navit/navit/xmlconfig.c

index 5391018..6c357d9 100644 (file)
@@ -84,6 +84,7 @@ enum attr_position_valid {
 #define ATTR_IS_COORD_GEO(x) ((x) >= attr_type_coord_geo_begin && (x) <= attr_type_coord_geo_end)
 #define ATTR_IS_NUMERIC(x) (ATTR_IS_INT(x) || ATTR_IS_DOUBLE(x))
 #define ATTR_IS_COLOR(x) ((x) >= attr_type_color_begin && (x) <= attr_type_color_end)
+#define ATTR_IS_PCOORD(x) ((x) >= attr_type_pcoord_begin && (x) <= attr_type_pcoord_end)
 
 struct attr {
        enum attr_type type;
index 05fd753..d30ab5d 100644 (file)
@@ -72,7 +72,7 @@ static void sigsegv(int sig)
 void
 debug_init(const char *program_name)
 {
-       gdb_program=program_name;
+       gdb_program=g_strdup(program_name);
        signal(SIGSEGV, sigsegv);
        debug_hash=g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
        debug_fp = stderr;
index 117a71f..4f0af4e 100644 (file)
@@ -256,6 +256,7 @@ vehicle_remove_attr(struct vehicle *this_, struct attr *attr)
                callback_list_remove(this_->cbl, attr->u.callback);
                break;
        default:
+               this_->attrs=attr_generic_remove_attr(this_->attrs, attr);
                return 0;
        }
        return 1;
index 0472405..b8f09d6 100644 (file)
@@ -261,11 +261,11 @@ static struct object_func object_funcs[] = {
        { attr_polygon,    NEW(polygon_new),  NULL, NULL, NULL, NULL, ADD(element_add_attr)},
        { attr_polyline,   NEW(polyline_new), NULL, NULL, NULL, NULL, ADD(element_add_attr)},
        { attr_roadprofile,NEW(roadprofile_new),  GET(roadprofile_get_attr), NULL, NULL, SET(roadprofile_set_attr), ADD(roadprofile_add_attr) },
-       { attr_route,      NEW(route_new), GET(route_get_attr)},
+       { attr_route,      NEW(route_new), GET(route_get_attr), NULL, NULL, SET(route_set_attr), ADD(route_add_attr), REMOVE(route_remove_attr)},
        { attr_speech,     NEW(speech_new), GET(speech_get_attr), NULL, NULL, SET(speech_set_attr)},
        { attr_text,       NEW(text_new)},
        { attr_tracking,   NEW(tracking_new)},
-       { attr_vehicle,    NEW(vehicle_new),  GET(vehicle_get_attr), NULL, NULL, SET(vehicle_set_attr), ADD(vehicle_add_attr) },
+       { attr_vehicle,    NEW(vehicle_new),  GET(vehicle_get_attr), NULL, NULL, SET(vehicle_set_attr), ADD(vehicle_add_attr), REMOVE(vehicle_remove_attr) },
        { attr_vehicleprofile, NEW(vehicleprofile_new),  GET(vehicleprofile_get_attr), NULL, NULL, SET(vehicleprofile_set_attr), ADD(vehicleprofile_add_attr) },
 };