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

Compiler warning in compile_time branch. #177

Open
assumptionsoup opened this issue Feb 24, 2017 · 1 comment
Open

Compiler warning in compile_time branch. #177

assumptionsoup opened this issue Feb 24, 2017 · 1 comment

Comments

@assumptionsoup
Copy link

assumptionsoup commented Feb 24, 2017

I'm seeing this warning from the compile_time branch:

entityx\entityx/entityx.hh(240): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data

Because

struct Components {
  ...
  template <class Storage, class C>
  static void destroy(Storage &storage, const std::bitset<component_count> &mask, std::size_t index) {
    if (mask.test(component_index<C>::value)) {
      storage.template destroy<C>(index);
    }
  }

The Components.destroy method takes size_t (and it looks like most of the storage classes use size_t), but the index of an Id is uint32_t. I'm compiling a 64bit executable, so I guess size_t is a uint64_t on my machine.

@roig
Copy link
Contributor

roig commented Apr 8, 2017

Try again with the latest changes. now it's an uint32_t.

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

No branches or pull requests

2 participants