Cleanup: Fix new Findings in Coverity Scan.

Fix some findings in a Coverity scan in `core/planner.cpp` and
`core/profile.cpp`, that were reported as new after the changes
in #4126 (likely because of the rename from .c to .cpp).
Results: https://scan4.scan.coverity.com/#/project-view/60459/13160

Signed-off-by: Michael Keller <mikeller@042.ch>
This commit is contained in:
Michael Keller 2024-04-24 12:24:40 +12:00 committed by Robert C. Helling
parent e7a6de3894
commit 9deef235e2
2 changed files with 4 additions and 8 deletions

View file

@ -749,7 +749,7 @@ static void add_plot_pressure(struct plot_info *pi, int time, int cyl, pressure_
static void setup_gas_sensor_pressure(const struct dive *dive, const struct divecomputer *dc, struct plot_info *pi)
{
int prev, i;
int i;
const struct event *ev;
if (pi->nr_cylinders == 0)
@ -762,7 +762,7 @@ static void setup_gas_sensor_pressure(const struct dive *dive, const struct dive
std::vector<int> last(num_cyl, INT_MAX);
const struct divecomputer *secondary;
prev = explicit_first_cylinder(dive, dc);
unsigned prev = (unsigned)explicit_first_cylinder(dive, dc);
seen[prev] = 1;
for (ev = get_next_event(dc->events, "gaschange"); ev != NULL; ev = get_next_event(ev->next, "gaschange")) {