Skip to content

Commit 88b5847

Browse files
committed
Set ORTHOTREE_INDEX_T default to uint32_t
1 parent 1845c8b commit 88b5847

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

octree.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,21 @@ SOFTWARE.
2626
/* Settings
2727
* Use the following define-s before the header include
2828
29-
Node center is not stored within the nodes. It will be calculated ad-hoc everytime when it is required, e.g in search algorithm.
29+
Node center is not stored within the nodes. It will be calculated ad-hoc every time when it is required, e.g in search algorithm.
3030
#define ORTHOTREE__DISABLED_NODECENTER
3131
32-
Node size is not stored within the nodes. It will be calculated ad-hoc everytime when it is required, e.g in search algorithm.
32+
Node size is not stored within the nodes. It will be calculated ad-hoc every time when it is required, e.g in search algorithm.
3333
#define ORTHOTREE__DISABLED_NODESIZE
3434
3535
// PMR is used with MSVC only by default. To use PMR anyway
3636
ORTHOTREE__USE_PMR
3737
3838
// To disable PMR on all platforms use:
3939
ORTHOTREE__DISABLE_PMR
40+
41+
// Contiguous container of geometry data does not have specified index type. Octree lib uses index_t for it, it can specified to int or std::size_t.
42+
ORTHOTREE_INDEX_T__INT / ORTHOTREE_INDEX_T__SIZE_T / ORTHOTREE_INDEX_T__UINT_FAST32_T
43+
4044
*/
4145

4246
#if defined(ORTHOTREE__USE_PMR) || defined(_MSC_VER)
@@ -129,12 +133,19 @@ ORTHOTREE__DISABLE_PMR
129133

130134
namespace OrthoTree
131135
{
136+
#ifdef ORTHOTREE_INDEX_T__SIZE_T
137+
using index_t = std::size_t;
138+
#else
139+
#ifdef ORTHOTREE_INDEX_T__UINT_FAST32_T
140+
using index_t = std::uint_fast32_t;
141+
#else
132142
#ifdef ORTHOTREE_INDEX_T__INT
133143
using index_t = int;
134144
#else
135-
using index_t = std::size_t;
145+
using index_t = std::uint32_t;
136146
#endif // ORTHOTREE_INDEX_INT
137-
147+
#endif // ORTHOTREE_INDEX_T__UINT_FAST32_T
148+
#endif // ORTHOTREE_INDEX_T__SIZE_T
138149

139150
#ifdef __clang__
140151
#pragma clang diagnostic push

0 commit comments

Comments
 (0)