Skip to content

Convert template arg error fix - #18

Open
kingscallop wants to merge 2 commits into
Synxis:spark2from
kingscallop:convert-template-arg-error-fix
Open

Convert template arg error fix#18
kingscallop wants to merge 2 commits into
Synxis:spark2from
kingscallop:convert-template-arg-error-fix

Conversation

@kingscallop

Copy link
Copy Markdown
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