Diff of /trunk/src/osm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 308 by harbaum, Fri Jul 24 12:51:17 2009 UTC revision 309 by harbaum, Sat Oct 17 18:55:03 2009 UTC
# Line 1702  way_chain_t *osm_node_delete(osm_t *osm, Line 1702  way_chain_t *osm_node_delete(osm_t *osm,
1702      way = way->next;      way = way->next;
1703    }    }
1704    
1705      /* remove that nodes map representations */
1706      if(node->map_item_chain)
1707        map_item_chain_destroy(&node->map_item_chain);
1708    
1709    if(!permanently) {    if(!permanently) {
1710      printf("mark node #" ITEM_ID_FORMAT " as deleted\n", OSM_ID(node));      printf("mark node #" ITEM_ID_FORMAT " as deleted\n", OSM_ID(node));
1711      OSM_FLAGS(node) |= OSM_FLAG_DELETED;      OSM_FLAGS(node) |= OSM_FLAG_DELETED;
# Line 2016  void osm_way_delete(osm_t *osm, icon_t * Line 2020  void osm_way_delete(osm_t *osm, icon_t *
2020    /* delete all nodes that aren't in other use now */    /* delete all nodes that aren't in other use now */
2021    node_chain_t **chain = &way->node_chain;    node_chain_t **chain = &way->node_chain;
2022    while(*chain) {    while(*chain) {
   
2023      (*chain)->node->ways--;      (*chain)->node->ways--;
2024      printf("checking node #" ITEM_ID_FORMAT " (still used by %d)\n",      printf("checking node #" ITEM_ID_FORMAT " (still used by %d)\n",
2025             OSM_ID((*chain)->node), (*chain)->node->ways);             OSM_ID((*chain)->node), (*chain)->node->ways);
# Line 2024  void osm_way_delete(osm_t *osm, icon_t * Line 2027  void osm_way_delete(osm_t *osm, icon_t *
2027      /* this node must only be part of this way */      /* this node must only be part of this way */
2028      if(!(*chain)->node->ways) {      if(!(*chain)->node->ways) {
2029        /* delete this node, but don't let this actually affect the */        /* delete this node, but don't let this actually affect the */
2030        /* associated ways as the only such way is the oen we are currently */        /* associated ways as the only such way is the one we are currently */
2031        /* deleting */        /* deleting */
2032        way_chain_t *way_chain =        way_chain_t *way_chain =
2033          osm_node_delete(osm, icon, (*chain)->node, FALSE, FALSE);          osm_node_delete(osm, icon, (*chain)->node, FALSE, FALSE);
# Line 2041  void osm_way_delete(osm_t *osm, icon_t * Line 2044  void osm_way_delete(osm_t *osm, icon_t *
2044      *chain = cur->next;      *chain = cur->next;
2045      g_free(cur);      g_free(cur);
2046    }    }
2047    
2048    way->node_chain = NULL;    way->node_chain = NULL;
2049    
2050    if(!permanently) {    if(!permanently) {

Legend:
Removed from v.308  
changed lines
  Added in v.309