cast to unsigned integers before bitshifting
bitshift on signed values is undefined in c++ standard. http://gna.org/bugs/?25219
This commit is contained in:
parent
b949046236
commit
73b1d79691
1 changed files with 1 additions and 1 deletions
|
@ -57,7 +57,7 @@ const std::vector<map_location::DIRECTION> & map_location::default_dirs() {
|
|||
|
||||
std::size_t hash_value(map_location const & a){
|
||||
std::hash<size_t> h;
|
||||
return h( (a.x << 16) ^ a.y );
|
||||
return h( (static_cast<uint32_t>(a.x) << 16) ^ static_cast<uint32_t>(a.y) );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue