[v3] Fix hash_prime_size_policy_imp for 64-bit machines
Paolo Carlini
pcarlini@suse.de
Thu Jun 22 14:53:00 GMT 2006
Jonathan Lennox wrote:
>>+ /* 30 */ (unsigned long)8589934583ull,
>>+ /* 31 */ (unsigned long)17179869143ull,
>>+ /* 32 */ (unsigned long)34359738337ull,
>>
>>
>Does this work if sizeof(unsigned long) < sizeof(std::size_t), e.g. 32-bit
>long and 64-bit size_t? I don't know if that's a supported configuration,
>but it seems like this could be avoided by making just making this cast to
>std::size_t in general.
>
Yes, I agree a cast to size_t is better, I will do the change. The
problem ultimately is due to the fact that this code is adapted from
tr1::hashatable where there are only unsigned longs involved.
Paolo.
More information about the Gcc-patches
mailing list