mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Consistently use for_each_dive (and use it correctly)
The way the macro is written there is no need to test the dive against NULL before dereferencing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b303f217a9
commit
09e7c61fee
5 changed files with 17 additions and 25 deletions
|
|
@ -793,8 +793,9 @@ static char *uemis_get_divenr(char *deviceidstr)
|
|||
char divenr[10];
|
||||
|
||||
deviceid = atoi(deviceidstr);
|
||||
for (i = 0; i < dive_table.nr; i++) {
|
||||
struct divecomputer *dc = &dive_table.dives[i]->dc;
|
||||
struct dive *d;
|
||||
for_each_dive (i, d) {
|
||||
struct divecomputer *dc = &d->dc;
|
||||
while (dc) {
|
||||
if (dc->model && !strcmp(dc->model, "Uemis Zurich") &&
|
||||
(dc->deviceid == 0 || dc->deviceid == 0x7fffffff || dc->deviceid == deviceid) &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue