diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2017-11-27 14:40:51 +0100 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-27 22:40:16 +0100 |
commit | b17f1e2d302fda64c742042f2eb4765063d4c5f1 (patch) | |
tree | f99546fbefc37623488e4989e286198b477490f6 | |
parent | 276fd441b5012864845ee86720bd7d42ff1fcfdf (diff) | |
download | subsurface-b17f1e2d302fda64c742042f2eb4765063d4c5f1.tar.gz |
Use MAX_SENSORS define everywhere
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
-rw-r--r-- | core/dive.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/dive.c b/core/dive.c index 07d47de6f..5255b655f 100644 --- a/core/dive.c +++ b/core/dive.c @@ -750,8 +750,8 @@ struct sample *prepare_sample(struct divecomputer *dc) // Copy the sensor numbers - but not the pressure values // from the previous sample if any. if (nr) { - sample->sensor[0] = sample[-1].sensor[0]; - sample->sensor[1] = sample[-1].sensor[1]; + for (int idx = 0; idx < MAX_SENSORS; idx++) + sample->sensor[idx] = sample[-1].sensor[idx]; } // Init some values with -1 sample->bearing.degrees = -1; @@ -1477,7 +1477,7 @@ static void simplify_dc_pressures(struct divecomputer *dc) int j; struct sample *sample = dc->sample + i; - for (j = 0; j < 2; j++) { + for (j = 0; j < MAX_SENSORS; j++) { int pressure = sample->pressure[j].mbar; int index = sample->sensor[j]; @@ -2075,7 +2075,7 @@ static void dc_cylinder_renumber(struct dive *dive, struct divecomputer *dc, int struct sample *s = dc->sample + i; int j; - for (j = 0; j < 2; j++) { + for (j = 0; j < MAX_SENSORS; j++) { int sensor; sensor = mapping[s->sensor[j]]; |