Mismatch between sizeof(Partio::ParticleIndex), sizeof(size_t), sizeof(int)
StefanBruens opened this issue · comments
There is some assumption Partio uses size_t for its index type:
OpenShadingLanguage/src/liboslexec/pointcloud.cpp
Lines 360 to 365 in 7e34ce2
which is apparently wrong (for the last 12 years):
https://github.com/wdas/partio/blob/7cb3743c6e19c04ac049c05f8f81af2f24410ea3/src/lib/Partio.h#L55
typedef uint64_t ParticleIndex;
On 32 bit archs the compilation then fails due to:
OpenShadingLanguage/src/liboslexec/pointcloud.cpp
Lines 114 to 118 in 7e34ce2
Wouldn't it be better change it to unsigned long* out_indices
in RendererServices::pointcloud_search
? (This may require a version bump for 64bit archs, but only if size_t != unsigned long
. For 32bit archs, the current code does not work anyway). Dito for pointcloud_get
.