commit 0530f5401517ad43382a435a1219d5b6f75f4651
parent e44b9bd5c7b2553b6966d9098620fb61b07e63dc
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 27 Oct 2023 10:58:15 +0200
Merge branch 'feature_posix_make' into develop
Diffstat:
27 files changed, 382 insertions(+), 188 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,12 +1,12 @@
.gitignore
-CMakeCache.txt
-CMakeFiles
-Makefile
-tmp
[Bb]uild*
*.sw[po]
-*.[ao]
-*.orig
+*.[aod]
+*.so
*~
+test*
+!test*.[ch]
+.config
+.test
tags
-
+*.pc
diff --git a/Makefile b/Makefile
@@ -0,0 +1,159 @@
+# Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
+# Copyright (C) 2018 Université Paul Sabatier
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+.POSIX:
+.SUFFIXES: # Clean up default inference rules
+
+include config.mk
+
+LIBNAME_STATIC = libsvx.a
+LIBNAME_SHARED = libsvx.so
+LIBNAME = $(LIBNAME_$(LIB_TYPE))
+
+################################################################################
+# Library building
+################################################################################
+SRC =\
+ src/svx_bintree.c\
+ src/svx_bintree_trace_ray.c\
+ src/svx_buffer.c\
+ src/svx_device.c\
+ src/svx_octree.c\
+ src/svx_octree_trace_ray.c\
+ src/svx_tree.c
+OBJ = $(SRC:.c=.o)
+DEP = $(SRC:.c=.d)
+
+build_library: .config $(DEP)
+ @$(MAKE) -fMakefile $$(for i in $(DEP); do echo -f $${i}; done) \
+ $$(if [ -n "$(LIBNAME)" ]; then \
+ echo "$(LIBNAME)"; \
+ else \
+ echo "$(LIBNAME_SHARED)"; \
+ fi)
+
+$(DEP) $(OBJ): config.mk
+
+$(LIBNAME_SHARED): $(OBJ)
+ $(CC) $(CFLAGS_SO) $(RSYS_CFLAGS) -o $@ $(OBJ) $(LDFLAGS_SO) $(RSYS_LIBS) -lm
+
+$(LIBNAME_STATIC): libsvx.o
+ $(AR) -rc $@ $?
+ $(RANLIB) $@
+
+libsvx.o: $(OBJ)
+ $(LD) -r $(OBJ) -o $@
+ $(OBJCOPY) $(OCPFLAGS) $@
+
+.config: config.mk
+ @if ! $(PKG_CONFIG) --atleast-version $(RSYS_VERSION) rsys; then \
+ echo "rsys $(RSYS_VERSION) not found" >&2; exit 1; fi
+ @echo "config done" > $@
+
+.SUFFIXES: .c .d .o
+.c.d:
+ @$(CC) $(CFLAGS_SO) $(RSYS_CFLAGS) -MM -MT "$(@:.d=.o) $@" $< -MF $@
+
+.c.o:
+ $(CC) $(CFLAGS_SO) $(RSYS_CFLAGS) -DSVX_SHARED_BUILD -c $< -o $@
+
+################################################################################
+# Installation
+################################################################################
+pkg:
+ sed -e 's#@PREFIX@#$(PREFIX)#g'\
+ -e 's#@VERSION@#$(VERSION)#g'\
+ -e 's#@RSYS_VERSION@#$(RSYS_VERSION)#g'\
+ svx.pc.in > svx.pc
+
+svx-local.pc: svx.pc.in
+ sed -e '1d'\
+ -e 's#^includedir=.*#includedir=./src/#'\
+ -e 's#^libdir=.*#libdir=./#'\
+ -e 's#@VERSION@#$(VERSION)#g'\
+ -e 's#@RSYS_VERSION@#$(RSYS_VERSION)#g'\
+ svx.pc.in > $@
+
+install: build_library pkg
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib" $(LIBNAME)
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib/pkgconfig" svx.pc
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/include/star" src/svx.h
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/doc/star-vx" COPYING README.md
+
+uninstall:
+ rm -f "$(DESTDIR)$(PREFIX)/lib/$(LIBNAME)"
+ rm -f "$(DESTDIR)$(PREFIX)/lib/pkgconfig/svx.pc"
+ rm -f "$(DESTDIR)$(PREFIX)/share/doc/star-vx/COPYING"
+ rm -f "$(DESTDIR)$(PREFIX)/share/doc/star-vx/README.md"
+ rm -f "$(DESTDIR)$(PREFIX)/include/star/svx.h"
+
+################################################################################
+# Miscellaneous targets
+################################################################################
+all: build_library build_tests
+
+clean: clean_test
+ rm -f $(OBJ) $(TEST_OBJ) $(LIBNAME)
+ rm -f .config .test libsvx.o svx.pc svx-local.pc
+
+distclean: clean
+ rm -f $(DEP) $(TEST_DEP)
+
+lint:
+ shellcheck -o all make.sh
+
+################################################################################
+# Tests
+################################################################################
+TEST_SRC =\
+ src/test_svx_bintree.c\
+ src/test_svx_bintree_trace_ray.c\
+ src/test_svx_device.c\
+ src/test_svx_octree.c\
+ src/test_svx_octree_trace_ray.c
+TEST_OBJ = $(TEST_SRC:.c=.o)
+TEST_DEP = $(TEST_SRC:.c=.d)
+
+PKG_CONFIG_LOCAL = PKG_CONFIG_PATH="./:$${PKG_CONFIG_PATH}" $(PKG_CONFIG)
+SVX_CFLAGS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --cflags svx-local.pc)
+SVX_LIBS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --libs svx-local.pc)
+
+build_tests: build_library $(TEST_DEP) .test
+ @$(MAKE) -fMakefile -f.test $$(for i in $(TEST_DEP); do echo -f"$${i}"; done) test_bin
+
+test: build_tests
+ @$(SHELL) make.sh run_test $(TEST_SRC)
+
+.test: Makefile
+ @$(SHELL) make.sh config_test $(TEST_SRC) > $@
+
+clean_test:
+ @$(SHELL) make.sh clean_test $(TEST_SRC)
+
+$(TEST_DEP): config.mk svx-local.pc
+ @$(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(SVX_CFLAGS) \
+ -MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@
+
+$(TEST_OBJ): config.mk svx-local.pc
+ $(CC) $(CFLAGS_EXE) $(RSYS_CFLAGS) $(SVX_CFLAGS) -c $(@:.o=.c) -o $@
+
+test_svx_bintree \
+test_svx_bintree_trace_ray \
+test_svx_device \
+test_svx_octree \
+test_svx_octree_trace_ray \
+: config.mk svx-local.pc $(LIBNAME)
+ $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(SVX_LIBS) $(RSYS_LIBS) -lm
diff --git a/README.md b/README.md
@@ -1,42 +1,37 @@
# Star-VoXel
-Star-VX is C library whose purpose is to manage volume elements, named voxels,
-structured as a set of axis aligned cuboids. This library does not know
-anything about the volumic data that it handles: it only provides data
-structures that partition voxels according to user criteria. It also implements
-efficient ways to index voxels into the space partitioning data structures or
-to access them through ray-tracing.
-
-Star-VX proposes 2 hierarchical data structures: the *octree* and the *binary
-tree*. The first one is used to structure regular 3D data while the second one
-is for 1D data. Star-VX build the required data structure following a
-bottom-up strategy: the user submits the set of data to partition as well as
-the policy used to define when voxels can be merged and the merge operator
-itself. The way data are accessed through *indexing* or *ray-tracing* can also be
-finely tuned by the user. In addition of the probe position or the ray to
-trace, one can provide callbacks to stop traversal at a hierarchy level that is
-not a leaf, perform computations at the traversed leaf, discard leafs, etc.
-This gives a full control of the host application on the data structure while
-its memory representation and its accessors are still fully managed internally
-by Star-VX.
-
-## How to build
-
-Star-VX relies on the [CMake](http://www.cmake.org) and the
-[RCMake](https://gitlab.com/vaplv/rcmake/) packages to build. It also depends
-on the [RSys](https://gitlab.com/vaplv/rsys/), library. It is compatible
-GNU/Linux as well as Microsoft Windows 7 and later, both in 64-bits on x86-64
-architectures. It was successfully built with the [GNU Compiler
-Collection](https://gcc.gnu.org) (versions 4.8.5 and later) as well as with
-Microsoft Visual Studio 2015.
-
-First ensure that CMake is installed on your system. Then install the RCMake
-package as well as the aforementioned prerequisites. Finally generate the
-project from the `cmake/CMakeLists.txt` file by appending to the
-`CMAKE_PREFIX_PATH` variable the install directories of its dependencies. The
-resulting project can be edited, built, tested and installed as any CMake
-project. Refer to the [CMake](https://cmake.org/documentation) for further
-informations on CMake.
+Star-VX is a C library designed to manage volume elements, called voxels,
+structured as a set of axis-aligned cuboids. This library knows nothing about
+the volume data it manages: it only provides data structures that partition
+the voxels according to the user's criteria. It also implements efficient
+operators for indexing voxels in space partitioning data structures or for
+accessing them by ray tracing.
+
+Star-VX offers 2 hierarchical data structures: the *octree* and the *binary
+tree*. The former is used to structure regular 3D data, while the latter is
+used for 1D data. Star-VX builds the required data structure following a
+bottom-up strategy: the user submits the data set to be partitioned, as well as
+the policy used to define when voxels can be merged, and the merge operator
+itself. The way in which data is accessed by *indexing* or *ray tracing* can
+also be finely tuned by the user: in addition to the position of the probe or
+the radius to be traced, he can provide callbacks to stop traversal at a
+hierarchical level that is not a leaf, perform calculations at the traversed
+leaf level, reject leaves, and so on. The host application thus has total
+control over the traversal of the data structure, while its in-memory
+representation and accessors are still entirely managed internally by Star-VX.
+
+## Requirements
+
+- C compiler
+- POSIX make
+- pkg-config
+- [RSys](https://gitlab.com/vaplv/rsys)
+
+## Installation
+
+Edit config.mk as needed, then run:
+
+ make clean install
## Release notes
@@ -60,11 +55,9 @@ obsolete.
## License
-Copyright (C) 2018, 2020, 2021 [|Meso|Star>](https://www.meso-star.com)
-(<contact@meso-star.com>).
+Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
Copyright (C) 2018 Université Paul Sabatier
-(<contact-edstar@laplace.univ-tlse.fr>).
-Star-VoXel is free software released under the GPL v3+ license: GNU GPL version
+Star-VX is free software released under the GPL v3+ license: GNU GPL version
3 or later. You are welcome to redistribute it under certain conditions; refer
to the COPYING file for details.
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -1,117 +0,0 @@
-# Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
-# Copyright (C) 2018 Université Paul Sabatier
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-cmake_minimum_required(VERSION 3.1)
-project(svx C)
-enable_testing()
-
-set(SVX_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src)
-option(NO_TEST "Do not build tests" OFF)
-
-################################################################################
-# Check dependencies
-################################################################################
-find_package(RCMake 0.3 REQUIRED)
-find_package(RSys 0.12 REQUIRED)
-
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RCMAKE_SOURCE_DIR})
-include(rcmake)
-include(rcmake_runtime)
-
-include_directories(${RSys_INCLUDE_DIR})
-
-################################################################################
-# Configure and define targets
-################################################################################
-set(VERSION_MAJOR 0)
-set(VERSION_MINOR 2)
-set(VERSION_PATCH 1)
-set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
-
-set(SVX_FILES_SRC
- svx_bintree.c
- svx_bintree_trace_ray.c
- svx_buffer.c
- svx_device.c
- svx_octree.c
- svx_octree_trace_ray.c
- svx_tree.c)
-set(SVX_FILES_INC
- svx_buffer.h
- svx_device.h
- svx_tree.h
- svx_tree_builder.h
- svx_tree_generic_func.h)
-set(SVX_FILES_INC_API
- svx.h)
-
-set(SVX_FILES_DOC COPYING README.md)
-
-# Prepend each file in the `SVX_FILES_<SRC|INC>' list by `SVX_SOURCE_DIR'
-rcmake_prepend_path(SVX_FILES_SRC ${SVX_SOURCE_DIR})
-rcmake_prepend_path(SVX_FILES_INC ${SVX_SOURCE_DIR})
-rcmake_prepend_path(SVX_FILES_INC_API ${SVX_SOURCE_DIR})
-rcmake_prepend_path(SVX_FILES_DOC ${PROJECT_SOURCE_DIR}/../)
-
-if(CMAKE_COMPILER_IS_GNUCC)
- set(MATH_LIB m)
-endif()
-
-add_library(svx SHARED ${SVX_FILES_SRC} ${SVX_FILES_INC} ${SVX_FILES_INC_API})
-target_link_libraries(svx RSys ${MATH_LIB})
-
-set_target_properties(svx PROPERTIES
- DEFINE_SYMBOL SVX_SHARED_BUILD
- VERSION ${VERSION}
- SOVERSION ${VERSION_MAJOR})
-
-rcmake_setup_devel(svx StarVX ${VERSION} star/svx_version.h)
-
-################################################################################
-# Add tests
-################################################################################
-if(NOT NO_TEST)
- function(build_test _name)
- add_executable(${_name}
- ${SVX_SOURCE_DIR}/${_name}.c
- ${SVX_SOURCE_DIR}/test_svx_utils.h)
- target_link_libraries(${_name} svx RSys ${ARGN})
- endfunction()
-
- function(new_test _name)
- build_test(${_name} ${ARGN})
- add_test(${_name} ${_name})
- endfunction()
-
- new_test(test_svx_bintree)
- new_test(test_svx_device)
- new_test(test_svx_octree)
- new_test(test_svx_octree_trace_ray ${MATH_LIB})
- new_test(test_svx_bintree_trace_ray ${MATH_LIB})
-
- rcmake_copy_runtime_libraries(test_svx_octree_trace_ray)
-endif()
-
-################################################################################
-# Define output & install directories
-################################################################################
-install(TARGETS svx
- ARCHIVE DESTINATION bin
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION bin)
-install(FILES ${SVX_FILES_INC_API} DESTINATION include/star)
-install(FILES ${SVX_FILES_DOC} DESTINATION share/doc/star-vx)
-
diff --git a/config.mk b/config.mk
@@ -0,0 +1,77 @@
+VERSION = 0.2.1
+PREFIX = /usr/local
+
+LIB_TYPE = SHARED
+#LIB_TYPE = STATIC
+
+BUILD_TYPE = RELEASE
+#BUILD_TYPE = DEBUG
+
+################################################################################
+# Tools
+################################################################################
+AR = ar
+CC = cc
+LD = ld
+OBJCOPY = objcopy
+PKG_CONFIG = pkg-config
+RANLIB = ranlib
+
+################################################################################
+# Dependencies
+################################################################################
+PCFLAGS_SHARED =
+PCFLAGS_STATIC = --static
+PCFLAGS = $(PCFLAGS_$(LIB_TYPE))
+
+RSYS_VERSION=0.14
+RSYS_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags rsys)
+RSYS_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs rsys)
+
+################################################################################
+# Compilation options
+################################################################################
+WFLAGS =\
+ -Wall\
+ -Wcast-align\
+ -Wconversion\
+ -Wextra\
+ -Wmissing-declarations\
+ -Wmissing-prototypes\
+ -Wshadow
+
+CFLAGS_HARDENED =\
+ -D_FORTIFY_SOURCES=2\
+ -fcf-protection=full\
+ -fstack-clash-protection\
+ -fstack-protector-strong
+
+CFLAGS_COMMON =\
+ -std=c89\
+ -pedantic\
+ -fvisibility=hidden\
+ -fstrict-aliasing\
+ $(CFLAGS_HARDENED)\
+ $(WFLAGS)
+
+CFLAGS_RELEASE = -O2 -DNDEBUG $(CFLAGS_COMMON)
+CFLAGS_DEBUG = -g $(CFLAGS_COMMON)
+CFLAGS = $(CFLAGS_$(BUILD_TYPE))
+
+CFLAGS_SO = $(CFLAGS) -fPIC
+CFLAGS_EXE = $(CFLAGS) -fPIE
+
+################################################################################
+# Linker options
+################################################################################
+LDFLAGS_HARDENED = -Wl,-z,relro,-z,now
+LDFLAGS_DEBUG = $(LDFLAGS_HARDENED)
+LDFLAGS_RELEASE = -s $(LDFLAGS_HARDENED)
+LDFLAGS = $(LDFLAGS_$(BUILD_TYPE))
+
+LDFLAGS_SO = $(LDFLAGS) -shared -Wl,--no-undefined
+LDFLAGS_EXE = $(LDFLAGS) -pie
+
+OCPFLAGS_DEBUG = --localize-hidden
+OCPFLAGS_RELEASE = --localize-hidden --strip-unneeded
+OCPFLAGS = $(OCPFLAGS_$(BUILD_TYPE))
diff --git a/make.sh b/make.sh
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
+# Copyright (C) 2018 Université Paul Sabatier
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+config_test()
+{
+ for i in "$@"; do
+ test=$(basename "${i}" ".c")
+ test_list="${test_list} ${test}"
+ printf "%s: %s\n" "${test}" "src/${test}.o"
+ done
+ printf "test_bin: %s\n" "${test_list}"
+}
+
+run_test()
+{
+ for i in "$@"; do
+ test=$(basename "${i}" ".c")
+
+ printf "%s " "${test}"
+ if "./${test}" > /dev/null 2>&1; then
+ printf "\033[1;32mOK\033[m\n"
+ else
+ printf "\033[1;31mError\033[m\n"
+ fi
+ done 2> /dev/null
+}
+
+clean_test()
+{
+ for i in "$@"; do
+ rm -f "$(basename "${i}" ".c")"
+ done
+}
+
+install()
+{
+ prefix=$1
+ shift 1
+
+ mkdir -p "${prefix}"
+
+ for i in "$@"; do
+ dst="${prefix}/${i##*/}"
+
+ if cmp -s "${i}" "${dst}"; then
+ printf "Up to date %s\n" "${dst}"
+ else
+ printf "Installing %s\n" "${dst}"
+ cp "${i}" "${prefix}"
+ fi
+ done
+}
+
+"$@"
diff --git a/src/svx.h b/src/svx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/svx_bintree.c b/src/svx_bintree.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
@@ -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_bintree_trace_ray.c b/src/svx_bintree_trace_ray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/svx_buffer.c b/src/svx_buffer.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/svx_buffer.h b/src/svx_buffer.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/svx_c.h b/src/svx_c.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/svx_device.c b/src/svx_device.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/svx_device.h b/src/svx_device.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/svx_octree.c b/src/svx_octree.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
@@ -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);
diff --git a/src/svx_octree_trace_ray.c b/src/svx_octree_trace_ray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/svx_tree.c b/src/svx_tree.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/svx_tree.h b/src/svx_tree.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/svx_tree_builder.h b/src/svx_tree_builder.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
@@ -397,7 +397,7 @@ XD(builder_add_voxel)
* The last tree level is actually the level that contains the root node
* while the penultimate describes the root node itself. These 2 levels
* contain all the voxels and can be skipped */
- FOR_EACH(ilvl, 0, bldr->tree_depth-2/*The 2 last voxels contain all voxels*/) {
+ FOR_EACH(ilvl, 0, (size_t)bldr->tree_depth-2/*The 2 last voxels contain all voxels*/) {
uint32_t parent_coords[3] = {UINT32_MAX, UINT32_MAX, UINT32_MAX};
double parent_sz[3];
double parent_low[3];
diff --git a/src/svx_tree_generic_func.h b/src/svx_tree_generic_func.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/test_svx_bintree.c b/src/test_svx_bintree.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/test_svx_bintree_trace_ray.c b/src/test_svx_bintree_trace_ray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/test_svx_device.c b/src/test_svx_device.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/test_svx_octree.c b/src/test_svx_octree.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/test_svx_octree_trace_ray.c b/src/test_svx_octree_trace_ray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/test_svx_utils.h b/src/test_svx_utils.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
* Copyright (C) 2018 Université Paul Sabatier
*
* This program is free software: you can redistribute it and/or modify
diff --git a/svx.pc.in b/svx.pc.in
@@ -0,0 +1,11 @@
+prefix=@PREFIX@
+includedir=${prefix}/include
+libdir=${prefix}/lib
+
+Requires: rsys >= @RSYS_VERSION@
+Name: Star-VX
+Description: Star 3D VoXel library
+Version: @VERSION@
+Libs: -L${libdir} -lsvx
+Libs.private: -lm
+CFlags: -I${includedir}