solstice-solver

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

commit 53085177741aa10c55321d539e08c87146e5b96e
parent d3fc730779557a342664419602b7b50ef5d3e7d3
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 10 Oct 2016 16:28:17 +0200

Fix GCC warnings

Diffstat:
Msrc/ssol_shape.c | 4++--
Msrc/test_ssol_solver1.c | 2+-
Msrc/test_ssol_solver2b.c | 3++-
Msrc/test_ssol_solver3.c | 3++-
Msrc/test_ssol_solver4.c | 31++++++++++++++++---------------
5 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/src/ssol_shape.c b/src/ssol_shape.c @@ -89,8 +89,8 @@ check_carving(const struct ssol_carving* polygon) { if(!polygon || !polygon->get || polygon->nb_vertices <= 0) return RES_BAD_ARG; - /* we don't check that the polygon defines a not empty area - * in such case, the quadric is valid but can have zero surface */ + /* we don't check that the polygon defines a not empty area in such case, the + * quadric is valid but can have zero surface */ return RES_OK; } diff --git a/src/test_ssol_solver1.c b/src/test_ssol_solver1.c @@ -212,7 +212,7 @@ main(int argc, char** argv) #define DNI_cos (1000 * COS) CHECK(eq_eps(m, 4 * DNI_cos, MMAX(4 * DNI_cos * 1e-2, std)), 1); #define SQR(x) ((x)*(x)) - dbl = sqrt((SQR(12 * DNI_cos) / 3 - SQR(4 * DNI_cos)) / count); + dbl = sqrt((SQR(12 * DNI_cos) / 3 - SQR(4 * DNI_cos)) / (double)count); CHECK(eq_eps(std, dbl, dbl*1e-2), 1); /* target was sampled but shadowed by secondary */ CHECK(ssol_estimator_get_status(estimator, STATUS_SHADOW, &status), RES_OK); diff --git a/src/test_ssol_solver2b.c b/src/test_ssol_solver2b.c @@ -198,7 +198,8 @@ main(int argc, char** argv) #define DNI_cos (1000 * cos(PI / 4)) CHECK(eq_eps(m, 2 * DNI_cos, MMAX(2 * DNI_cos * 1e-2, std)), 1); #define SQR(x) ((x)*(x)) - CHECK(eq_eps(std, sqrt((SQR(4 * DNI_cos) / 2 - SQR(2 * DNI_cos)) / count), 1e-3), 1); + CHECK(eq_eps(std, + sqrt((SQR(4 * DNI_cos) / 2 - SQR(2 * DNI_cos)) / (double)count), 1e-3), 1); CHECK(ssol_estimator_get_status(estimator, STATUS_SHADOW, &status), RES_OK); logger_print(&logger, LOG_OUTPUT, "Shadows = %g +/- %g", status.E, status.SE); CHECK(eq_eps(status.E, 0, 1e-4), 1); diff --git a/src/test_ssol_solver3.c b/src/test_ssol_solver3.c @@ -152,7 +152,8 @@ main(int argc, char** argv) #define DNI_cos (1000 * cos(PI / 4)) CHECK(eq_eps(m, 4 * DNI_cos, 4 * DNI_cos * 2e-1), 1); #define SQR(x) ((x)*(x)) - CHECK(eq_eps(std, sqrt((SQR(400 * DNI_cos) / 100 - SQR(4 * DNI_cos)) / count), 20), 1); + CHECK(eq_eps(std, + sqrt((SQR(400*DNI_cos) / 100 - SQR(4*DNI_cos)) / (double)count), 20), 1); CHECK(ssol_estimator_get_status(estimator, STATUS_SHADOW, &status), RES_OK); logger_print(&logger, LOG_OUTPUT, "Shadows = %g +/- %g", status.E, status.SE); CHECK(eq_eps(status.E, 0, 1e-4), 1); diff --git a/src/test_ssol_solver4.c b/src/test_ssol_solver4.c @@ -1,17 +1,17 @@ /* Copyright (C) CNRS 2016 -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. */ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "ssol.h" #include "test_ssol_utils.h" @@ -36,8 +36,8 @@ #include <star/ssp.h> /******************************************************************************* -* Test main program -******************************************************************************/ + * Test main program + ******************************************************************************/ int main(int argc, char** argv) { @@ -197,3 +197,4 @@ main(int argc, char** argv) return 0; } +