mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
DLF: Restructure loop into a for loop
We always step forward 16 bytes, so make it a for loop so a continue won't throw us into a eternal loop. Signed-off-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
parent
98e869d4f1
commit
366ad82a98
1 changed files with 1 additions and 2 deletions
|
@ -3549,7 +3549,7 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size)
|
||||||
if (cur_dc->divemode == CCR || cur_dc->divemode == PSCR)
|
if (cur_dc->divemode == CCR || cur_dc->divemode == PSCR)
|
||||||
cur_dc->no_o2sensors = 1;
|
cur_dc->no_o2sensors = 1;
|
||||||
|
|
||||||
while (ptr < buffer + size) {
|
for (; ptr < buffer + size; ptr += 16) {
|
||||||
time = ((ptr[0] >> 4) & 0x0f) +
|
time = ((ptr[0] >> 4) & 0x0f) +
|
||||||
((ptr[1] << 4) & 0xff0) +
|
((ptr[1] << 4) & 0xff0) +
|
||||||
((ptr[2] << 12) & 0x1f000);
|
((ptr[2] << 12) & 0x1f000);
|
||||||
|
@ -3778,7 +3778,6 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size)
|
||||||
/* Unknown... */
|
/* Unknown... */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ptr += 16;
|
|
||||||
}
|
}
|
||||||
divecomputer_end();
|
divecomputer_end();
|
||||||
dive_end();
|
dive_end();
|
||||||
|
|
Loading…
Add table
Reference in a new issue