diff options
author | Robin Barker <rmbarker@cpan.org> | 2013-05-01 18:39:26 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-05-06 09:57:23 +0200 |
commit | c85236310706ac0b4217556c41e00d8221e9d047 (patch) | |
tree | 96f055131bc203d7586933dd8d3987f77ab6402f /hv_func.h | |
parent | 9c221ee4de41f3d9f157be3eb25993315147c7ab (diff) | |
download | perl-c85236310706ac0b4217556c41e00d8221e9d047.tar.gz |
Use PTR2IV() instead of casting a pointer to IV, to avoid warnings.
The cast to IV was added to avoid problems on platforms where pointers are
larger than longs. However, the change instead generates warnings on
platforms where IVs are larger than pointers. Instead, use the PTR2IV()
macro provided by perl.h to make everyone happy.
Also change the type of the variable on that line, because it is cast to
STRLEN the first time it is used, and then passed to a macro that assigns it
to an int regardless.
Diffstat (limited to 'hv_func.h')
-rw-r--r-- | hv_func.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -392,8 +392,8 @@ S_perl_hash_murmur3(const unsigned char * const seed, const unsigned char *ptr, /* This CPU does not handle unaligned word access */ /* Consume enough so that the next data byte is word aligned */ - int i = -(IV)ptr & 3; - if(i && (STRLEN)i <= len) { + STRLEN i = -PTR2IV(ptr) & 3; + if(i && i <= len) { MURMUR_DOBYTES(i, h1, carry, bytes_in_carry, ptr, len); } |