star-2d

Contour structuring for efficient 2D geometric queries
git clone git://git.meso-star.fr/star-2d.git
Log | Files | Refs | README | LICENSE

commit 5820b52dbcf7167ee1dffcd41bb0600f28b094ba
parent 4c9ed9cb7872617330803e805f750ac851df90ac
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 13 Oct 2021 18:29:08 +0200

Merge branch 'release_0.5.1'

Diffstat:
MREADME.md | 5+++++
Mcmake/CMakeLists.txt | 2+-
Msrc/s2d_scene_view.c | 2+-
Msrc/test_s2d_shape.c | 4++--
Msrc/test_s2d_utils.h | 8++++----
5 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md @@ -97,6 +97,11 @@ with `<STAR2D_INSTALL_DIR>` the install directory of Star-2D and ## Release notes +### Version 0.5.1 + +- Corrects an invalid memory read. +- Fix compilation warnings detected by gcc 11. + ### Version 0.5 Update the API of the filtering function: add the range of the ray as input diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -57,7 +57,7 @@ endif() ################################################################################ set(VERSION_MAJOR 0) set(VERSION_MINOR 5) -set(VERSION_PATCH 0) +set(VERSION_PATCH 1) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) set(S2D_FILES_SRC diff --git a/src/s2d_scene_view.c b/src/s2d_scene_view.c @@ -808,7 +808,7 @@ scene_view_trace_ray intersect_ctx.ws_org[1] = org[1]; intersect_ctx.ws_dir[0] = dir[0]; intersect_ctx.ws_dir[1] = dir[1]; - intersect_ctx.ws_dir[2] = rt_3d ? dir[3] : 0.f; + intersect_ctx.ws_dir[2] = rt_3d ? dir[2] : 0.f; intersect_ctx.ws_range[0] = range[0]; intersect_ctx.ws_range[1] = range[1]; intersect_ctx.scnview = scnview; diff --git a/src/test_s2d_shape.c b/src/test_s2d_shape.c @@ -53,8 +53,8 @@ main(int argc, char** argv) struct s2d_shape* shape_copy; struct s2d_vertex_data vdata[4]; struct s2d_attrib attr; - const unsigned nsegs = sizeof(square_ids) / sizeof(unsigned[2]); - const unsigned nverts = sizeof(square_verts) / sizeof(float[2]); + const unsigned nsegs = square_nsegs; + const unsigned nverts = square_nverts; unsigned n; unsigned ids[2]; unsigned id; diff --git a/src/test_s2d_utils.h b/src/test_s2d_utils.h @@ -46,7 +46,7 @@ static const float square_verts[] = { 9.f, 11.f, 11.f, 11.f }; -const unsigned square_nverts = sizeof(square_verts)/sizeof(float[2]); +const unsigned square_nverts = sizeof(square_verts)/(sizeof(float)*2); const unsigned square_ids[] = { 0, 1, /* Bottom */ @@ -54,14 +54,14 @@ const unsigned square_ids[] = { 2, 3, /* Top */ 3, 0 /* Right */ }; -const unsigned square_nsegs = sizeof(square_ids)/sizeof(unsigned[2]); +const unsigned square_nsegs = sizeof(square_ids)/(sizeof(unsigned)*2); static const struct line_segments_desc square_desc = { square_verts, square_ids }; static const float line_verts[] = { 9.f, 10.f, 11.f, 10.f }; -const unsigned line_nverts = sizeof(line_verts)/sizeof(float[2]); +const unsigned line_nverts = sizeof(line_verts)/(sizeof(float)*2); const unsigned line_ids[] = { 0, 1 }; -const unsigned line_nsegs = sizeof(line_ids)/sizeof(unsigned[2]); +const unsigned line_nsegs = sizeof(line_ids)/(sizeof(unsigned)*2); static const struct line_segments_desc line_desc = { line_verts, line_ids }; static INLINE void