summaryrefslogtreecommitdiff
path: root/navit/attr.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-10-28 19:36:44 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-10-28 19:36:44 +0000
commite51f149775707f82607dc42d819ec96bf2040e57 (patch)
tree31d7ab71fe41c86cba05c5afc290326750be7a20 /navit/attr.c
parentc5b5af1647b3032f49b72ada83ad9cd2279c55c2 (diff)
downloadnavit-e51f149775707f82607dc42d819ec96bf2040e57.tar.gz
Fix:Core:Repaired vehicle handling
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1590 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/attr.c')
-rw-r--r--navit/attr.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/navit/attr.c b/navit/attr.c
index ad328ce07..eba8a0844 100644
--- a/navit/attr.c
+++ b/navit/attr.c
@@ -159,7 +159,7 @@ attr_new_from_text(const char *name, const char *value)
}
break;
}
- if (attr >= attr_type_coord_geo_start && attr <= attr_type_coord_geo_end) {
+ if (attr >= attr_type_coord_geo_begin && attr <= attr_type_coord_geo_end) {
g=g_new(struct coord_geo, 1);
ret->u.coord_geo=g;
coord_parse(value, projection_mg, &c);
@@ -263,12 +263,17 @@ attr_generic_set_attr(struct attr **attrs, struct attr *attr)
int
attr_data_size(struct attr *attr)
{
- if (attr->type >= attr_type_string_begin && attr->type <= attr_type_string_end) {
+ if (attr->type >= attr_type_string_begin && attr->type <= attr_type_string_end)
return strlen(attr->u.str)+1;
- }
- if (attr->type >= attr_type_int_begin && attr->type <= attr_type_int_end) {
+ if (attr->type >= attr_type_int_begin && attr->type <= attr_type_int_end)
return sizeof(attr->u.num);
- }
+ if (attr->type >= attr_type_coord_geo_begin && attr->type <= attr_type_coord_geo_end)
+ return sizeof(*attr->u.coord_geo);
+ if (attr->type >= attr_type_color_begin && attr->type <= attr_type_color_end)
+ return sizeof(*attr->u.color);
+ if (attr->type >= attr_type_object_begin && attr->type <= attr_type_object_end)
+ return sizeof(void *);
+ dbg(0,"size for %s unknown\n", attr_to_name(attr->type));
return 0;
}