Skip to content

Commit

Permalink
Fix undefined behavior with certain 32-bit compilers.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlindgren90 committed Oct 1, 2015
1 parent ac643fb commit 89fdfeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libaudcore/util.cc
Expand Up @@ -137,7 +137,7 @@ unsigned int32_hash (unsigned val)

unsigned ptr_hash (const void * ptr)
{
unsigned addr_low = (uintptr_t) ptr;
unsigned addr_high = (uintptr_t) ptr >> 32;
unsigned addr_low = (uint64_t) (uintptr_t) ptr;
unsigned addr_high = (uint64_t) (uintptr_t) ptr >> 32;
return int32_hash (addr_low + addr_high);
}

0 comments on commit 89fdfeb

Please sign in to comment.