commit d348117e0ca677951ab77e567efad13f8bd1fce1
parent 171046ba3ed050eaae32350525de2a80005ba6b1
Author: vaplv <vaplv@free.fr>
Date: Tue, 19 Oct 2021 10:14:38 +0200
Fix warnings detected by gcc 11
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/test_polygon.c b/src/test_polygon.c
@@ -171,13 +171,13 @@ main(int argc, char** argv)
CHK(polygon_vertices_count_get(poly, &nvertices) == RES_OK);
CHK(nvertices == 0);
- FOR_EACH(ivertex, 0, sizeof(vertices)/sizeof(float[3]))
+ FOR_EACH(ivertex, 0, sizeof(vertices)/(3*sizeof(float)))
CHK(polygon_vertex_add(poly, vertices + ivertex * 3) == RES_OK);
CHK(polygon_vertices_count_get(poly, &nvertices) == RES_OK);
- CHK(nvertices == sizeof(vertices)/sizeof(float[3]));
+ CHK(nvertices == sizeof(vertices)/(3*sizeof(float)));
- FOR_EACH(ivertex, 0, sizeof(vertices)/sizeof(float[3])) {
+ FOR_EACH(ivertex, 0, sizeof(vertices)/(3*sizeof(float))) {
CHK(polygon_vertex_get(poly, ivertex, pos) == RES_OK);
CHK(f3_eq_eps(pos, vertices + ivertex*3, 1.e-6f) == 1);
}
@@ -197,8 +197,8 @@ main(int argc, char** argv)
/* After the triangulation the input polygon may be unchanged */
CHK(polygon_vertices_count_get(poly, &nvertices) == RES_OK);
- CHK(nvertices == sizeof(vertices)/sizeof(float[3]));
- FOR_EACH(ivertex, 0, sizeof(vertices)/sizeof(float[3])) {
+ CHK(nvertices == sizeof(vertices)/(3*sizeof(float)));
+ FOR_EACH(ivertex, 0, sizeof(vertices)/(3*sizeof(float))) {
CHK(polygon_vertex_get(poly, ivertex, pos) == RES_OK);
CHK(f3_eq_eps(pos, vertices + ivertex*3, 1.e-6f) == 1);
}