solstice

Compute collected power and efficiencies of a solar plant
git clone git://git.meso-star.com/solstice.git
Log | Files | Refs | README | LICENSE

commit d3c18e40f0b02fbcae11b858531e3b1ca3961178
parent 0c22f58629919ceb573e6f99624e9729fa0bc3d5
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Mon, 16 Jan 2017 11:56:33 +0100

Fix parsing of cylinders: force height and radius to be > 0

Diffstat:
Msrc/parser/solparser.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/parser/solparser.c b/src/parser/solparser.c @@ -1396,10 +1396,10 @@ parse_cylinder } (void)0 if(!strcmp((char*)key->data.scalar.value, "height")) { SETUP_MASK(HEIGHT, "height"); - res = parse_real(parser, val, 0, DBL_MAX, &shape->height); + res = parse_real(parser, val, nextafter(0, 1), DBL_MAX, &shape->height); } else if(!strcmp((char*)key->data.scalar.value, "radius")) { SETUP_MASK(RADIUS, "radius"); - res = parse_real(parser, val, 0, DBL_MAX, &shape->radius); + res = parse_real(parser, val, nextafter(0, 1), DBL_MAX, &shape->radius); } else if(!strcmp((char*)key->data.scalar.value, "slices")) { SETUP_MASK(SLICES, "slices"); res = parse_integer(parser, val, 4, 4096, &shape->nslices);