[Freeciv-Dev] Re: int -> void*, was Re: [RFC] Attaching information to o
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Falk Hueffner <falk.hueffner@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> [1] It seems when using ints as keys, the current code uses the void*
> of the hash_bucket to point to the int, instead of stuffing the int
> directly into the void* (which should always be at least as large as
> an int). Is there a certain reason for this?
Is it guaranteed by the language that stuffing the int into the
void* will always work, or does it just happen to work on most
(all?) platforms?
Eg, could you have a platform on which a particular int bit pattern
happened to be invalid as a pointer value, and the implementation
happened to notice this at runtime and throw up its hands in horror?
-- David
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
|
|