Diff of /trunk/src/diff.c

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

revision 156 by harbaum, Wed Apr 1 12:47:35 2009 UTC revision 161 by harbaum, Sat Apr 11 11:28:56 2009 UTC
# Line 47  static void diff_save_state_n_id(int fla Line 47  static void diff_save_state_n_id(int fla
47      xmlNewProp(node, BAD_CAST "state", BAD_CAST "new");      xmlNewProp(node, BAD_CAST "state", BAD_CAST "new");
48    
49    /* all items need an id */    /* all items need an id */
50    char *id_str = g_strdup_printf("%ld", id);    char *id_str = g_strdup_printf(ITEM_ID_FORMAT, id);
51    xmlNewProp(node, BAD_CAST "id", BAD_CAST id_str);    xmlNewProp(node, BAD_CAST "id", BAD_CAST id_str);
52    g_free(id_str);    g_free(id_str);
53  }  }
# Line 69  static void diff_save_nodes(node_t *node Line 69  static void diff_save_nodes(node_t *node
69          xmlNewProp(node_node, BAD_CAST "lat", BAD_CAST str);          xmlNewProp(node_node, BAD_CAST "lat", BAD_CAST str);
70          g_ascii_formatd(str, sizeof(str), LL_FORMAT, node->pos.lon);          g_ascii_formatd(str, sizeof(str), LL_FORMAT, node->pos.lon);
71          xmlNewProp(node_node, BAD_CAST "lon", BAD_CAST str);          xmlNewProp(node_node, BAD_CAST "lon", BAD_CAST str);
72          snprintf(str, sizeof(str), "%ld", node->time);          snprintf(str, sizeof(str), "%lu", node->time);
73          xmlNewProp(node_node, BAD_CAST "time", BAD_CAST str);          xmlNewProp(node_node, BAD_CAST "time", BAD_CAST str);
74    
75          diff_save_tags(node->tag, node_node);          diff_save_tags(node->tag, node_node);
# Line 101  static void diff_save_ways(way_t *way, x Line 101  static void diff_save_ways(way_t *way, x
101          while(node_chain) {          while(node_chain) {
102            xmlNodePtr node_node = xmlNewChild(node_way, NULL,            xmlNodePtr node_node = xmlNewChild(node_way, NULL,
103                                               BAD_CAST "nd", NULL);                                               BAD_CAST "nd", NULL);
104            char *id = g_strdup_printf("%ld", node_chain->node->id);            char *id = g_strdup_printf(ITEM_ID_FORMAT, node_chain->node->id);
105            xmlNewProp(node_node, BAD_CAST "ref", BAD_CAST id);            xmlNewProp(node_node, BAD_CAST "ref", BAD_CAST id);
106            g_free(id);            g_free(id);
107            node_chain = node_chain->next;            node_chain = node_chain->next;
# Line 135  static void diff_save_relations(relation Line 135  static void diff_save_relations(relation
135            switch(member->object.type) {            switch(member->object.type) {
136            case NODE:            case NODE:
137              xmlNewProp(node_member, BAD_CAST "type", BAD_CAST "node");              xmlNewProp(node_member, BAD_CAST "type", BAD_CAST "node");
138              ref = g_strdup_printf("%ld", member->object.node->id);              ref = g_strdup_printf(ITEM_ID_FORMAT, member->object.node->id);
139              break;              break;
140            case WAY:            case WAY:
141              xmlNewProp(node_member, BAD_CAST "type", BAD_CAST "way");              xmlNewProp(node_member, BAD_CAST "type", BAD_CAST "way");
142              ref = g_strdup_printf("%ld", member->object.way->id);              ref = g_strdup_printf(ITEM_ID_FORMAT, member->object.way->id);
143              break;              break;
144            case RELATION:            case RELATION:
145              xmlNewProp(node_member, BAD_CAST "type", BAD_CAST "relation");              xmlNewProp(node_member, BAD_CAST "type", BAD_CAST "relation");
146              ref = g_strdup_printf("%ld", member->object.relation->id);              ref = g_strdup_printf(ITEM_ID_FORMAT, member->object.relation->id);
147              break;              break;
148    
149              /* XXX_ID's are used if this is a reference to an item not */              /* XXX_ID's are used if this is a reference to an item not */
150              /* stored in this xml data set */              /* stored in this xml data set */
151            case NODE_ID:            case NODE_ID:
152              xmlNewProp(node_member, BAD_CAST "type", BAD_CAST "node");              xmlNewProp(node_member, BAD_CAST "type", BAD_CAST "node");
153              ref = g_strdup_printf("%ld", member->object.id);              ref = g_strdup_printf(ITEM_ID_FORMAT, member->object.id);
154              break;              break;
155            case WAY_ID:            case WAY_ID:
156              xmlNewProp(node_member, BAD_CAST "type", BAD_CAST "way");              xmlNewProp(node_member, BAD_CAST "type", BAD_CAST "way");
157              ref = g_strdup_printf("%ld", member->object.id);              ref = g_strdup_printf(ITEM_ID_FORMAT, member->object.id);
158              break;              break;
159            case RELATION_ID:            case RELATION_ID:
160              xmlNewProp(node_member, BAD_CAST "type", BAD_CAST "relation");              xmlNewProp(node_member, BAD_CAST "type", BAD_CAST "relation");
161              ref = g_strdup_printf("%ld", member->object.id);              ref = g_strdup_printf(ITEM_ID_FORMAT, member->object.id);
162              break;              break;
163    
164            default:            default:

Legend:
Removed from v.156  
changed lines
  Added in v.161