Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert template arg error fix #18

Open
wants to merge 2 commits into
base: spark2
Choose a base branch
from

Conversation

kingscallop
Copy link
Contributor

No description provided.

When compiling to a x86-64 target using gcc, clang and msvc the following error appears:

In file included from spark/include/SPARK_Core.h:38,
                 from spark/src/Core/IO/SPK_IO_Buffer.cpp:22:
spark/include/Core/SPK_DescriptionDefines.h:266:123: error: could not convert template argument ‘&SPK::Group::getCapacity’ from ‘size_t (SPK::Group::*)() const’ {aka ‘long unsigned int (SPK::Group::*)() const’} to ‘unsigned int (SPK::Group::*)() const’
  266 |                                                                 ::template store<SPK_UNPACK_GETTERS_(_spk_obj,__VA_ARGS__)>,\
      |
spark/include/Core/SPK_DescriptionDefines.h:154:25: note: in definition of macro ‘_spk_description_body’
  154 |                         __VA_ARGS__ \
      |                         ^~~~~~~~~~~
spark/include/Core/SPK_Group.h:373:25: note: in expansion of macro ‘spk_attribute’
  373 |                         spk_attribute(unsigned int, capacity, reallocate, getCapacity);
      |                         ^~~~~~~~~~~~~

On a x86-64 target (using those compilers) the size of size_t is 64bit and the size of
unsigned int is 32bit hence the 'could not convert' error.

The ParticleData struct field nbParticles was also set to unsigned int fix the packing.
@caxapexac caxapexac mentioned this pull request Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant