Diff of /trunk/src/gpx.c

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

revision 73 by harbaum, Wed Jul 29 19:24:15 2009 UTC revision 74 by harbaum, Mon Aug 24 09:23:36 2009 UTC
# Line 463  static log_t *process_gpx_wpt_gc_logs_lo Line 463  static log_t *process_gpx_wpt_gc_logs_lo
463      ret = xmlTextReaderRead(reader);      ret = xmlTextReaderRead(reader);
464    }    }
465    
466    g_assert(0);    gpx_free_log(log);
467    return log;    return NULL;
468  }  }
469    
470  static log_t *process_gpx_wpt_gc_logs(xmlTextReaderPtr reader) {  static log_t *process_gpx_wpt_gc_logs(xmlTextReaderPtr reader) {
# Line 513  static log_t *process_gpx_wpt_gc_logs(xm Line 513  static log_t *process_gpx_wpt_gc_logs(xm
513      ret = xmlTextReaderRead(reader);      ret = xmlTextReaderRead(reader);
514    }    }
515    
516    g_assert(0);    /* free the entire log chain */
517    return log_chain;    while(log_chain) {
518        log_t *next = log_chain->next;
519        gpx_free_log(log_chain);
520        log_chain = next;
521      }
522    
523      return NULL;
524  }  }
525    
526  static tb_t *process_gpx_wpt_gc_tbs_travelbug(xmlTextReaderPtr reader) {  static tb_t *process_gpx_wpt_gc_tbs_travelbug(xmlTextReaderPtr reader) {
# Line 563  static tb_t *process_gpx_wpt_gc_tbs_trav Line 569  static tb_t *process_gpx_wpt_gc_tbs_trav
569      ret = xmlTextReaderRead(reader);      ret = xmlTextReaderRead(reader);
570    }    }
571    
572    g_assert(0);    gpx_free_tb(tb);
573    return tb;    return NULL;
574  }  }
575    
576  static tb_t *process_gpx_wpt_gc_tbs(xmlTextReaderPtr reader) {  static tb_t *process_gpx_wpt_gc_tbs(xmlTextReaderPtr reader) {
# Line 605  static tb_t *process_gpx_wpt_gc_tbs(xmlT Line 611  static tb_t *process_gpx_wpt_gc_tbs(xmlT
611      ret = xmlTextReaderRead(reader);      ret = xmlTextReaderRead(reader);
612    }    }
613    
614    g_assert(0);    while(tb) {
615    return tb;      tb_t *next = tb;
616        gpx_free_tb(tb);
617        tb = next;
618      }
619    
620      return NULL;
621  }  }
622    
623  static void process_gpx_wpt_gc(xmlTextReaderPtr reader, cache_t *cache) {  static void process_gpx_wpt_gc(xmlTextReaderPtr reader, cache_t *cache) {
# Line 831  static cache_t *process_gpx_wpt(xmlTextR Line 842  static cache_t *process_gpx_wpt(xmlTextR
842      ret = xmlTextReaderRead(reader);      ret = xmlTextReaderRead(reader);
843    }    }
844    
845    g_assert(0);    gpx_free_cache(cache);
846    return cache;    return NULL;
847  }  }
848    
849  static void process_gpx(xmlTextReaderPtr reader, gpx_dialog_t *dialog,  static gboolean process_gpx(xmlTextReaderPtr reader, gpx_dialog_t *dialog,
850                          gpx_t *gpx) {                              gpx_t *gpx) {
851    
852    /* no attributes of interest */    /* no attributes of interest */
853    
# Line 847  static void process_gpx(xmlTextReaderPtr Line 858  static void process_gpx(xmlTextReaderPtr
858    while(*cache) cache = &(*cache)->next;    while(*cache) cache = &(*cache)->next;
859    
860    const xmlChar *name = xmlTextReaderConstName(reader);    const xmlChar *name = xmlTextReaderConstName(reader);
861    g_assert(name);    if(!name) return FALSE;
862    
863    /* read next node */    /* read next node */
864    int ret = xmlTextReaderRead(reader);    int ret = xmlTextReaderRead(reader);
# Line 877  static void process_gpx(xmlTextReaderPtr Line 888  static void process_gpx(xmlTextReaderPtr
888      case XML_READER_TYPE_END_ELEMENT:      case XML_READER_TYPE_END_ELEMENT:
889        /* end element must be for the current element */        /* end element must be for the current element */
890        g_assert(xmlTextReaderDepth(reader) == 0);        g_assert(xmlTextReaderDepth(reader) == 0);
891        return;        return TRUE;
892        break;        break;
893    
894      default:      default:
# Line 886  static void process_gpx(xmlTextReaderPtr Line 897  static void process_gpx(xmlTextReaderPtr
897      ret = xmlTextReaderRead(reader);      ret = xmlTextReaderRead(reader);
898    }    }
899    
900    g_assert(0);    return FALSE;
901  }  }
902    
903  /* parse loc waypoint entry */  /* parse loc waypoint entry */

Legend:
Removed from v.73  
changed lines
  Added in v.74