summaryrefslogtreecommitdiff
path: root/navit/map
diff options
context:
space:
mode:
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-08-11 20:25:01 +0000
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-08-11 20:25:01 +0000
commit433982989f626f3794caa17efbae7457c014e781 (patch)
treed4543db43156040aeb78c060836273393262a982 /navit/map
parentc576f67df18a66a757eeea474e11786d7d42d16f (diff)
downloadnavit-433982989f626f3794caa17efbae7457c014e781.tar.gz
Fix:map_mg:Fix warnings by removing loads of dead code.|Part of #1154.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5566 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/map')
-rw-r--r--navit/map/mg/street.c240
1 files changed, 0 insertions, 240 deletions
diff --git a/navit/map/mg/street.c b/navit/map/mg/street.c
index a61836cf6..18e35aa7d 100644
--- a/navit/map/mg/street.c
+++ b/navit/map/mg/street.c
@@ -401,168 +401,6 @@ street_get_data(struct street_priv *street, unsigned char **p)
(*p)+=street->type_count*sizeof(struct street_type);
}
-
-static void
-street_housenumber_coord_rewind(void *priv_data)
-{
- struct street_priv *street=priv_data;
- street->cidx=0;
-}
-
-static void
-street_housenumber_attr_rewind(void *priv_data)
-{
- /* struct street_priv *street=priv_data; */
-
-}
-
-static int
-street_housenumber_coord_get(void *priv_data, struct coord *c, int count)
-{
- struct street_priv *street=priv_data;
- if (street->cidx || !count || !street->name.len)
- return 0;
- *c=street->hnc[street->housenumber-2];
- street->cidx=1;
- return 1;
-}
-
-static int
-street_housenumber_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
-{
- struct street_priv *street=priv_data;
- struct housenumber *hn;
- attr->type=attr_type;
- switch (attr_type) {
- case attr_label:
- hn=&street->hn[street->housenumber-2];
- sprintf(street->debug,"%d%s",hn->number,hn->suffix);
- attr->u.str=street->debug;
- return 1;
- default:
- dbg(0,"unknown item\n");
- return 0;
- }
-}
-
-static struct item_methods street_housenumber_meth = {
- street_housenumber_coord_rewind,
- street_housenumber_coord_get,
- street_housenumber_attr_rewind,
- street_housenumber_attr_get,
-};
-
-static void
-project(struct coord *c, int count, int di, int dlr, struct coord *ch)
-{
- struct coord cr;
- int dx,dy;
- int l;
-
- if (di > 0) {
- dx=c[1].x-c[0].x;
- dy=c[1].y-c[0].y;
- cr=c[0];
- } else if (di < 0) {
- dx=c[count-1].x-c[count-2].x;
- dy=c[count-1].y-c[count-2].y;
- cr=c[count-1];
- } else {
- dx=c[1].x-c[0].x;
- dy=c[1].y-c[0].y;
- di=0;
- if (count % 2) {
- cr=c[count/2];
- } else {
- cr.x=(c[count/2-1].x+c[count/2].x)/2;
- cr.y=(c[count/2-1].y+c[count/2].y)/2;
- }
- }
- l=sqrtf(dx*dx+dy*dy);
- if (!l) {
- *ch=cr;
- return;
- }
- ch->x=cr.x+(di*dx+dlr*dy)/l;
- ch->y=cr.y+(di*dy-dlr*dx)/l;
-}
-
-static int
-street_lookup_housenumber(struct street_priv *street)
-{
- int i,count,scount,maxcount=16384;
- struct coord c[maxcount];
- struct street_name_numbers nns;
- unsigned char *p=street->name.aux_data;
- unsigned char *end=p+street->name.aux_len;
- unsigned char *pn,*pn_end;
-
- street->hn_count=0;
- street_coord_rewind(street);
- scount=street_coord_get(street, c, maxcount/2);
- if (scount >= maxcount/2) {
- dbg(0,"overflow");
- }
- for (i = 0 ; i < scount-1 ; i++) {
- c[scount+i].x=(c[i].x+c[i+1].x)/2;
- c[scount+i].y=(c[i].y+c[i+1].y)/2;
- }
- count=scount*2-1;
- while (p < end) {
- struct street_name_number nn;
- street_name_numbers_get(&nns, &p);
- pn=nns.aux_data;
- pn_end=nns.aux_data+nns.aux_len;
- while (pn < pn_end) {
- street_name_number_get(&nn, &pn);
- for (i = 0 ; i < count ; i++) {
- int dx=nn.c->x-c[i].x;
- int dy=nn.c->y-c[i].y;
- int dlr,dir;
- if (dx < 3 && dx > -3 && dy < 3 && dy > -3) {
- dir=15;
- dlr=15;
- switch (nn.tag & 0xf) {
- case 0xa:
- break;
- case 0xb:
- dlr=-dlr;
- dir=-dir;
- break;
- case 0xe:
- dlr=-dlr;
- break;
- case 0xf:
- dir=-dir;
- break;
- default:
- dbg(0,"unknown tag 0x%x\n",nn.tag);
-#if 0
- continue;
-#endif
- }
- if (street_str_get_type(street->str) & 0x40) {
- dir=-dir;
- dlr=-dlr;
- }
- if (nn.first.number == nn.last.number && !strcmp(nn.first.suffix, nn.last.suffix))
- dir=0;
- project(c, scount, dir, dlr, &street->hnc[street->hn_count]);
- street->hn[street->hn_count]=nn.first;
- street->hn_count++;
- dbg_assert(street->hn_count < 100);
- project(c, scount, -dir, dlr, &street->hnc[street->hn_count]);
- street->hn[street->hn_count]=nn.last;
- street->hn_count++;
- dbg_assert(street->hn_count < 100);
- dbg(1,"found %d%s %d%s\n",nn.first.number,nn.first.suffix,nn.last.number,nn.last.suffix);
- }
- }
- }
- }
- return 1;
-}
-
/*0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 */
static unsigned char limit[]={0,0,1,1,1,2,2,4,6,6,12,13,14,20,20,20,20,20,20};
@@ -867,37 +705,6 @@ street_search_compare(unsigned char **p, struct map_rect_priv *mr)
}
static void
-street_name_numbers_coord_rewind(void *priv_data)
-{
- /* struct street_priv *street=priv_data; */
-
-}
-
-static void
-street_name_numbers_attr_rewind(void *priv_data)
-{
- /* struct street_priv *street=priv_data; */
-
-}
-
-static int
-street_name_numbers_coord_get(void *priv_data, struct coord *c, int count)
-{
- return 0;
-}
-
-static int
-street_name_numbers_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
-{
- attr->type=attr_type;
- switch (attr_type) {
- default:
- dbg(0,"unknown item\n");
- return 0;
- }
-}
-
-static void
street_name_coord_rewind(void *priv_data)
{
/* struct street_priv *street=priv_data; */
@@ -1089,53 +896,6 @@ street_search_get_item_street_name(struct map_rect_priv *mr)
}
}
-static void
-district_debug(struct map_rect_priv *mr, int country, int dist)
-{
- struct map_rect_priv *mrt;
- struct item *item;
- struct attr attrn;
-
- mrt=map_rect_new_mg(mr->m, NULL);
- item=map_rect_get_item_byid_mg(mrt, country | (file_town_twn << 16), dist);
- dbg(0,"item=%p\n",item);
- if (item_attr_get(item, attr_town_postal, &attrn))
- dbg(0,"postal=%s\n",attrn.u.str);
- if (item_attr_get(item, attr_town_name, &attrn))
- dbg(0,"town_name=%s\n",attrn.u.str);
- if (item_attr_get(item, attr_district_name, &attrn))
- dbg(0,"district_name=%s\n",attrn.u.str);
- map_rect_destroy_mg(mrt);
-}
-
-static int
-street_name_numbers_get_next(struct map_rect_priv *mr, struct street_name *name, char *start, unsigned char **p, int mode, int *id, struct street_name_numbers *ret)
-{
- struct street_name_numbers tmp;
- unsigned char *ps,*pt;
- int found;
- while (*p < name->aux_data+name->aux_len) {
- ps=*p;
- street_name_numbers_get(ret, p);
- (*id)++;
- found=0;
- pt=name->aux_data;
- while (pt < ps) {
- street_name_numbers_get(&tmp, &pt);
- if (tmp.country == ret->country && tmp.dist == ret->dist) {
- found=1;
- break;
- }
- }
- if (!found) {
- dbg(0,"district 0x%x\n",ret->dist);
- district_debug(mr, ret->country, ret->dist);
- return 1;
- }
- }
- return 0;
-}
-
struct item *
street_search_get_item(struct map_rect_priv *mr)
{