star-vx

Structuring voxels for ray-tracing
git clone git://git.meso-star.fr/star-vx.git
Log | Files | Refs | README | LICENSE

commit 9084849da45305239d79dae39d0ffa5d541274b4
parent e44b9bd5c7b2553b6966d9098620fb61b07e63dc
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 24 Jul 2023 10:24:38 +0200

Fix warnings when using the long long type in C89

Remove the unsupported "ull" from the definition of constants and cast
them into the target type instead, in this case size_t.

Diffstat:
Msrc/svx_bintree.c | 2+-
Msrc/svx_octree.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/svx_bintree.c b/src/svx_bintree.c @@ -129,7 +129,7 @@ svx_bintree_create /* Adjust the binary tree definition with respect to the binary tree depth * since finest levels might be removed during the build due to the merging * process */ - bintree->definition = bintree->definition / (1ull<<bldr.non_empty_lvl); + bintree->definition = bintree->definition / ((size_t)1<<bldr.non_empty_lvl); exit: if(vox.data) MEM_RM(dev->allocator, vox.data); diff --git a/src/svx_octree.c b/src/svx_octree.c @@ -162,7 +162,7 @@ svx_octree_create /* Adjust the octree definition with respect to the octree depth since finest * levels might be removed during the build due to the merging process */ - oct->definition = oct->definition / (1ull << bldr.non_empty_lvl); + oct->definition = oct->definition / ((size_t)1 << bldr.non_empty_lvl); exit: if(vox.data) MEM_RM(dev->allocator, vox.data);