commit 8447e4fce7350aeaab70aa525bd1caf8dd51337a
parent ee8da2e52e126d6e07ea4b5f83771cd3f1502467
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Tue, 3 Mar 2020 15:14:10 +0100
Small cnges in asserts
Diffstat:
1 file changed, 10 insertions(+), 17 deletions(-)
diff --git a/src/senc2d_sXd_helper.h b/src/senc2d_sXd_helper.h
@@ -19,7 +19,6 @@
#include "senc2d.h"
#include <rsys/rsys.h>
-#include <rsys/float2.h>
/* Get vertex indices for the iseg_th segment.
* Suitable for use as get_indice callback in s2d_mesh_setup_indexed_vertices
@@ -31,10 +30,8 @@ senc2d_sXd_scene_get_indices
void* ctx)
{
const struct senc2d_scene* scene = ctx;
- res_T r;
ASSERT(indices && scene);
- r = senc2d_scene_get_segment(scene, iseg, indices);
- ASSERT(r == RES_OK); (void)r;
+ SENC2D(scene_get_segment(scene, iseg, indices));
}
/* Get coordinates for the ivert_th vertex.
@@ -47,12 +44,11 @@ senc2d_sXd_scene_get_position
void* ctx)
{
const struct senc2d_scene* scene = ctx;
- double tmp[2];
- res_T r;
+ double tmp[SENC2D_GEOMETRY_DIMENSION];
+ int i;
ASSERT(coord && scene);
- r = senc2d_scene_get_vertex(scene, ivert, tmp);
- ASSERT(r == RES_OK); (void)r;
- f2_set_d2(coord, tmp);
+ SENC2D(scene_get_vertex(scene, ivert, tmp));
+ FOR_EACH(i, 0, SENC2D_GEOMETRY_DIMENSION) coord[i] = (float)tmp[i];
}
/* Get vertex indices for the iseg_th segment of the enclosure.
@@ -65,10 +61,8 @@ senc2d_sXd_enclosure_get_indices
void* ctx)
{
const struct senc2d_enclosure* enclosure = ctx;
- res_T r;
ASSERT(indices && ctx);
- r = senc2d_enclosure_get_segment(enclosure, iseg, indices);
- ASSERT(r == RES_OK); (void)r;
+ SENC2D(enclosure_get_segment(enclosure, iseg, indices));
}
/* Get coordinates for the ivert_th vertex of the enclosure.
@@ -81,12 +75,11 @@ senc2d_sXd_enclosure_get_position
void* ctx)
{
const struct senc2d_enclosure* enclosure = ctx;
- double tmp[2];
- res_T r;
+ double tmp[SENC2D_GEOMETRY_DIMENSION];
+ int i;
ASSERT(coord && ctx);
- r = senc2d_enclosure_get_vertex(enclosure, ivert, tmp);
- ASSERT(r == RES_OK); (void)r;
- f2_set_d2(coord, tmp);
+ SENC2D(enclosure_get_vertex(enclosure, ivert, tmp));
+ FOR_EACH(i, 0, SENC2D_GEOMETRY_DIMENSION) coord[i] = (float)tmp[i];
}
#endif /* SENC2D_S2D_WRAPPER_H */