commit d331c22d3285a5d09a3cfb0e1048dd2452f9ef8e
parent 23c6c31bc8371c3f4173ae0e34e603d555f1110d
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 6 Nov 2020 13:44:59 +0100
Coding style consistency
Diffstat:
5 files changed, 28 insertions(+), 23 deletions(-)
diff --git a/src/sdis_solve_boundary_Xd.h b/src/sdis_solve_boundary_Xd.h
@@ -110,11 +110,12 @@ XD(solve_boundary)
res = RES_BAD_ARG;
goto error;
}
- if(args->time_range[0] < 0
- || args->time_range[1] < args->time_range[0]
- || (args->time_range[1] > DBL_MAX
- && args->time_range[0] != args->time_range[1]))
- {
+ if(args->time_range[0] < 0 || args->time_range[1] < args->time_range[0]) {
+ res = RES_BAD_ARG;
+ goto error;
+ }
+ if(args->time_range[1] > DBL_MAX
+ && args->time_range[0] != args->time_range[1]) {
res = RES_BAD_ARG;
goto error;
}
diff --git a/src/sdis_solve_probe_Xd.h b/src/sdis_solve_probe_Xd.h
@@ -61,11 +61,12 @@ XD(solve_probe)
res = RES_BAD_ARG;
goto error;
}
- if(args->time_range[0] < 0
- || args->time_range[1] < args->time_range[0]
- || (args->time_range[1] > DBL_MAX
- && args->time_range[0] != args->time_range[1]))
- {
+ if(args->time_range[0] < 0 || args->time_range[1] < args->time_range[0]) {
+ res = RES_BAD_ARG;
+ goto error;
+ }
+ if(args->time_range[1] > DBL_MAX
+ && args->time_range[0] != args->time_range[1]) {
res = RES_BAD_ARG;
goto error;
}
diff --git a/src/sdis_solve_probe_boundary_Xd.h b/src/sdis_solve_probe_boundary_Xd.h
@@ -61,11 +61,12 @@ XD(solve_probe_boundary)
res = RES_BAD_ARG;
goto error;
}
- if(args->time_range[0] < 0
- || args->time_range[1] < args->time_range[0]
- || (args->time_range[1] > DBL_MAX
- && args->time_range[0] != args->time_range[1]))
- {
+ if(args->time_range[0] < 0 || args->time_range[1] < args->time_range[0]) {
+ res = RES_BAD_ARG;
+ goto error;
+ }
+ if(args->time_range[1] > DBL_MAX
+ && args->time_range[0] != args->time_range[1]) {
res = RES_BAD_ARG;
goto error;
}
diff --git a/src/test_sdis_conducto_radiative.c b/src/test_sdis_conducto_radiative.c
@@ -178,10 +178,11 @@ solid_get_temperature
CHK(vtx != NULL);
CHK(data != NULL);
t0 = ((const struct solid*)sdis_data_cget(data))->t0;
- if(vtx->time > t0)
+ if(vtx->time > t0) {
return UNKNOWN_TEMPERATURE;
- else
+ } else {
return ((const struct solid*)sdis_data_cget(data))->initial_temperature;
+ }
}
/*******************************************************************************
@@ -418,9 +419,9 @@ main(int argc, char** argv)
p_intface->temperature = T1;
solve_args.nrealisations = N;
- if(steady)
+ if(steady) {
solve_args.time_range[0] = solve_args.time_range[1] = INF;
- else {
+ } else {
solve_args.time_range[0] = 100 * (double)isimul;
solve_args.time_range[1] = 4 * solve_args.time_range[0];
}
diff --git a/src/test_sdis_volumic_power.c b/src/test_sdis_volumic_power.c
@@ -115,10 +115,11 @@ solid_get_temperature
CHK(vtx != NULL);
CHK(data != NULL);
t0 = ((const struct solid*)sdis_data_cget(data))->t0;
- if(vtx->time > t0)
+ if(vtx->time > t0) {
return UNKNOWN_TEMPERATURE;
- else
+ } else {
return ((const struct solid*)sdis_data_cget(data))->initial_temperature;
+ }
}
static double
@@ -192,9 +193,9 @@ solve
dim == SDIS_SCENE_2D ? 0 : ssp_rng_uniform_double(rng, 0.1, 0.9);
solve_args.nrealisations = N;
- if(steady)
+ if(steady) {
solve_args.time_range[0] = solve_args.time_range[1] = INF;
- else {
+ } else {
solve_args.time_range[0] = 100 * (double)isimul;
solve_args.time_range[1] = 4 * solve_args.time_range[0];
}