Use proper helper functions for dive location and for_each_dive

This makes the code use the "dive_has_location()" function rather than
check the longitude and latitude directly.

It also uses "for_each_dive()" rather than open-coding it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2013-01-22 21:26:53 -08:00 committed by Dirk Hohndel
parent 1f3024152c
commit e618a245b9
2 changed files with 4 additions and 5 deletions

5
gps.c
View file

@ -139,9 +139,8 @@ void show_gps_locations()
if (!window || !map)
map = init_map();
for (idx = 0; idx < dive_table.nr; idx++) {
dp = dive_table.dives[idx];
if (dp->latitude.udeg != 0 || dp->longitude.udeg != 0){
for_each_dive(idx, dp) {
if (dive_has_location(dp)) {
add_gps_point(map, dp->latitude.udeg / 1000000.0,
dp->longitude.udeg / 1000000.0);
}