From: robertlipe Date: Fri, 12 Jul 2013 21:43:31 +0000 (+0000) Subject: Speed GPX writer by 19% by removing implicit time_t conversion in a test X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~535 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c1c00e44dbc85f86c3c725602ed69183152b38d5;p=gpsbabel.git Speed GPX writer by 19% by removing implicit time_t conversion in a test that I'm not convinced matters anyway. ('exported' seems really weird.) --- diff --git a/gpsbabel/gpx.cc b/gpsbabel/gpx.cc index dcc878e19..68d38813a 100644 --- a/gpsbabel/gpx.cc +++ b/gpsbabel/gpx.cc @@ -1441,7 +1441,7 @@ fprint_xml_chain(xml_tag* tag, const waypoint* wpt) if (tag->child) { fprint_xml_chain(tag->child, wpt); } - if (wpt && wpt->gc_data->exported && + if (wpt && wpt->gc_data->exported.isValid() && strcmp(tag->tagname, "groundspeak:cache") == 0) { writer.writeTextElement("time", wpt->gc_data->exported.toPrettyString()); diff --git a/gpsbabel/tpo.cc b/gpsbabel/tpo.cc index a3638f0bf..e5f366cb2 100644 --- a/gpsbabel/tpo.cc +++ b/gpsbabel/tpo.cc @@ -556,7 +556,8 @@ void tpo_process_tracks(void) } char style_name[track_style_count][TRACKNAMELENGTH]; // some huge value int style_color[track_style_count][3]; // keep R/G/B values separate because line_color needs BGR - int style_wide[track_style_count],style_dash[track_style_count]; + int style_wide[track_style_count]; + int *style_dash = (int*) xcalloc(sizeof(int), track_style_count); for (ii = 0; ii < track_style_count; ii++) { // clumsy way to skip two undefined bytes