solstice-solver

Solver library of the solstice app
git clone git://git.meso-star.com/solstice-solver.git
Log | Files | Refs | README | LICENSE

commit 80b7d802780e70f270fe676796b22dfd7924afa6
parent 19d773cf0f86521579c5ce37a86ae6b9f9fa7b94
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Tue,  4 Oct 2016 15:11:04 +0200

BugFix: cannot call setpos/getpos on stdout/stderr/stdin

Diffstat:
Msrc/ssol_solver.c | 12++----------
1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/ssol_solver.c b/src/ssol_solver.c @@ -769,9 +769,6 @@ ssol_solve if (res != RES_OK) goto error; for (r = 0; r < realisations_count; ) { - fpos_t real_start; - int err_count = 0; - CHECK(fgetpos(output, &real_start), 0); do { reset_realisation(r, &rs); sample_starting_point(&rs); @@ -798,17 +795,12 @@ ssol_solve /* must retry failed realisations */ if (rs.end == TERM_ERR) { - CHECK(fsetpos(output, &real_start), 0); - if (++err_count > 10) { - log_error(scene->dev, "%s: too many failures.\n", FUNC_NAME); - goto error; - } + log_error(scene->dev, "%s: realisation failure.\n", FUNC_NAME); + goto error; } else r++; } while (rs.end == TERM_ERR); } - /* TODO: overwrite trailing chars if canceled realizations wrote past the - * current fpos */ exit: release_realisation(&rs);