mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Migrate code to for_each_dive and for_each_dc
[Dirk Hohndel: this overlapped with my commit 09e7c61fee
("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>
This commit is contained in:
parent
91c20357f5
commit
05d9cc409c
6 changed files with 9 additions and 21 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue