Ticket #1274: 0411.diff
File 0411.diff, 6.6 KB (added by jandegr, 8 years ago) |
---|
-
navit/navit/navigation.c
48 48 49 49 50 50 struct suffix { 51 enum gender {unknown, male, female, neutral}; 51 52 char *fullname; 52 53 char *abbrev; 53 54 int sex; 54 55 } suffixes[]= { 55 {"weg",NULL,1}, 56 {"platz","pl.",1}, 57 {"ring",NULL,1}, 58 {"allee",NULL,2}, 59 {"gasse",NULL,2}, 60 {"straÃe","str.",2}, 61 {"strasse",NULL,2}, 56 {"weg",NULL,male}, 57 {"platz","pl.",male}, 58 {"ring",NULL,male}, 59 {"allee",NULL,female}, 60 {"gasse",NULL,female}, 61 {"straÃe","str.",female}, 62 63 /* some for the dutch lang. */ 64 {"straat",NULL,neutral}, 65 {"weg",NULL,neutral}, 66 {"baan",NULL,neutral}, 67 {"laan",NULL,neutral}, 68 {"wegel",NULL,neutral}, 69 70 /* some for the french lang. */ 71 {"boulevard",NULL,male}, 72 {"avenue",NULL,female}, 73 {"chemin",NULL,neutral}, 74 {"rue",NULL,female}, 62 75 }; 63 76 64 77 struct navigation { … … 323 336 switch (n) { 324 337 case 0: 325 338 /* TRANSLATORS: the following counts refer to streets */ 326 return _("zeroth"); / / Not sure if this exists, neither if it will ever be needed339 return _("zeroth"); /* Not sure if this exists, neither if it will ever be needed */ 327 340 case 1: 328 341 return _("first"); 329 342 case 2: … … 347 360 switch (n) { 348 361 case 0: 349 362 /* TRANSLATORS: the following counts refer to roundabout exits */ 350 return _("zeroth exit"); / / Not sure if this exists, neither if it will ever be needed363 return _("zeroth exit"); /* Not sure if this exists, neither if it will ever be needed */ 351 364 case 1: 352 365 return _("first exit"); 353 366 case 2: … … 514 527 calculate_angle(struct navigation_way *w) 515 528 { 516 529 struct coord cbuf[2]; 517 struct item *ritem; / / the "real" item530 struct item *ritem; /* the "real" item */ 518 531 struct coord c; 519 532 struct map_rect *mr; 520 533 struct attr attr; … … 645 658 navigation_itm_ways_update(struct navigation_itm *itm, struct map *graph_map) 646 659 { 647 660 struct map_selection coord_sel; 648 struct map_rect *g_rect; / / Contains a map rectangle from the route graph's map661 struct map_rect *g_rect; /* Contains a map rectangle from the route graph's map */ 649 662 struct item *i,*sitem; 650 663 struct attr sitem_attr,direction_attr; 651 664 struct navigation_way *w,*l; … … 652 665 653 666 navigation_itm_ways_clear(itm); 654 667 655 / / These values cause the code in route.c to get us only the route graph point and connected segments668 /* These values cause the code in route.c to get us only the route graph point and connected segments */ 656 669 coord_sel.next = NULL; 657 670 coord_sel.u.c_rect.lu = itm->start; 658 671 coord_sel.u.c_rect.rl = itm->start; 659 / / the selection's order is ignored672 /* the selection's order is ignored */ 660 673 661 674 g_rect = map_rect_new(graph_map, &coord_sel); 662 675 663 676 i = map_rect_get_item(g_rect); 664 if (!i || i->type != type_rg_point) { / / probably offroad?677 if (!i || i->type != type_rg_point) { /* probably offroad? */ 665 678 map_rect_destroy(g_rect); 666 679 return ; 667 680 } … … 778 791 check_roundabout(struct navigation_itm *itm, struct map *graph_map) 779 792 { 780 793 struct map_selection coord_sel; 781 struct map_rect *g_rect; / / Contains a map rectangle from the route graph's map794 struct map_rect *g_rect; /* Contains a map rectangle from the route graph's map */ 782 795 struct item *i,*sitem; 783 796 struct attr sitem_attr,flags_attr; 784 797 785 / / These values cause the code in route.c to get us only the route graph point and connected segments798 /* These values cause the code in route.c to get us only the route graph point and connected segments */ 786 799 coord_sel.next = NULL; 787 800 coord_sel.u.c_rect.lu = itm->start; 788 801 coord_sel.u.c_rect.rl = itm->start; 789 / / the selection's order is ignored802 /* the selection's order is ignored */ 790 803 791 804 g_rect = map_rect_new(graph_map, &coord_sel); 792 805 793 806 i = map_rect_get_item(g_rect); 794 if (!i || i->type != type_rg_point) { / / probably offroad?807 if (!i || i->type != type_rg_point) { /* probably offroad? */ 795 808 map_rect_destroy(g_rect); 796 809 return 0; 797 810 } … … 952 965 curr = curr->next; 953 966 } 954 967 955 if (!curr) { / / from does not lead to to?968 if (!curr) { /* from does not lead to to? */ 956 969 return -1; 957 970 } 958 971 … … 1271 1284 struct navigation_way *cur_itm = &(new->way); 1272 1285 while (cur_itm) { 1273 1286 if (maneuver_category(cur_itm->item.type) == cat) { 1274 / / TODO: decide if a maneuver_category difference of 1 is still similar1287 /* TODO: decide if a maneuver_category difference of 1 is still similar */ 1275 1288 num_similar++; 1276 1289 } 1277 1290 cur_itm = cur_itm->next; … … 1552 1565 if(next->way.item.type == type_ramp) 1553 1566 return NULL; 1554 1567 if(itm->way.item.type == type_highway_city || itm->way.item.type == type_highway_land ) 1555 return g_strdup_printf("%s%s",prefix,_("exit")); /* %FIXME Can this even be reached? */ 1568 return g_strdup_printf("%s%s",prefix,_("exit")); /* %FIXME Can this even be reached? 1569 Answer : no, and so Navit can not differentiate between a ramp and an exit*/ 1556 1570 else 1557 1571 return g_strdup_printf("%s%s",prefix,_("into the ramp")); 1558 1572 … … 1560 1574 if (!n1 && !n2) 1561 1575 return NULL; 1562 1576 if (n1) { 1563 sex= -1;1577 sex=unknown; 1564 1578 name1=NULL; 1565 1579 for (i = 0 ; i < sizeof(suffixes)/sizeof(suffixes[0]) ; i++) { 1566 1580 if (contains_suffix(n1,suffixes[i].fullname)) { … … 1582 1596 sep=""; 1583 1597 } 1584 1598 switch (sex) { 1585 case -1:1599 case unknown: 1586 1600 /* TRANSLATORS: Arguments: 1: Prefix (Space if required) 2: Street Name 3: Separator (Space if required), 4: Systematic Street Name */ 1587 1601 ret=g_strdup_printf(_("%sinto the street %s%s%s"),prefix,n1, sep, name2); 1588 1602 break; 1589 case 1:1603 case male: 1590 1604 /* TRANSLATORS: Arguments: 1: Prefix (Space if required) 2: Street Name 3: Separator (Space if required), 4: Systematic Street Name. Male form. The stuff after | doesn't have to be included */ 1591 1605 ret=g_strdup_printf(_("%sinto the %s%s%s|male form"),prefix,name1, sep, name2); 1592 1606 break; 1593 case 2:1607 case female: 1594 1608 /* TRANSLATORS: Arguments: 1: Prefix (Space if required) 2: Street Name 3: Separator (Space if required), 4: Systematic Street Name. Female form. The stuff after | doesn't have to be included */ 1595 1609 ret=g_strdup_printf(_("%sinto the %s%s%s|female form"),prefix,name1, sep, name2); 1596 1610 break; 1597 case 3:1611 case neutral: 1598 1612 /* TRANSLATORS: Arguments: 1: Prefix (Space if required) 2: Street Name 3: Separator (Space if required), 4: Systematic Street Name. Neutral form. The stuff after | doesn't have to be included */ 1599 1613 ret=g_strdup_printf(_("%sinto the %s%s%s|neutral form"),prefix,name1, sep, name2); 1600 1614 break; … … 1636 1650 struct navigation_way *w; 1637 1651 1638 1652 if (connect) { 1639 level = -2; / / level = -2 means "connect to another maneuver via 'then ...'"1653 level = -2; /* level = -2 means "connect to another maneuver via 'then ...'" */ 1640 1654 } else { 1641 1655 level=1; 1642 1656 }