diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-05-14 00:32:45 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-20 11:51:40 +0900 |
commit | 05d9cc409c7ddffcd981c0dafaf67ba6935cc0ba (patch) | |
tree | 99fd8e916a1aedcee8bcfa224cc51597515f3837 /uemis-downloader.c | |
parent | 91c20357f510fe7ea1c5740eb476fd718e41259c (diff) | |
download | subsurface-05d9cc409c7ddffcd981c0dafaf67ba6935cc0ba.tar.gz |
Migrate code to for_each_dive and for_each_dc
[Dirk Hohndel: this overlapped with my commit 09e7c61feeea ("Consistently
use for_each_dive (and use it correctly)") so I took the
pieces that I had missed]
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r-- | uemis-downloader.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c index 797704c66..5d8b07c01 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -795,13 +795,12 @@ static char *uemis_get_divenr(char *deviceidstr) deviceid = atoi(deviceidstr); struct dive *d; for_each_dive (i, d) { - struct divecomputer *dc = &d->dc; - while (dc) { + struct divecomputer *dc; + for_each_dc(d, dc) { if (dc->model && !strcmp(dc->model, "Uemis Zurich") && (dc->deviceid == 0 || dc->deviceid == 0x7fffffff || dc->deviceid == deviceid) && dc->diveid > maxdiveid) maxdiveid = dc->diveid; - dc = dc->next; } } snprintf(divenr, 10, "%d", maxdiveid); |