Daniel, thanks for the information. I have already converted the code to
use 'char *' in r39973.
Later I plan switch the hash to (revnum, offset) => (checksum, refcount)
in order to do the counting correctly. As a side effect this will get rid
of the counter-inside-a-pointer tricks.
Thanks,
Daniel
Daniel Widenfalk wrote on Tue, 13 Oct 2009 at 08:30 +0200:
> David Glasser wrote:
> > <snip>
> >
> > Also, I'm not really sure that casting unsigned int<->void* is
> > technically well-defined.
>
> Hi all,
>
> Excuse me for barging in like this but as I've got some
> cross compiler development background I feel like I could
> give you a small nugget of information here.
>
> The cast is well defined but may not work on 64-bit
> architectures that define int as a 32 bit type (or any arch
> where a (default) pointer is larger than an int). You should
> consider using uintptr_t (or intptr_t), which is defined in
> <stddef.h>, whenever you need to do freaky stuff with pointers.
> Or simply cast to a char * (assuming, of course, that a char
> is 8 bits...).
>
> Regards
> /Daniel Widenfalk
>
>
>
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2407103
Received on 2009-10-13 23:47:51 CEST