commit cb16a86d95fa5d1544a3b807bce805c6f5d934e5
parent 5239086c3a2496bb7948f10bdc7cf8f4bc5dab37
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 19 Oct 2021 15:34:50 +0200
Fix compilation warnings detected by gcc 11
Diffstat:
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/ssol_shape_c.h b/src/ssol_shape_c.h
@@ -105,7 +105,7 @@ shape_fetched_raw_vertex_attrib
(const struct ssol_shape* shape,
const unsigned ivert,
const enum ssol_attrib_usage usage,
- double value[]);
+ double value[3]);
/* Compute ray/punched shape intersection */
extern LOCAL_SYM int punched_shape_intersect_local
diff --git a/src/test_ssol_cube_geometry.h b/src/test_ssol_cube_geometry.h
@@ -69,7 +69,7 @@ static const float EDGES__ [] = {
X_MAX, Y_MAX, Z_MAX
};
-const unsigned CUBE_NVERTS__ = sizeof(EDGES__) / sizeof(float[3]);
+const unsigned CUBE_NVERTS__ = sizeof(EDGES__) / (3*sizeof(float));
const unsigned TRG_IDS__ [] = {
0, 6, 4,
@@ -85,7 +85,7 @@ const unsigned TRG_IDS__ [] = {
1, 5, 7,
1, 7, 3
};
-const unsigned CUBE_NTRIS__ = sizeof(TRG_IDS__) / sizeof(unsigned[3]);
+const unsigned CUBE_NTRIS__ = sizeof(TRG_IDS__) / (3*sizeof(unsigned));
static const struct desc CUBE_DESC__ = { EDGES__, TRG_IDS__ };
diff --git a/src/test_ssol_rect2D_geometry.h b/src/test_ssol_rect2D_geometry.h
@@ -55,7 +55,7 @@ static double EDGES__ [] = {
X_MAX, Y_MIN
};
-const unsigned POLY_NVERTS__ = sizeof(EDGES__) / sizeof(double[2]);
+const unsigned POLY_NVERTS__ = sizeof(EDGES__) / (2*sizeof(double));
#undef EDGES__
#undef POLY_NVERTS__
diff --git a/src/test_ssol_rect_geometry.h b/src/test_ssol_rect_geometry.h
@@ -57,10 +57,10 @@ static const float EDGES__ [] = {
X_MIN, Y_MAX, 0.f
};
-const unsigned RECT_NVERTS__ = sizeof(EDGES__) / sizeof(float[3]);
+const unsigned RECT_NVERTS__ = sizeof(EDGES__) / (3*sizeof(float));
const unsigned TRG_IDS__ [] = { 0, 2, 1, 2, 0, 3 };
-const unsigned RECT_NTRIS__ = sizeof(TRG_IDS__) / sizeof(unsigned[3]);
+const unsigned RECT_NTRIS__ = sizeof(TRG_IDS__) / (3*sizeof(unsigned));
static const struct desc RECT_DESC__ = { EDGES__, TRG_IDS__ };
diff --git a/src/test_ssol_shape.c b/src/test_ssol_shape.c
@@ -35,7 +35,7 @@ main(int argc, char** argv)
double polygon[] = {
-1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 0.f, -2.f
};
- const size_t npolygon_verts = sizeof(polygon)/sizeof(double[2]);
+ const size_t npolygon_verts = sizeof(polygon)/(2*sizeof(double));
double val[3];
unsigned ids[3];
unsigned i, n;