X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/7114e87955b0a009e3fcc406dbe97c88e67eaf8a..87819e206fb0d9f10a5656c459d20a6d668d620e:/src/vikcoord.c diff --git a/src/vikcoord.c b/src/vikcoord.c index a4bbeadd..c61f30ec 100644 --- a/src/vikcoord.c +++ b/src/vikcoord.c @@ -27,7 +27,7 @@ void vik_coord_convert(VikCoord *coord, VikCoordMode dest_mode) { - static VikCoord tmp; + VikCoord tmp; if ( coord->mode != dest_mode ) { if ( dest_mode == VIK_COORD_LATLON ) { @@ -56,7 +56,7 @@ void vik_coord_copy_convert(const VikCoord *coord, VikCoordMode dest_mode, VikCo static gdouble vik_coord_diff_safe(const VikCoord *c1, const VikCoord *c2) { - static struct LatLon a, b; + struct LatLon a, b; vik_coord_to_latlon ( c1, &a ); vik_coord_to_latlon ( c2, &b ); return a_coords_latlon_diff ( &a, &b ); @@ -152,9 +152,9 @@ void vik_coord_set_area(const VikCoord *coord, const struct LatLon *wh, VikCoord get_north_west(¢er, &dist, &nw); get_south_east(¢er, &dist, &se); - tl->mode = br->mode = VIK_COORD_LATLON; *((struct LatLon *)tl) = nw; *((struct LatLon *)br) = se; + tl->mode = br->mode = VIK_COORD_LATLON; } gboolean vik_coord_inside(const VikCoord *coord, const VikCoord *tl, const VikCoord *br) @@ -165,11 +165,6 @@ gboolean vik_coord_inside(const VikCoord *coord, const VikCoord *tl, const VikCo vik_coord_to_latlon(tl, &tl_ll); vik_coord_to_latlon(br, &br_ll); -#ifdef DEBUG - fprintf(stderr, "DEBUG: %s() ll=%f, %f tl=%f, %f br=%f, %f\n", - __PRETTY_FUNCTION__, ll.lat, ll.lon, tl_ll.lat, tl_ll.lon, br_ll.lat, br_ll.lon); -#endif - if ((ll.lat > tl_ll.lat) || (ll.lon < tl_ll.lon)) return FALSE; if ((ll.lat < br_ll.lat) || (ll.lon > br_ll.lon))