Skip to content

Commit

Permalink
simwe: fix newly reported coverity scan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa committed Feb 12, 2025
1 parent b624fc2 commit 9f44e55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion raster/r.sim/r.sim.water/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ int main(int argc, char *argv[])
* to real timesec in seconds */
settings.timesec = settings.timesec * 60.0;
settings.iterout = settings.iterout * 60.0;
if ((settings.timesec / settings.iterout) > 100.0 && settings.ts)
if ((settings.timesec / (double)settings.iterout) > 100.0 && settings.ts)
G_message(_("More than 100 files are going to be created !!!!!"));

/* compute how big the raster is and set this to appr 2 walkers per cell */
Expand Down
5 changes: 3 additions & 2 deletions raster/r.sim/simlib/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,9 @@ int grad_check(Setup *setup, const Geometry *geometry, const Settings *settings)

if (wdepth)
deltaw = 0.8 / (sigmax * vmax); /*time step for sediment */
setup->deltap = 0.25 * sqrt(geometry->stepx * geometry->stepy) /
setup->vmean; /*time step for water */
setup->deltap =
0.25 * sqrt(geometry->stepx * geometry->stepy) /
(setup->vmean > EPS ? setup->vmean : EPS); /*time step for water */

if (setup->deltap < settings->mintimestep)
setup->deltap = settings->mintimestep;
Expand Down

0 comments on commit 9f44e55

Please sign in to comment.