alecthomas / alecthomas/entityx

Compiler warning in compile_time branch.

Aperta
#177 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C++
Stelle
2.3k
Fork
301
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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
static void destroy(Storage &storage, const std::bitset &mask, std::size_t index) {
if (mask.test(component_index::value)) {
storage.template destroy(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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.